From patchwork Thu May 2 17:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 10927429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4492315A6 for ; Thu, 2 May 2019 17:55:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33C5B1FF13 for ; Thu, 2 May 2019 17:55:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 285EB1FF87; Thu, 2 May 2019 17:55:14 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D7A601FF83 for ; Thu, 2 May 2019 17:55:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMFtS-0006hX-D4; Thu, 02 May 2019 17:53:14 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMFtQ-0006gq-Sd for xen-devel@lists.xenproject.org; Thu, 02 May 2019 17:53:12 +0000 X-Inumbo-ID: 2729a1ba-6d03-11e9-843c-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 2729a1ba-6d03-11e9-843c-bc764e045a96; Thu, 02 May 2019 17:53:12 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,422,1549929600"; d="scan'208";a="84983437" From: Ian Jackson To: Date: Thu, 2 May 2019 18:42:34 +0100 Message-ID: <20190502174238.23848-6-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190502174238.23848-1-ian.jackson@eu.citrix.com> References: <20190502174238.23848-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 5/9] mg-repro-setup: Break out compute_adjusts X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP No functional change. Signed-off-by: Ian Jackson --- mg-repro-setup | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mg-repro-setup b/mg-repro-setup index c8bcad33..10ab65a8 100755 --- a/mg-repro-setup +++ b/mg-repro-setup @@ -54,7 +54,6 @@ set -e -o posix mgexecflags=() adjustsets=() -adjusts=() allocs=() logfile=tmp/mg-repro-setup.log duration=28d @@ -104,14 +103,17 @@ adjrunvar () { delrunvar "$1" adjusts+=(runvar-set "$job" "$1" "$2") } - -for arg in "${adjustsets[@]}"; do - case "$arg" in - !*|^*) delrunvar "${arg#?}" ;; - *=*) adjrunvar "${arg%%=*}" "${arg#*=}" ;; - *) bad-adjuistset-pattern ;; - esac -done +compute_adjusts () { + adjusts=() + for arg in "$@"; do + case "$arg" in + !*|^*) delrunvar "${arg#?}" ;; + *=*) adjrunvar "${arg%%=*}" "${arg#*=}" ;; + *) bad-adjuistset-pattern ;; + esac + done +} +compute_adjusts "${adjustsets[@]}" while [ $# -ne 0 ]; do arg=$1; shift