forked from datalad/datalad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbisect-git-annex
executable file
·29 lines (25 loc) · 932 Bytes
/
bisect-git-annex
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
#!/bin/bash
#
# A helper script that first builds git-annex using a Singularity image before
# running the bisection command. It should be called from the git-annex source
# tree as
#
# $ git bisect run /path/to/bisect-git-annex IMAGE CMD...
#
# where IMAGE is the singularity image or, if an image doesn't exist, the path
# to which the Singularity image should be downloaded. CMD will be executed if
# the build completes successfully.
set -eu
annex_gitver=$(git describe)
logfile=$(mktemp -p '' git-annex-build-${annex_gitver}-XXXXXX.log)
[ -e Annex.hs ] # just to make sure that it is invoked in the correct location
echo "I: cleaning $PWD"
git clean -dfx >/dev/null 2>&1
echo "I: building $annex_gitver"
if ! make linuxstandalone 1>"$logfile" 2>&1; then
echo "E: failed to build, can't test this one. See $logfile"
exit 125
fi
export PATH=$PWD/tmp/git-annex.linux/:$PATH
echo "I: running the script"
eval "$@"