From b7e71b73b3ab414be52f7d16eeb24eeba29ef684 Mon Sep 17 00:00:00 2001 From: idl0r Date: Fri, 2 Jul 2010 16:28:04 +0000 Subject: ekeyword: Stabilize stable architectures only when using "all", bug 304133. svn path=/trunk/gentoolkit-dev/; revision=791 --- ChangeLog | 1 + src/ekeyword/ekeyword | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b9b4d8d..cea0ce4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ Add get_architectures_status function to get the architecture status, 0 = unkown, 1 = dev, 2 = exp, 3 = stable. Don't override stable status in get_architectures_status. + Stabilize stable architectures only when using "all", bug 304133. 2010-05-17: Christian Ruppert * echangelog: Update copyright in other files too (except binaries and diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword index 044f151..293f0cf 100755 --- a/src/ekeyword/ekeyword +++ b/src/ekeyword/ekeyword @@ -88,6 +88,7 @@ for my $a (@ARGV) { $PORTDIR = get_portdir(); get_architectures(); +get_architectures_status(); my $files = 0; for my $f (@ARGV) { @@ -146,7 +147,20 @@ for my $f (@ARGV) { } else { if ($arch eq 'all') { # modify all non-masked keywords in the list - $quoted =~ s/(^|\s)~?(?=\w)/$1$leader/g; + + # Don't add stable keywords for != stable architectures + if(length($leader) eq 0) { + foreach my $tmp (split(/\s/, $quoted)) { + my (undef, $_arch, undef) = ($tmp =~ m/$kw_re/o); + + if($ARCH{$_arch} and $ARCH{$_arch} eq 3) { + $quoted =~ s/\Q~${_arch}\E/${_arch}/; + } + } + } + else { + $quoted =~ s/(^|\s)~?(?=\w)/$1$leader/g; + } } else { # modify or add keyword unless ($quoted =~ s/[-~]?\Q$arch\E(\s|$)/$leader$arch$1/) { -- cgit v1.2.3