Browse code

tool/bisect: add some magic to make the bisect tool be useable when its not part of a checkout

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/07/03 20:53:26
Showing 2 changed files
... ...
@@ -47,6 +47,7 @@
47 47
 /tests/videogen
48 48
 /tests/vsynth1/
49 49
 /tools/aviocat
50
+/tools/ffbisect
50 51
 /tools/cws2fws
51 52
 /tools/ffeval
52 53
 /tools/graph2dot
... ...
@@ -2,6 +2,23 @@
2 2
 
3 3
 set -e
4 4
 
5
+if test "bisect" = "`basename $0`" ; then
6
+    echo WARNING, trying to execute tools/bisect directly this cannot work as
7
+    echo the script itself would not be available in older checkouts
8
+    echo please use tools/ffbisect
9
+    git show master:tools/bisect > tools/ffbisect
10
+    chmod u+x tools/ffbisect
11
+    exit 1
12
+fi
13
+
14
+if ! git show master:tools/bisect | diff - tools/ffbisect > /dev/null ; then
15
+    echo updating tools/ffbisect script to HEAD.
16
+    git show master:tools/bisect > tools/ffbisect
17
+    chmod u+x tools/ffbisect
18
+    tools/ffbisect $*
19
+    exit 0
20
+fi
21
+
5 22
 case "$1" in
6 23
     need)
7 24
         case $2 in