changeset 1261:e093423880fc

Replace bisectinate's built-in tests with a test specified on the command line.
author Rob Landley <rob@landley.net>
date Thu, 07 Oct 2010 23:54:33 -0500
parents fecb576b7e18
children f5c448622393
files more/bisectinate.sh
diffstat 1 files changed, 21 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/more/bisectinate.sh	Thu Oct 07 23:53:23 2010 -0500
+++ b/more/bisectinate.sh	Thu Oct 07 23:54:33 2010 -0500
@@ -7,9 +7,9 @@
 
 set -o pipefail
 
-if [ $# -ne 4 ]
+if [ $# -lt 4 ]
 then
-  echo "usage: [LONG=1] bisectinate ARCH PACKAGE REPO[@BAD] GOOD" >&2
+  echo "usage: [LONG=1] bisectinate ARCH PACKAGE REPO[@BAD] GOOD [TEST...]" >&2
   echo >&2
   echo "Bisect PACKAGE for ARCH, from START to BAD within REPO" >&2
   echo "If LONG is set, success means building dropbear natively." >&2
@@ -24,6 +24,8 @@
 BRANCH="${3/*@/}"
 [ "$BRANCH" == "$3" ] && BRANCH=master
 START="$4"
+shift 4
+TEST="$1"
 
 TOP="$(pwd)"
 [ -z "$SRCDIR" ] && SRCDIR="$TOP/packages"
@@ -35,6 +37,20 @@
   exit 1
 fi
 
+if [ -z "$TEST" ]
+then
+  if [ -z "$LONG" ]
+  then
+    TEST=true
+  else
+    # With $LONG, success means natively building dropbear.
+    TEST='rm -rf "$BUILD"/system-image-"$ARCH"/upload/dropbearmulti &&
+          more/native-build-from-build.sh "$ARCH" \
+          build/control-images/static-tools.hdc 
+          test -e "$BUILD"/system-image-"$ARCH"/upload/dropbearmulti'
+  fi
+fi
+
 # For kernel and busybox bisects, only redo part of the build
 
 if [ "$PKG" == linux ] && [ -e "$BUILD/root-filesystem-$ARCH".tar.bz2 ]
@@ -104,20 +120,9 @@
   RESULT=bad
   if [ -e "$BUILD"/system-image-"$ARCH".tar.bz2 ]
   then
-    if [ -z "$LONG" ]
-    then
-      RESULT=good
-    else
-
-     # With $LONG, success means natively building dropbear, so try that.
-
-     rm -rf "$BUILD"/system-image-"$ARCH"/upload/dropbearmulti
-     more/timeout.sh 60 more/native-build-from-build.sh "$ARCH" \
-       build/control-images/static-tools.hdc 2>&1 \
-       | tee -a "$BUILD"/logs/bisectinate-"$ARCH".txt
-
-      [ -e "$BUILD"/cron-temp/"$ARCH"-dropbearmulti ] && RESULT=good
-    fi
+    set -o pipefail
+    more/timeout.sh 60 "$@" 2>&1 | tee -a "$BUILD/logs/bisectinate-$ARCH".txt
+    [ $? -eq 0 ] && RESULT=good
   fi
 
   # Keep the last "good" and "bad" logs, separately.