2017-01-23 22:27:01 +03:00
|
|
|
# Usage: ./update.sh [<git-rev-to-use>]
|
2012-03-19 20:21:05 +04:00
|
|
|
#
|
|
|
|
# Copies the needed files from a directory containing the original
|
2017-01-23 22:27:01 +03:00
|
|
|
# double-conversion source that we need. If no revision is specified, the tip
|
|
|
|
# revision is used.
|
2012-03-19 20:21:05 +04:00
|
|
|
|
2013-06-28 03:25:32 +04:00
|
|
|
# This was last updated with git rev 04cae7a8d5ef3d62ceffb03cdc3d38f258457a52.
|
2012-10-30 23:30:08 +04:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-01-24 02:10:47 +03:00
|
|
|
LOCAL_PATCHES=""
|
|
|
|
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES add-mfbt-api-markers.patch"
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES use-StandardInteger.patch"
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES use-mozilla-assertions.patch"
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES use-static_assert.patch"
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES ToPrecision-exponential.patch"
|
|
|
|
LOCAL_PATCHES="$LOCAL_PATCHES fix-Wshadow-issues.patch"
|
|
|
|
|
2017-01-23 22:27:01 +03:00
|
|
|
TMPDIR=`mktemp --directory`
|
|
|
|
LOCAL_CLONE="$TMPDIR/double-conversion"
|
|
|
|
|
|
|
|
git clone https://github.com/google/double-conversion.git "$LOCAL_CLONE"
|
|
|
|
|
|
|
|
REV=""
|
|
|
|
|
|
|
|
if [ "$1" != "" ]; then
|
|
|
|
git -C "$LOCAL_CLONE" checkout "$1"
|
|
|
|
fi
|
|
|
|
|
2017-01-24 02:10:47 +03:00
|
|
|
# First clear out everything already present.
|
2017-01-24 02:11:50 +03:00
|
|
|
DEST=./source
|
|
|
|
rm -rf "$DEST"
|
|
|
|
mkdir "$DEST"
|
2017-01-24 02:10:47 +03:00
|
|
|
|
|
|
|
# Copy over critical files.
|
2017-01-24 02:11:50 +03:00
|
|
|
cp "$LOCAL_CLONE/LICENSE" "$DEST/"
|
|
|
|
cp "$LOCAL_CLONE/README" "$DEST/"
|
2012-03-19 20:21:05 +04:00
|
|
|
|
|
|
|
# Includes
|
2017-01-23 22:27:01 +03:00
|
|
|
for header in "$LOCAL_CLONE/src/"*.h; do
|
2017-01-24 02:11:50 +03:00
|
|
|
cp "$header" "$DEST/"
|
2017-01-23 22:27:01 +03:00
|
|
|
done
|
2012-03-19 20:21:05 +04:00
|
|
|
|
|
|
|
# Source
|
2017-01-23 22:27:01 +03:00
|
|
|
for ccfile in "$LOCAL_CLONE/src/"*.cc; do
|
2017-01-24 02:11:50 +03:00
|
|
|
cp "$ccfile" "$DEST/"
|
2017-01-23 22:27:01 +03:00
|
|
|
done
|
2012-03-19 20:21:05 +04:00
|
|
|
|
2017-01-24 02:10:47 +03:00
|
|
|
# Now apply our local patches.
|
|
|
|
for patch in $LOCAL_PATCHES; do
|
2017-01-24 02:11:50 +03:00
|
|
|
patch --directory "$DEST" --strip 4 < "$patch"
|
2017-01-24 02:10:47 +03:00
|
|
|
done
|
2017-01-24 02:11:50 +03:00
|
|
|
|
|
|
|
# Update Mercurial file status.
|
|
|
|
hg addremove "$DEST"
|