models: move the config functions closer to each other
[git-cola.git] / scripts / common.sh
blob13e11e32beb6b2e965d35f549354776570c7fb70
1 #!/bin/sh
3 waf_backup()
5 if [ -e .lock-wscript ]; then
6 mv .lock-wscript .lock-wscript.old
7 fi
10 waf_restore()
12 if [ -e .lock-wscript.old ]; then
13 mv .lock-wscript.old .lock-wscript
17 try_python()
19 waf_backup
20 echo "+------------------------------------------------"
21 echo "+ PYTHON=$1"
22 echo "+------------------------------------------------"
23 if [ ! -x "$1" ]; then
24 echo "$1 is not executable."
25 exit -1
27 env PYTHON="$1" \
28 ./configure \
29 --prefix="$2" \
30 --blddir="$PWD/tmp.$$" &&
31 make &&
32 make install
33 status=$?
35 rm -rf "$PWD/tmp.$$"
37 if test -z $status; then
38 echo "exited with status code $status"
39 exit $status
43 waf_restore
46 cd $(dirname $0)
47 cd ..
49 VERSION=$(scripts/version.sh)