summaryrefslogtreecommitdiffstats
path: root/modules/fdlibm/update.sh
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-15 15:17:01 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-15 15:17:01 +0100
commit5e902a4a9a25a9e151b5d3945c68517bc0c73139 (patch)
treea2e314bc193f4bdd52bb45adfc12f2803c265469 /modules/fdlibm/update.sh
parent6ca0b4704367f8804e0373cb439e6e17e5146e4a (diff)
downloadUXP-5e902a4a9a25a9e151b5d3945c68517bc0c73139.tar
UXP-5e902a4a9a25a9e151b5d3945c68517bc0c73139.tar.gz
UXP-5e902a4a9a25a9e151b5d3945c68517bc0c73139.tar.lz
UXP-5e902a4a9a25a9e151b5d3945c68517bc0c73139.tar.xz
UXP-5e902a4a9a25a9e151b5d3945c68517bc0c73139.zip
Issue #1291 - Part 3: Update fdlibm to Sept 2019 version
Diffstat (limited to 'modules/fdlibm/update.sh')
-rw-r--r--modules/fdlibm/update.sh23
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/fdlibm/update.sh b/modules/fdlibm/update.sh
index 3413b6b78..90d417862 100644
--- a/modules/fdlibm/update.sh
+++ b/modules/fdlibm/update.sh
@@ -11,23 +11,28 @@ get_commit() {
curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
| python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
}
+get_date() {
+ curl -s "${API_BASE_URL}/commits/${COMMIT}" \
+ | python -c 'import json, sys; print(json.loads(sys.stdin.read())["commit"]["committer"]["date"])'
+}
mv ./src/moz.build ./src_moz.build
rm -rf src
-BEFORE_COMMIT=$(get_commit)
-sh ./import.sh
-mv ./src_moz.build ./src/moz.build
-COMMIT=$(get_commit)
-if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
- echo "Latest commit is changed during import. Please run again."
- exit 1
+if [ "$#" -eq 0 ]; then
+ COMMIT=$(get_commit)
+else
+ COMMIT="$1"
fi
+sh ./import.sh "${COMMIT}"
+mv ./src_moz.build ./src/moz.build
+COMMITDATE=$(get_date)
for FILE in $(ls patches/*.patch | sort); do
- patch -p3 < ${FILE}
+ echo "Applying ${FILE} ..."
+ patch -p3 --no-backup-if-mismatch < ${FILE}
done
hg add src
-perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[commit ${COMMIT}]/" README.mozilla
+perl -p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
echo "###"
echo "### Updated fdlibm/src to ${COMMIT}."