wrapper to scan args & set SVNPATH as apprpriate
[infrastructure.git] / scripts / vbuild-nightly.sh
1 #!/bin/bash
2 REVISION=$(echo '$Revision: 1053 $' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' )
3 COMMAND=$(basename $0)
4 SVNPATH="http://svn.planet-lab.org/svn/build/trunk"
5
6 # scan args for any -s option, and SVNPATH in this case
7 function scan_svnpath () {
8     while [[ -n "$@" ]] ; do
9         if [ "$1" == "-s" ] ; then
10             SVNPATH="$2"
11         fi
12         shift
13     done
14 }
15
16 scan_svnpath "$@"
17
18 tmp=/tmp/$COMMAND-$$
19 svn cat $SVNPATH/$COMMAND  > $tmp
20 chmod +x $tmp
21 $tmp "$@"
22 rm $tmp