more notes on configuration
[buildfarm-client.git] / run_cron.sh
1 #!/bin/sh
2
3 new=${0%.sh}
4
5 if test -t; then
6     cat <<___ >&2
7 `basename $0`: Please use $new (note the missing extension!) instead.
8 This ($0) script will be removed without any further notice.
9 ___
10     exit 1
11 fi
12
13 exec $new "$@"
14
15 if which dirname >/dev/null; then
16   BFDIR=`dirname $0`
17 elif [ "x${BFDIR}" = "x" ]; then
18   echo "Cannot find BuildFarm client directory. Exiting."
19   exit 1
20 fi
21
22 cd $BFDIR
23 # Update the build client if new version available
24 if which git >/dev/null; then
25   git pull >/dev/null
26 fi
27
28 # Sanitize or set up environment
29 # 1) Remove because spec.txt generation fails if set
30 if env | grep -q '/bin/bash'; then
31   export -n PERL_UNICODE
32 else
33   unset PERL_UNICODE
34 fi
35
36 ./run_branches.pl $@