]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
cr-for-branches: when doing pre-pull from incoming, take out lock correctly
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 21 Nov 2013 12:26:43 +0000 (12:26 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 28 Nov 2013 11:39:42 +0000 (11:39 +0000)
I.e. with -f if caller specified -q, rather than always using -w.  -q
would make the script carry on if it didn't manage to get the lock and
do the pull, which would be wrong.  -w is wrong because it can block
for another long-running script.

cr-for-branches

index a78d34ca0ab60a2b36518761488e7ade274b9669..4c26a69c7c2745cd3be6ec80d660d59b2eb0fa68 100755 (executable)
@@ -34,7 +34,12 @@ export LOGFILE
 : ${BRANCHES:=osstest xen-4.0-testing xen-4.1-testing xen-4.2-testing xen-4.3-testing xen-unstable qemu-upstream-unstable qemu-upstream-4.2-testing qemu-upstream-4.3-testing linux-3.10 linux-3.4 linux-arm-xen ${EXTRA_BRANCHES}}
 export BRANCHES
 
-with-lock-ex -w data-tree-lock bash -ec '
+fetchwlem=$wlem
+if [ "x$fetchwlem" = x-q ]; then
+       fetchwlem=-f
+fi
+
+with-lock-ex $fetchwlem data-tree-lock bash -ec '
        exec >>$LOGFILE
        date
         printf "%s\n" "$FOR_LOGFILE"