summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2012-04-23 04:54:09 +0200
committerChristian Ruppert <idl0r@gentoo.org>2012-04-23 04:54:09 +0200
commit2eaf95dd07d7066d561b7d3c1736a151c75b5d0e (patch)
tree37a6a9af6de5e487af490ce299b19914969b627a /src
parentMore cleanup (diff)
downloadgentoolkit-2eaf95dd07d7066d561b7d3c1736a151c75b5d0e.tar.gz
gentoolkit-2eaf95dd07d7066d561b7d3c1736a151c75b5d0e.tar.bz2
gentoolkit-2eaf95dd07d7066d561b7d3c1736a151c75b5d0e.zip
Do a basic pre sort to get a rid of duplicates
NOTE: e.g. ~amd64 and -amd64 wouldn't be detected as duplicate! X-Gentoo-Bug: 399575 X-Gentoo-Bug-URL: https://bugs.gentoo.org/399575
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ekeyword/ekeyword6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword
index d680e26..2b1ac94 100755
--- a/src/ekeyword/ekeyword
+++ b/src/ekeyword/ekeyword
@@ -141,6 +141,12 @@ for my $f (@ARGV) {
# replace -* with -STAR for our convenience below
$quoted =~ s/-\*/-STAR/;
+ # Pre sort/unique
+ # NOTE: It will not detect duplicates where one is e.g. ~amd64 and
+ # one amd64
+ my %hash = map { $_, 1 } split(/\s+/, $quoted);
+ $quoted = join(" ", keys(%hash));
+
for my $k (@kw) {
my ($leader, $arch, $star) = ($k =~ /$kw_re/o);