From patchwork Wed Jun 7 17:49:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9772109 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 110CF6034B for ; Wed, 7 Jun 2017 17:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20046284C5 for ; Wed, 7 Jun 2017 17:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14ED5284D4; Wed, 7 Jun 2017 17:52:25 +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 BE515284C5 for ; Wed, 7 Jun 2017 17:52:24 +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 1dIf5r-0002rB-OX; Wed, 07 Jun 2017 17:50:07 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIf5r-0002pr-6k for xen-devel@lists.xenproject.org; Wed, 07 Jun 2017 17:50:07 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 26/21-02022-ECC38395; Wed, 07 Jun 2017 17:50:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeJIrShJLcpLzFFi42JxWrohUve0jUW kQf9WZovvWyYzOTB6HP5whSWAMYo1My8pvyKBNaOp5wV7wQz+iu7HHg2Mv7i7GDk5JAT8JXY3 fGYDsdkEdCWatvwFsjk4RARUJG7vNehi5OJgFmhllDj54gdYjbBAtMT0XXeZQWwWoJpf5x4zg di8Al4Shw+dZIGYKSdx/vhPsBpOoPj2V+fBeoUEPCX2fP4HNl9IQE1i7vp4iFZBiZMzn4C1Mg tISBx88YJ5AiPvLCSpWUhSCxiZVjFqFKcWlaUW6Rqa6yUVZaZnlOQmZuboGhqY6uWmFhcnpqf mJCYV6yXn525iBAYOAxDsYLx42vMQoyQHk5Io7wNpi0ghvqT8lMqMxOKM+KLSnNTiQ4wyHBxK EryN1kA5waLU9NSKtMwcYAjDpCU4eJREeHvNgdK8xQWJucWZ6RCpU4yKUuK820D6BEASGaV5c G2wuLnEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd5gkCk8mXklcNNfAS1mAlrMd8kEZHFJIk JKqoHxu2Xx18A3lgtOvbn68cs1Zp2HVa3O2w4+KbTsT5E9tP7bvQP/pO6lvs3//2Bms/X34AK vObdrLZ+2/1kl88Bk2qZ5sks0dD2P6B7466R4tdb2vsa/arP3n2593CUW/sR8TsA8iwSuFycy f/a7NybsK1j7Pbxt6bTvFw4vUpSTK491nzGzYeWcbCWW4oxEQy3mouJEAMCz65mWAgAA X-Env-Sender: prvs=3243fba83=Ian.Jackson@citrix.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1496857801!73882682!1 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.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19837 invoked from network); 7 Jun 2017 17:50:02 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 7 Jun 2017 17:50:02 -0000 X-IronPort-AV: E=Sophos;i="5.39,311,1493683200"; d="scan'208";a="426953400" From: Ian Jackson To: Date: Wed, 7 Jun 2017 18:49:01 +0100 Message-ID: <1496857742-20191-11-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1496857742-20191-1-git-send-email-ian.jackson@eu.citrix.com> References: <1496857742-20191-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 10/11] cs-adjust-flight: Rework runvar-build-set new value handling 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 Previously, if it didn't contain a `.', it would be taken as a flight name and completed with the old job name. (This was not documented.) This meant that there was no way to adjust to refer to a differnet job in the flight being manipulated without specifying the flight number (which is not desirable, nor even possible with new:) Instead, we adopt the convention that a trailing . completes the value with the old job name. Values without a . are taken literally as a job name, resulting in intra-flight references to that job. Signed-off-by: Ian Jackson --- v4: New patch, which helps with issues I tripped over while trying to ad-hoc test the livepatch series. --- cs-adjust-flight | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cs-adjust-flight b/cs-adjust-flight index 9812d12..03257a6 100755 --- a/cs-adjust-flight +++ b/cs-adjust-flight @@ -32,6 +32,8 @@ # and, is matched against a value # containing the being-manipulated flight name # even if the actual runvar value omits it +# and, if ends in ., it is +# completed with the 's job name # # : # @@ -361,12 +363,11 @@ sub change__runvar_build_set { return unless $name =~ m/buildjob$/; my $oldval = $varrow->{val}; - $oldval = flight_otherjob($dstflight,$oldval); - return unless $oldvalok_fn->($oldval); + my ($oldflt,$oldjob) = flight_otherjob($dstflight,$oldval); + return unless $oldvalok_fn->("$oldflt.$oldjob"); $matches++; - $oldval =~ s/^\d+\.//; # strip out previous flight - my $newval = $specval =~ m/\./ ? $specval : "$specval.$oldval"; + my $newval = $specval =~ m/\.$/ ? "$specval$oldjob": $specval; runvar_set($job, $name, $newval, " (modified from \`$oldval')") if $newval ne $oldval; }, 'IGNORE');