From patchwork Thu Jul 6 14:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 9828461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF39A60361 for ; Thu, 6 Jul 2017 14:45:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0043285FB for ; Thu, 6 Jul 2017 14:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4A1028685; Thu, 6 Jul 2017 14:45:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EF4D285FB for ; Thu, 6 Jul 2017 14:45:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dT7zV-0008GM-0L; Thu, 06 Jul 2017 14:42:49 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dT7zT-0008Dd-Ow for xen-devel@lists.xenproject.org; Thu, 06 Jul 2017 14:42:47 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 1C/22-03044-76C4E595; Thu, 06 Jul 2017 14:42:47 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsXitHRDpG6aT1y kwZEvChbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8ay2TOYCnZzVnQv38bWwLiKvYuRg0NCwF9i 2VHDLkZODjYBHYmLc3eygYRFBFQkbu816GLk4mAWaGWU+D7lCyNIjbBAksTON4tZQGwWoJrWy /vYQWxeASuJN/d7mEBsCQE9ibcTX4DVcwLFT1+B6BUSsJTY97WZGaJeUOLkzCdgc5gFNCVat/ 9mh7DlJZq3zmaGqFeU6J/3gG0CI98sJC2zkLTMQtKygJF5FaNGcWpRWWqRrpGBXlJRZnpGSW5 iZo6uoYGZXm5qcXFiempOYlKxXnJ+7iZGYKgxAMEOxl/LAg4xSnIwKYnyVpjHRQrxJeWnVGYk FmfEF5XmpBYfYpTh4FCS4J3pDZQTLEpNT61Iy8wBBj1MWoKDR0mE97QzUJq3uCAxtzgzHSJ1i lGX49WE/9+YhFjy8vNSpcR5+UFmCIAUZZTmwY2AReAlRlkpYV5GoKOEeApSi3IzS1DlXzGKcz AqCfPmg0zhycwrgdv0CugIJqAjFBtjQI4oSURISTUwavilKmx+oDPzz6M5e8/d4Ns1yaQnOjd mzqkut23Jb681PflgF9m4cOXLDcsf9X3Kc96Vt2D9vGXrf12IW7Wy7bDUZye9pWYn1a8rWhnu fmTxfuP9XX06gus9fOKzY76Uq9vN7Lyff8Jn2eePVyY90PTm+OSS9/Npr5x8pFt53ML+tZzCh w4uWqnEUpyRaKjFXFScCAA/iegyuwIAAA== X-Env-Sender: prvs=3536ba782=roger.pau@citrix.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1499352154!82705154!7 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17573 invoked from network); 6 Jul 2017 14:42:46 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 6 Jul 2017 14:42:46 -0000 X-IronPort-AV: E=Sophos;i="5.40,317,1496102400"; d="scan'208";a="430555150" From: Roger Pau Monne To: Date: Thu, 6 Jul 2017 15:42:23 +0100 Message-ID: <20170706144227.36580-13-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170706144227.36580-1-roger.pau@citrix.com> References: <20170706144227.36580-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Ian.Jackson@eu.citrix.com, Roger Pau Monne Subject: [Xen-devel] [PATCH v4 12/16] osstest: allow catching-otherwise to pass arguments to the called script X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 }