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