aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoridl0r <idl0r@gentoo.org>2010-07-04 09:18:48 +0000
committeridl0r <idl0r@gentoo.org>2010-07-04 09:18:48 +0000
commit2d5c41e0aa4dfa8030eceb8ad5ec200328eea444 (patch)
treea24062cf2011ffcfa680b0f23eb6b82341c233cf
parentRevert last commit. (diff)
downloadgentoolkit-2d5c41e0aa4dfa8030eceb8ad5ec200328eea444.tar.gz
gentoolkit-2d5c41e0aa4dfa8030eceb8ad5ec200328eea444.tar.bz2
gentoolkit-2d5c41e0aa4dfa8030eceb8ad5ec200328eea444.zip
ekeyword: Don't touch an empty KEYWORDS variable in case it occurs more
than once, like in live ebuilds. Bug 321475. svn path=/trunk/gentoolkit-dev/; revision=795
-rw-r--r--ChangeLog4
-rwxr-xr-xsrc/ekeyword/ekeyword13
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6263afd..bcd5eb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
2010-07-03: Christian Ruppert <idl0r@gentoo.org>
+ * ekeyword: Don't touch an empty KEYWORDS variable in case it occurs more
+ than once, like in live ebuilds. Bug 321475.
+
+2010-07-03: Christian Ruppert <idl0r@gentoo.org>
* ekeyword: Fix stabilization with "all", bug 304133#c11.
2010-07-02: Christian Ruppert <idl0r@gentoo.org>
diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword
index 9528911..1ac0403 100755
--- a/src/ekeyword/ekeyword
+++ b/src/ekeyword/ekeyword
@@ -112,6 +112,12 @@ for my $f (@ARGV) {
open O, ">$f.new" or die "Can't create $f.new: $!\n";
select O;
+ my $count = 0;
+ while(<I>) {
+ $count++ if m/^\s*KEYWORDS=/;
+ }
+ seek(I, 0, 0);
+
while (<I>) {
if (/^\s*KEYWORDS=/) {
@@ -123,6 +129,13 @@ for my $f (@ARGV) {
}
(my $quoted = $_) =~ s/^.*?["'](.*?)["'].*/$1/s;
+ if($count > 1 && length($quoted) eq 0) {
+ # Skip empty KEYWORDS variables in case they occur more than
+ # once, bug 321475.
+ print $_;
+ next;
+ }
+
# replace -* with -STAR for our convenience below
$quoted =~ s/-\*/-STAR/;