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.
8 API_BASE_URL
=https
://api.github.com
/repos
/freebsd
/freebsd
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"])'
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
21 if [ "$#" -eq 0 ]; then
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}
35 perl
-p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
38 echo "### Updated fdlibm/src to ${COMMIT}."
39 echo "### Remember to verify and commit the changes to source control!"