Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / mozglue / misc / decimal / update.sh
blob696685f9ba2dfe9008c15564757bf28008137dab
1 # Usage: ./update.sh [blink-core-source-directory]
3 # Copies the needed files from a directory containing the original
4 # Decimal.h and Decimal.cpp source that we need.
5 # If [blink-core-source-directory] is not specified, this script will
6 # attempt to download the latest versions using git.
8 set -e
10 FILES=(
11 "Decimal.h"
12 "Decimal.cpp"
15 OWN_NAME=`basename $0`
17 if [ $# -gt 1 ]; then
18 echo "$OWN_NAME: Too many arguments">&2
19 exit 1
22 if [ $# -eq 1 ]; then
23 BLINK_CORE_DIR="$1"
24 for F in "${FILES[@]}"
26 P="$BLINK_CORE_DIR/$F"
27 if [ ! -f "$P" ]; then
28 echo "$OWN_NAME: Couldn't find file: $P">&2
29 exit 1
31 done
32 for F in "${FILES[@]}"
34 P="$BLINK_CORE_DIR/$F"
35 cp "$P" .
36 done
37 else
38 #LATEST_SHA=$(cat UPSTREAM-GIT-SHA)
39 LATEST_SHA=$(git ls-remote https://chromium.googlesource.com/chromium/src.git/ | awk "/refs\/heads\/master/ {print \$1}")
40 REPO_PATH="https://chromium.googlesource.com/chromium/src.git/+/$LATEST_SHA/third_party/WebKit/Source/platform"
41 #REPO_PATH="https://github.com/WebKit/webkit/tree/master/Source/WebCore/platform"
42 for F in "${FILES[@]}"
44 printf "Downloading `basename $F`..."
45 curl "$REPO_PATH/${F}?format=TEXT" | base64 -D > "$F"
46 echo done.
47 done
48 echo $LATEST_SHA > UPSTREAM-GIT-SHA
51 # Apply patches:
53 patch -p4 < zero-serialization.patch
54 patch -p4 < comparison-with-nan.patch
55 patch -p4 < mfbt-abi-markers.patch
56 patch -p4 < to-moz-dependencies.patch
57 patch -p4 < add-doubleconversion-impl.patch
58 patch -p4 < moz-constexpr-decimal.patch
59 # The following is disabled. See
60 # https://bugzilla.mozilla.org/show_bug.cgi?id=1208357#c7
61 #patch -p4 < fix-wshadow-warnings.patch