aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoridl0r <idl0r@gentoo.org>2010-07-02 15:47:13 +0000
committeridl0r <idl0r@gentoo.org>2010-07-02 15:47:13 +0000
commit951b61710202d7943d77cc4603a4c6ab98643f74 (patch)
tree9505142c624316bffc2a9a12f78fa69d427232a8
parentValidate user input/arch, bug 326029. (diff)
downloadgentoolkit-951b61710202d7943d77cc4603a4c6ab98643f74.tar.gz
gentoolkit-951b61710202d7943d77cc4603a4c6ab98643f74.tar.bz2
gentoolkit-951b61710202d7943d77cc4603a4c6ab98643f74.zip
ekeyword: Add get_architectures_status function to get the architecture status,
0 = unkown, 1 = dev, 2 = exp, 3 = stable. svn path=/trunk/gentoolkit-dev/; revision=789
-rw-r--r--ChangeLog2
-rwxr-xr-xsrc/ekeyword/ekeyword12
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c7361d..ad179be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@
available architectures to the %ARCH hash which can be used for
validation.
Validate user input/arch, bug 326029.
+ Add get_architectures_status function to get the architecture status,
+ 0 = unkown, 1 = dev, 2 = exp, 3 = stable.
2010-05-17: Christian Ruppert <idl0r@gentoo.org>
* echangelog: Update copyright in other files too (except binaries and
diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword
index 3024f0a..a485809 100755
--- a/src/ekeyword/ekeyword
+++ b/src/ekeyword/ekeyword
@@ -60,6 +60,18 @@ sub get_architectures() {
}
}
+sub get_architectures_status() {
+ foreach my $line (file_parse("${PORTDIR}/profiles/profiles.desc")) {
+ my ($arch, undef, $status) = split(/\s/, $line, 3);
+
+ if(defined($ARCH{$arch})) {
+ $ARCH{$arch} = 1 if $status eq "dev";
+ $ARCH{$arch} = 2 if $status eq "exp";
+ $ARCH{$arch} = 3 if $status eq "stable";
+ }
+ }
+}
+
# make sure the cmdline consists of keywords and ebuilds
unless (@ARGV > 0) {
# NOTE: ~all will ignore all -arch keywords