mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
eeb4781489
MozReview-Commit-ID: 59RmjjGh9Wq --HG-- extra : rebase_source : 76954db0f17e6fa80e71f02071874eda41306c8f
34 lines
913 B
Bash
Executable File
34 lines
913 B
Bash
Executable File
# 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
|