From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 2/3] ts-xen-install: nohcp: Invert sense of interfaces loop Date: Thu, 17 Apr 2014 16:13:23 +0100 Message-ID: <1397747604-9321-2-git-send-email-ian.jackson@eu.citrix.com> References: <1397660720.24638.208.camel@kazak.uk.xensource.com> <1397747604-9321-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wao0S-0006Ay-RU for xen-devel@lists.xenproject.org; Thu, 17 Apr 2014 15:13:41 +0000 In-Reply-To: <1397747604-9321-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We are going to want to process other kinds of lines too. So change this loop around by inverting the condition and not using "next". No functional change. Signed-off-by: Ian Jackson --- ts-xen-install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ts-xen-install b/ts-xen-install index 70e90ed..c59fdd3 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -218,11 +218,13 @@ sub nodhcp () { # preread /etc/network/interfaces to figure out the interface my %candidates; while () { - next unless + if ( m{^ \s* ( auto \s+ (\S+) ) \s* $}x || m{^ \s* ( allow-hotplug \s+ (\S+) ) \s* $}x || - m{^ \s* ( iface \s+ (\S+) \s+ inet \s+ ) }x ; - push @{ $candidates{$2} }, $1; + m{^ \s* ( iface \s+ (\S+) \s+ inet \s+ ) }x + ) { + push @{ $candidates{$2} }, $1; + } } EI->error and die $!; delete $candidates{'lo'}; -- 1.7.10.4