pld-builder.new: client/make-request.sh - allow sending post command after ...

glen glen at pld-linux.org
Tue Mar 15 21:51:59 CET 2011


Author: glen                         Date: Tue Mar 15 20:51:59 2011 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- allow sending post command after build

---- Files affected:
pld-builder.new/client:
   make-request.sh (1.91 -> 1.92) 

---- Diffs:

================================================================
Index: pld-builder.new/client/make-request.sh
diff -u pld-builder.new/client/make-request.sh:1.91 pld-builder.new/client/make-request.sh:1.92
--- pld-builder.new/client/make-request.sh:1.91	Mon Mar 14 08:39:13 2011
+++ pld-builder.new/client/make-request.sh	Tue Mar 15 21:51:54 2011
@@ -147,7 +147,7 @@
 
 Mandatory arguments to long options are mandatory for short options too.
 
-      -C, --config-file /path/to/config/file
+      --config-file /path/to/config/file
             Source additional config file (after $USER_CFG), useful when
             when sending build requests to Ac/Th from the same account
       -b 'BUILDER BUILDER ...',  --builder='BUILDER BUILDER ...'
@@ -186,7 +186,9 @@
       -cf, --command-flag
             Not yet documented
       -c, --command
-            Executes a given command on builders
+            Executes a given command on builders (prepended to build jobs if build jobs included)
+      -C, --post-command
+            Executes a given command on builders (appended to build jobs if build jobs included)
       --test-remove-pkg
             shortcut for --command poldek -evt ARGS
       --remove-pkg
@@ -217,8 +219,8 @@
 			shift
 			;;
 
-		--config-file | -C)
-			[ -f $2 ] && . $2 || die "Config file not found"
+		--config-file)
+			[ -f "$2" ] && . $2 || die "Config file not found"
 			shift
 			;;
 
@@ -314,7 +316,16 @@
 				command=$(cat)
 				echo >&2 "---"
 			fi
-			f_upgrade=no
+			shift
+			;;
+		--post-command | -C)
+			post_command="$2"
+			if [ "$post_command" = - ]; then
+				echo >&2 "Reading post_command from STDIN"
+				echo >&2 "---"
+				post_command=$(cat)
+				echo >&2 "---"
+			fi
 			shift
 			;;
 		--test-remove-pkg)
@@ -633,6 +644,19 @@
 			# let next job depend on previous
 			depend=$bid
 		done
+
+	if [ "$post_command" ]; then
+		bid=$(uuidgen)
+		echo -E >&2 "* Post-Command: $post_command"
+		echo "	<batch id='$bid' depends-on='$depend'>"
+		echo "		 <command flags='$command_flags'>"
+		echo -E "$post_command" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,g'
+		echo "</command>"
+		echo "		 <info></info>"
+		echo "$builders_xml"
+		echo "	</batch>"
+		depend=$bid
+	fi
 
 	echo "</group>"
 }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/client/make-request.sh?r1=1.91&r2=1.92&f=u



More information about the pld-cvs-commit mailing list