From 2d5c41e0aa4dfa8030eceb8ad5ec200328eea444 Mon Sep 17 00:00:00 2001 From: idl0r Date: Sun, 4 Jul 2010 09:18:48 +0000 Subject: [PATCH] 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 --- ChangeLog | 4 ++++ src/ekeyword/ekeyword | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6263afd..bcd5eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-07-03: Christian Ruppert + * 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 * ekeyword: Fix stabilization with "all", bug 304133#c11. 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() { + $count++ if m/^\s*KEYWORDS=/; + } + seek(I, 0, 0); + while () { 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/; -- 2.26.2