Bug 1564117 - Part 2: Allow to reimport a specific fdlibm commit. r=arai

This makes it easier to test if modified patch files still apply.

Additionally "--no-backup-if-mismatch" was added to the `patch` command to
avoid generating ".orig" files.

Depends on D37256

Differential Revision: https://phabricator.services.mozilla.com/D37257

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2019-07-08 16:52:47 +00:00
Родитель eebb17f171
Коммит 1ce1fec25f
3 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -9,6 +9,8 @@ resources.
The in-tree copy is updated by running
sh update.sh
or
sh update.sh <sha-commit>
from within the modules/fdlibm directory.
Current version: [commit b21ccf63f28a3a4692d8a31419e0a725a1b1a800 (2018-02-14T07:59:30Z)].

Просмотреть файл

@ -2,7 +2,7 @@
set -e
BASE_URL=https://raw.githubusercontent.com/freebsd/freebsd/master/lib/msun/src
BASE_URL=https://raw.githubusercontent.com/freebsd/freebsd/"${1}"/lib/msun/src
download_source() {
REMOTE_FILENAME=$1

Просмотреть файл

@ -12,24 +12,23 @@ get_commit() {
| 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"])'
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)
COMMITDATE=$(get_date)
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
echo "Applying ${FILE} ..."
patch -p3 < ${FILE}
patch -p3 --no-backup-if-mismatch < ${FILE}
done
hg add src