Debian Codegraph @

mozglue/misc/decimal/update.sh

raw
1 # Usage: ./update.sh [blink-core-source-directory]
2 #
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.
7
8 set -e
9
10 FILES=(
11 "Decimal.h"
12 "Decimal.cpp"
13 )
14
15 OWN_NAME=`basename $0`
16
17 if [ $# -gt 1 ]; then
18 echo "$OWN_NAME: Too many arguments">&2
19 exit 1
20 fi
21
22 if [ $# -eq 1 ]; then
23 BLINK_CORE_DIR="$1"
24 for F in "${FILES[@]}"
25 do
26 P="$BLINK_CORE_DIR/$F"
27 if [ ! -f "$P" ]; then
28 echo "$OWN_NAME: Couldn't find file: $P">&2
29 exit 1
30 fi
31 done
32 for F in "${FILES[@]}"
33 do
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[@]}"
43 do
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
49 fi
50
51 # Apply patches:
52
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