Bug 1343336 Include commit date in Mozilla README
MozReview-Commit-ID: 1tROG2vpdqH
--- a/modules/fdlibm/README.mozilla
+++ b/modules/fdlibm/README.mozilla
@@ -6,12 +6,12 @@ Upstream code can be viewed at
Each file is downloaded separately, as cloning whole repository takes so much
resources.
The in-tree copy is updated by running
sh update.sh
from within the modules/fdlibm directory.
-Current version: [commit f2287da07ac7a26ac08745cac66eec82ab9ba384].
+Current version: [commit f2287da07ac7a26ac08745cac66eec82ab9ba384 (2016-09-04T12:01:32Z)].
patches 01-14 fixes files to be usable within mozilla-central tree.
See https://bugzilla.mozilla.org/show_bug.cgi?id=933257
--- a/modules/fdlibm/update.sh
+++ b/modules/fdlibm/update.sh
@@ -6,30 +6,35 @@
set -e
API_BASE_URL=https://api.github.com/repos/freebsd/freebsd
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?path=lib/msun/src&per_page=1" \
+ | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["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)
+COMMITDATE=$(get_date)
if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
echo "Latest commit is changed during import. Please run again."
exit 1
fi
for FILE in $(ls patches/*.patch | sort); do
patch -p3 < ${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}."
echo "### Remember to verify and commit the changes to source control!"
echo "###"