Re: [Xen-devel] [PATCH v4 12/16] osstest: allow catching-otherwise to pass arguments to the called script

2017-07-06 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH v4 12/16] osstest: allow catching-otherwise to 
pass arguments to the called script"):
> Allow catching-otherwise to take a variable number of tail arguments,
> that will be propagated to the called proc.

Err, this is not necessary, I think.  The caller can do it.

Let me see how you use it...

... indeed.  I will reply to those patches.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH v4 12/16] osstest: allow catching-otherwise to pass arguments to the called script

2017-07-06 Thread Roger Pau Monne
Allow catching-otherwise to take a variable number of tail arguments,
that will be propagated to the called proc.

Signed-off-by: Roger Pau Monné 
---
Changes since v3:
 - New in this version.
---
 sg-run-job | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sg-run-job b/sg-run-job
index b1f94f4d..87d81085 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -123,8 +123,8 @@ proc run-job {job} {
 }
 }
 
-proc catching-otherwise {failst script} {
-# Executes $script.
+proc catching-otherwise {failst script args} {
+# Executes $script $args.
 # If job is already a failure (ie not $ok), skips it (ie does nothing).
 # If any Tcl exception is thrown, declares the job a failure.
 # (ie sets job status to $failst, and sets ok to 0)
@@ -134,9 +134,9 @@ proc catching-otherwise {failst script} {
 if {!$ok} return
 
 if {[catch {
-uplevel 1 $script
+uplevel 1 $script $args
 } emsg]} {
-jobdb::logputs stderr "$flight.$jobinfo(job) $script failed: $emsg"
+jobdb::logputs stderr "$flight.$jobinfo(job) $script $args failed: 
$emsg"
 set ok 0
setstatus $failst
 }
-- 
2.11.0 (Apple Git-81)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel