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?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
21 BEFORE_COMMIT
=$
(get_commit
)
23 mv .
/src_moz.build .
/src
/moz.build
25 COMMITDATE
=$
(get_date
)
26 if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
27 echo "Latest commit is changed during import. Please run again."
30 for FILE
in $
(ls patches
/*.
patch |
sort); do
31 echo "Applying ${FILE} ..."
36 perl
-p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
39 echo "### Updated fdlibm/src to ${COMMIT}."
40 echo "### Remember to verify and commit the changes to source control!"