[packages/rpm-build-tools/merge-pld-builder-client: 127/2675] - allow sending commands and build jobs in same batch

glen glen at pld-linux.org
Mon Dec 19 21:59:35 CET 2016


commit c50ae8b9598df0c08552a57adde4313694a71e72
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sun Feb 27 11:04:54 2011 +0000

    - allow sending commands and build jobs in same batch
    
    Changed files:
        client/make-request.sh -> 1.87

 make-request.sh | 49 +++++++++++++++++++++----------------------------
 1 file changed, 21 insertions(+), 28 deletions(-)
---
diff --git a/make-request.sh b/make-request.sh
index a607649..d80301a 100644
--- a/make-request.sh
+++ b/make-request.sh
@@ -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,&,\&,g;s,<,\<,g;s,>,\>,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>"
 }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/cca6584b96e6c33d0732d559e43e100d804e2ecd



More information about the pld-cvs-commit mailing list