summaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authoragriffis <agriffis@gentoo.org>2004-09-16 01:11:27 +0000
committeragriffis <agriffis@gentoo.org>2004-09-16 01:11:27 +0000
commit411e82dd0880bd907e2af16b8806f7f6b45c9e80 (patch)
treed2ed25600c98eb49331201dddce77b9450bed99b /trunk
parent6dd075e06e55956bd7ef779af385a5d023c69919 (diff)
downloadgentoolkit-411e82dd0880bd907e2af16b8806f7f6b45c9e80.tar.gz
update ekeyword for GLEP 22 keywords
svn path=/; revision=134
Diffstat (limited to 'trunk')
-rw-r--r--trunk/src/ekeyword/ChangeLog4
-rw-r--r--trunk/src/ekeyword/ekeyword19
2 files changed, 14 insertions, 9 deletions
diff --git a/trunk/src/ekeyword/ChangeLog b/trunk/src/ekeyword/ChangeLog
index 2748897..6af10dd 100644
--- a/trunk/src/ekeyword/ChangeLog
+++ b/trunk/src/ekeyword/ChangeLog
@@ -1,3 +1,7 @@
+15 Sep 2004 Aron Griffis <agriffis@gentoo.org>
+ * Update for GLEP 22 keywords
+ * Change copyright line for Gentoo Foundation
+
12 Apr 2004 Aron Griffis <agriffis@gentoo.org>
* Add ability to remove keywords with ^, for example:
ekeyword ^alpha blah.ebuild
diff --git a/trunk/src/ekeyword/ekeyword b/trunk/src/ekeyword/ekeyword
index 67f2ea7..dc95294 100644
--- a/trunk/src/ekeyword/ekeyword
+++ b/trunk/src/ekeyword/ekeyword
@@ -1,7 +1,8 @@
#!/usr/bin/perl -w
#
-# Copyright 2003, Gentoo Technologies, Inc.
-# Author: Aron Griffis <agriffis@gentoo.org>
+# Copyright 2003-2004, Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Written by Aron Griffis <agriffis@gentoo.org>
#
# ekeyword: Update the KEYWORDS in an ebuild. For example:
#
@@ -12,7 +13,7 @@
# > KEYWORDS="x86 ppc sparc ~alpha"
-my ($kw_re) = '^(?:([-~^]?)(\w+)|([-^]\*))$';
+my ($kw_re) = '^(?:([-~^]?)(\w[\w-]*)|([-^]\*))$';
my (@kw);
# make sure the cmdline consists of keywords and ebuilds
@@ -43,8 +44,8 @@ for my $f (@ARGV) {
# extract the quoted section from KEYWORDS
(my $quoted = $_) =~ s/^.*["'](.*?)["'].*/$1/s;
- # replace -* with -star for our convenience below
- $quoted =~ s/-\*/-star/;
+ # replace -* with -STAR for our convenience below
+ $quoted =~ s/-\*/-STAR/;
for my $k (@kw) {
my ($leader, $arch, $star) = ($k =~ /$kw_re/o);
@@ -52,7 +53,7 @@ for my $f (@ARGV) {
# handle -* and ^*
if (defined $star) {
$leader = substr $star,0,1;
- $arch = 'star';
+ $arch = 'STAR';
}
# remove keywords
@@ -73,7 +74,7 @@ for my $f (@ARGV) {
# modify or add keyword
unless ($quoted =~ s/[-~]?\Q$arch\E\b/$leader$arch/) {
# modification failed, need to add
- if ($arch eq 'star') {
+ if ($arch eq 'STAR') {
$quoted = "$leader$arch $quoted";
} else {
$quoted .= " $leader$arch";
@@ -83,8 +84,8 @@ for my $f (@ARGV) {
}
}
- # replace -star with -*
- $quoted =~ s/-star\b/-*/;
+ # replace -STAR with -*
+ $quoted =~ s/-STAR\b/-*/;
# fixup spacing
$quoted =~ s/^\s*(.*?)\s*$/$1/; # leading/trailing