From: Thierry Parmentelat Date: Sat, 22 Mar 2008 12:25:09 +0000 (+0000) Subject: fix for use with make targets like "vbuild-nightly.sh vserver" X-Git-Tag: 4.2-rc2~117 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b3bb0258c6c4b9676df5931a060a90bd11f7a554;p=build.git fix for use with make targets like "vbuild-nightly.sh vserver" --- diff --git a/vbuild-nightly.sh b/vbuild-nightly.sh index 044785d3..aba2e0bc 100755 --- a/vbuild-nightly.sh +++ b/vbuild-nightly.sh @@ -264,10 +264,6 @@ function main () { set -e - # preserve arguments for passing them again later - declare -a argv - for arg in "$@"; do argv=(${argv[@]} "$arg") ; done - # parse arguments MAKEVARS=() DRY_RUN= @@ -297,7 +293,11 @@ function main () { esac done - shift $(($OPTIND - 1)) + # preserve options for passing them again later, together with expanded base + declare -a options + toshift=$(($OPTIND - 1)) + arg=1; while [ $arg -le $toshift ] ; do options=(${options[@]} "$1") ; shift; arg=$(($arg+1)) ; done + MAKETARGETS="$@" # set defaults @@ -401,7 +401,7 @@ function main () { # invoke this command in the vserver for building (-T) vserver ${BASE} exec chmod +x /build/$COMMAND - vserver ${BASE} exec /build/$COMMAND "${argv[@]}" -b "${BASE}" + vserver ${BASE} exec /build/$COMMAND "${options[@]}" -b "${BASE}" $MAKETARGETS fi # publish to the web so runtest can find them