git://git.onelab.eu
/
infrastructure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
align
[infrastructure.git]
/
scripts
/
vbuild-nightly.sh
diff --git
a/scripts/vbuild-nightly.sh
b/scripts/vbuild-nightly.sh
index
6647330
..
10c72a5
100755
(executable)
--- a/
scripts/vbuild-nightly.sh
+++ b/
scripts/vbuild-nightly.sh
@@
-1,10
+1,26
@@
#!/bin/bash
#!/bin/bash
-REVISION=$(echo '$Revision: 1053 $' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' )
COMMAND=$(basename $0)
COMMAND=$(basename $0)
-
SVNPATH="http://svn.one-lab.org/build/trunk
"
+
BUILD_SCM_URL="git://git.onelab.eu/build
"
-cd /tmp
-svn cat $SVNPATH/$COMMAND > $COMMAND
-chmod +x $COMMAND
-exec $COMMAND "$@"
+# scan args for any -s option, and set BUILD_SCM_URL in this case
+function scan_build_scm_url () {
+ while [[ -n "$@" ]] ; do
+ if [ "$1" == "-s" ] ; then
+ BUILD_SCM_URL="$2"
+ fi
+ shift
+ done
+ GIT_REPO=$(echo $BUILD_SCM_URL | cut -d@ -f1)
+ GIT_TAG=$(echo $BUILD_SCM_URL | cut -s -d@ -f2)
+ GIT_TAG=${GIT_TAG:-master}
+}
+
+scan_build_scm_url "$@"
+
+tmp=/tmp/$COMMAND-$$
+git archive --remote=$GIT_REPO $GIT_TAG $COMMAND | tar -C /tmp -xf -
+mv /tmp/$COMMAND $tmp
+chmod +x $tmp
+$tmp "$@"
+rm $tmp