Bug 1523562 [wpt PR 14802] - [Animation Worklet] Upstream worklet animation with...
[gecko.git] / modules / fdlibm / update.sh
blob47578f098d5b6cfd63dc7731a7d12a64fbe64953
1 #!/bin/sh
3 # Script to update the mozilla in-tree copy of the fdlibm library.
4 # Run this within the /modules/fdlibm directory of the source tree.
6 set -e
8 API_BASE_URL=https://api.github.com/repos/freebsd/freebsd
10 get_commit() {
11 curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
12 | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
14 get_date() {
15 curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
16 | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["commit"]["committer"]["date"])'
19 mv ./src/moz.build ./src_moz.build
20 rm -rf src
21 BEFORE_COMMIT=$(get_commit)
22 sh ./import.sh
23 mv ./src_moz.build ./src/moz.build
24 COMMIT=$(get_commit)
25 COMMITDATE=$(get_date)
26 if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
27 echo "Latest commit is changed during import. Please run again."
28 exit 1
30 for FILE in $(ls patches/*.patch | sort); do
31 echo "Applying ${FILE} ..."
32 patch -p3 < ${FILE}
33 done
34 hg add src
36 perl -p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
38 echo "###"
39 echo "### Updated fdlibm/src to ${COMMIT}."
40 echo "### Remember to verify and commit the changes to source control!"
41 echo "###"