OSDN Git Service

tool/bisect: add some magic to make the bisect tool be useable when its not part...
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jul 2012 11:53:26 +0000 (13:53 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Jul 2012 11:10:06 +0000 (13:10 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
.gitignore
tools/bisect

index 4be9334..ac5b7cc 100644 (file)
@@ -47,6 +47,7 @@
 /tests/videogen
 /tests/vsynth1/
 /tools/aviocat
+/tools/ffbisect
 /tools/cws2fws
 /tools/ffeval
 /tools/graph2dot
index de43f68..f840243 100755 (executable)
@@ -2,6 +2,23 @@
 
 set -e
 
+if test "bisect" = "`basename $0`" ; then
+    echo WARNING, trying to execute tools/bisect directly this cannot work as
+    echo the script itself would not be available in older checkouts
+    echo please use tools/ffbisect
+    git show master:tools/bisect > tools/ffbisect
+    chmod u+x tools/ffbisect
+    exit 1
+fi
+
+if ! git show master:tools/bisect | diff - tools/ffbisect > /dev/null ; then
+    echo updating tools/ffbisect script to HEAD.
+    git show master:tools/bisect > tools/ffbisect
+    chmod u+x tools/ffbisect
+    tools/ffbisect $*
+    exit 0
+fi
+
 case "$1" in
     need)
         case $2 in