summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-29 21:05:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-29 21:12:08 +0900
commitf6256d8b7eb97557dac3cb7a99bcde9e81b972d1 (patch)
tree5161a72474e67f9f848a65292316f4a6721628f6
parentb7163c712c376fd8dc01a5e3bdd44f02ae578001 (diff)
bisect.sh: Apply bisect.patch if exists [ci skip]
For some external reasons, e.g. Bison 3.5.91, some commits need to be applied retroactively in order to pass builds.
-rwxr-xr-xtool/bisect.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/tool/bisect.sh b/tool/bisect.sh
index 3b97707142..dfc3a64041 100755
--- a/tool/bisect.sh
+++ b/tool/bisect.sh
@@ -38,6 +38,18 @@ case $1 in
;;
esac
+# Apply $(srcdir)/bisect.patch to build if exists
+# e.g., needs 5c2508060b~2..5c2508060b to use Bison 3.5.91.
+if [ -f bisect.patch ]; then
+ if ! patch -p1 -N < bisect.patch || git diff --no-patch --exit-code; then
+ exit 125
+ fi
+ git status
+ exec=
+else
+ exec=exec
+fi
+
case "$0" in
*/*)
# assume a copy of this script is in builddir
@@ -47,4 +59,7 @@ esac
for target in srcs Makefile $prep; do
$MAKE $target || exit 125
done
-exec $MAKE $run
+$exec $MAKE $run
+status=$?
+git checkout -f HEAD
+exit $status