media/audioipc/update.sh
author Andrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 09 Oct 2018 14:24:37 +0000
changeset 495996 f81c0fafcb2fe5c1bce5e4736dda88a1aedde204
parent 452751 23ba5e1c773f1fb472d7fe3b5c4fccb5e7666eed
child 498025 08ca28f32dcd7c69277a8f0d393f6f435860eae4
permissions -rwxr-xr-x
Bug 1496828 - [mochitest] Fix mochitest selftest regression by always instantiating self.extraPrefs, r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D8087

# Usage: sh update.sh <upstream_src_directory>
set -e

cp -p $1/README.md .
cp -p $1/Cargo.toml .

for crate in audioipc client server; do
    test -d $crate/src || mkdir -p $crate/src
    rm -fr $crate/*
    cp -pr $1/$crate/Cargo.toml $crate/
    cp -pr $1/$crate/src/ $crate/src/
done

if [ -d $1/.git ]; then
  rev=$(cd $1 && git rev-parse --verify HEAD)
  date=$(cd $1 && git show -s --format=%ci HEAD)
  dirty=$(cd $1 && git diff-index --name-only HEAD)
fi

if [ -n "$rev" ]; then
  version=$rev
  if [ -n "$dirty" ]; then
    version=$version-dirty
    echo "WARNING: updating from a dirty git repository."
  fi
  sed -i.bak -e "/The git commit ID used was/ s/[0-9a-f]\{40\}\(-dirty\)\{0,1\} .\{1,100\}/$version ($date)/" README_MOZILLA
  rm README_MOZILLA.bak
else
  echo "Remember to update README_MOZILLA with the version details."
fi

echo "Applying gecko.patch on top of $rev"
patch -p3 < gecko.patch