From a4dcfa25920891ac7556aa2781b22c6be32d571c Mon Sep 17 00:00:00 2001 From: idl0r Date: Sat, 3 Jul 2010 09:45:21 +0000 Subject: [PATCH] ekeyword: Simplify r791 / bug 304133#c11. svn path=/trunk/gentoolkit-dev/; revision=793 --- src/ekeyword/ekeyword | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword index 9528911..6e75e22 100755 --- a/src/ekeyword/ekeyword +++ b/src/ekeyword/ekeyword @@ -150,22 +150,15 @@ for my $f (@ARGV) { # Don't add stable keywords for != stable architectures if(length($leader) eq 0) { - my @new; foreach my $tmp (split(/\s/, $quoted)) { - my ($_leader, $_arch, undef) = ($tmp =~ m/$kw_re/o); - $_leader = "" if !defined($_leader); - $_arch = "" if !defined($_arch); + my (undef, $_arch, undef) = ($tmp =~ m/$kw_re/o); - if($_leader eq "~" && ($ARCH{$_arch} && $ARCH{$_arch} eq 3) ) { - push(@new, $_arch); - next; - } - else { - push(@new, "${_leader}${_arch}"); - next; + if($ARCH{$_arch} and $ARCH{$_arch} eq 3) { + # [^-] to ignore ~arch-foo in case just arch shall + # be stabilized, bug 304133#c11 + $quoted =~ s/\Q~${_arch}\E[^-]/${_arch}/; } } - $quoted = join(" ", @new); } else { $quoted =~ s/(^|\s)~?(?=\w)/$1$leader/g; -- 2.26.2