ekeyword: Stabilize stable architectures only when using "all", bug 304133.
authoridl0r <idl0r@gentoo.org>
Fri, 2 Jul 2010 16:28:04 +0000 (16:28 -0000)
committeridl0r <idl0r@gentoo.org>
Fri, 2 Jul 2010 16:28:04 +0000 (16:28 -0000)
svn path=/trunk/gentoolkit-dev/; revision=791

ChangeLog
src/ekeyword/ekeyword

index b9b4d8d54884593753b510c6b1a6643ae9dd664b..cea0ce49fdb54dc089bd97ce947019ccef55191d 100644 (file)
--- 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 <idl0r@gentoo.org>
        * echangelog: Update copyright in other files too (except binaries and
index 044f151439e055fa811f2d43ed94d16909972ab5..293f0cf97b50fbdfc918ec00fda7452fb48e2c24 100755 (executable)
@@ -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/) {