Debian Codegraph @

tools/bisect-git-annex

raw
1 #!/bin/bash
2 #
3 # A helper script that first builds git-annex using a Singularity image before
4 # running the bisection command. It should be called from the git-annex source
5 # tree as
6 #
7 # $ git bisect run /path/to/bisect-git-annex IMAGE CMD...
8 #
9 # where IMAGE is the singularity image or, if an image doesn't exist, the path
10 # to which the Singularity image should be downloaded. CMD will be executed if
11 # the build completes successfully.
12
13 set -eu
14 annex_gitver=$(git describe)
15 logfile=$(mktemp -p '' git-annex-build-${annex_gitver}-XXXXXX.log)
16
17 [ -e Annex.hs ] # just to make sure that it is invoked in the correct location
18 echo "I: cleaning $PWD"
19 git clean -dfx >/dev/null 2>&1
20
21 echo "I: building $annex_gitver"
22 if ! make linuxstandalone 1>"$logfile" 2>&1; then
23 echo "E: failed to build, can't test this one. See $logfile"
24 exit 125
25 fi
26 export PATH=$PWD/tmp/git-annex.linux/:$PATH
27
28 echo "I: running the script"
29 eval "$@"