-
Notifications
You must be signed in to change notification settings - Fork 0
/
bisect.sh
executable file
·48 lines (40 loc) · 826 Bytes
/
bisect.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
SELF=$(readlink -f "$(dirname $0)")
export PATH=$PATH:$SELF
source bootstrap.sh
function run_bisect()
{
local self="$SELF"
local sources="$1"
local script="$(readlink -f "$self/$2")"
shift 2
cd "$sources"
git bisect start $@
git bisect run bisect-tester.sh $self $sources $script
git bisect log
}
function print_help()
{
echo "$0 [ OPTS ] /path/to/linux-sources /tester-script args-for-bisect" >&2
echo " -p - prepare"
echo
echo " -h - print this message"
exit 1
}
function parse_options()
{
local OPTIND OPTARG o
while getopts "hpr:" o; do
case $o in
h) print_help ;;
p) prepare ;;
esac
done
shift $((OPTIND-1))
run_bisect $@
}
function main()
{
parse_options $@
}
main $@