]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- allow sending commands and build jobs in same batch
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 27 Feb 2011 11:04:54 +0000 (11:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    client/make-request.sh -> 1.87

client/make-request.sh

index a60764914bc3d5b507a60f45e5c1cf480a3d02d7..d80301ab8cb97c9cf0e5c146d7b7e70663855736 100644 (file)
@@ -531,14 +531,8 @@ for s in $specs; do
        ok=1
 done
 
-if [ "$ok" = "" ] ; then
-       if [ -z "$command" ]; then
-               die "no specs passed"
-       fi
-else
-       if [ "$command" != "" ] ; then
-               die "cannot pass specs and --command"
-       fi
+if [ -z "$specs" -a -z "$command" ]; then
+       die "no packages to build or command to invoke specified"
 fi
 
 id=$(uuidgen)
@@ -561,7 +555,17 @@ gen_req() {
        echo >&2 "* Queue-ID: $id"
        echo
 
-       if [ "$command" != "" ] ; then
+       # job to depend on
+       local depend=
+       local b i=1
+       local name branch builders_xml
+
+       for b in $builders; do
+               echo >&2 "* Builder: $b"
+               builders_xml="$builders_xml <builder>$b</builder>"
+       done
+
+       if [ "$command" ]; then
                bid=$(uuidgen)
                echo -E >&2 "* Command: $command"
                echo "  <batch id='$bid' depends-on=''>"
@@ -569,32 +573,24 @@ gen_req() {
                echo -E "$command" | sed -e 's,&,\&amp;,g;s,<,\&lt;,g;s,>,\&gt;,g'
                echo "</command>"
                echo "           <info></info>"
-               local b
-               for b in $builders; do
-                       echo >&2 "* Builder: $b"
-                       echo "           <builder>$b</builder>"
-               done
+               echo "$builders_xml"
                echo "  </batch>"
-       else
+               depend=$bid
+       fi
 
                if [ "$f_upgrade" = "yes" ] ; then
                        echo >&2 "* Upgrade mode: $f_upgrade"
                fi
 
-               # job to depend on
-               local depend=
-               local b i=1
-               local name branch
-               for b in $builders; do
-                       echo >&2 "* Builder: $b"
-               done
-
                for s in $specs; do
                        # skip marker
-                       if [ "$s" = "^" ] || [ "$no_depend" = yes ]; then
+                       if [ "$s" = "^" ]; then
                                depend=
                                continue
                        fi
+                       if [ "$no_depend" = yes ]; then
+                               depend=
+                       fi
                        bid=$(uuidgen)
                        echo "  <batch id='$bid' depends-on='$depend'>"
 
@@ -614,16 +610,13 @@ gen_req() {
                                echo "           <without>$b</without>"
                        done
                        echo
-                       for b in $builders; do
-                               echo "           <builder>$b</builder>"
-                       done
+                       echo "$builders_xml"
                        echo "  </batch>"
                        i=$((i+1))
 
                        # let next job depend on previous
                        depend=$bid
                done
-       fi
 
        echo "</group>"
 }
This page took 0.149455 seconds and 4 git commands to generate.