Bug 1637882 [wpt PR 23590] - Annotate idlharness-sw.https.html slow, a=testonly
[gecko.git] / modules / fdlibm / update.sh
blob90d41786263a5235714fbd36eb3fd87ffbbd5e3f
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/${COMMIT}" \
16 | python -c 'import json, sys; print(json.loads(sys.stdin.read())["commit"]["committer"]["date"])'
19 mv ./src/moz.build ./src_moz.build
20 rm -rf src
21 if [ "$#" -eq 0 ]; then
22 COMMIT=$(get_commit)
23 else
24 COMMIT="$1"
26 sh ./import.sh "${COMMIT}"
27 mv ./src_moz.build ./src/moz.build
28 COMMITDATE=$(get_date)
29 for FILE in $(ls patches/*.patch | sort); do
30 echo "Applying ${FILE} ..."
31 patch -p3 --no-backup-if-mismatch < ${FILE}
32 done
33 hg add src
35 perl -p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
37 echo "###"
38 echo "### Updated fdlibm/src to ${COMMIT}."
39 echo "### Remember to verify and commit the changes to source control!"
40 echo "###"