more robust for parallel runs
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 23 Apr 2015 09:13:12 +0000 (11:13 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 23 Apr 2015 09:13:12 +0000 (11:13 +0200)
scripts/vbuild-nightly.sh

index 10c72a5..92f5639 100755 (executable)
@@ -18,9 +18,10 @@ function scan_build_scm_url () {
 
 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
+tmpd=/tmp/git-$$
+tmpc=$tpmd/$COMMAND
+mkdir $tmpd
+git archive --remote=$GIT_REPO $GIT_TAG $COMMAND | tar -C $tmpd -xf -
+chmod +x $tmc
+$tmpc "$@"
+rm -rf $tmpd