diff mbox series

[OSSTEST,21/82] sg-run-job: support +! for *only* adding things to TESTID

Message ID 20201007180024.7932-22-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Reuse test hosts | expand

Commit Message

Ian Jackson Oct. 7, 2020, 5:59 p.m. UTC
From: Ian Jackson <ian.jackson@eu.citrix.com>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-run-job | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sg-run-job b/sg-run-job
index 702ed558..3ca725e7 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -277,6 +277,10 @@  proc recipe-flag {flagname {def 0}} {
 #       subsequent items in SCRIPT-ARGS are added to the expansion of
 #       /@ in TESTID.  (The "+" itself is not added to the arguments
 #       or the testid.)
+#
+#       An argument which is precisely "+!" specifies that the
+#       subsequent items in SCRIPT-ARGS are to be _only_ added to
+#       the expansion of /@ in TESTID, until the next "+".
 
 proc run-ts {iffail args} {
     set wantstatus pass
@@ -343,7 +347,11 @@  proc spawn-ts {iffail testid args} {
             set adding [expr {!$adding}]
             continue
         }
-        lappend real_args $arg
+	if {![string compare +! $arg]} {
+	    set adding -1
+	    continue
+	}
+        if {$adding>=0} { lappend real_args $arg }
         if {$adding} { lappend testid_args $arg }
     }