svn path=/trunk/gentoolkit-dev/; revision=788
get_architectures reads $PORTDIR/profiles/arch.list and adds all
available architectures to the %ARCH hash which can be used for
validation.
+ Validate user input/arch, bug 326029.
2010-05-17: Christian Ruppert <idl0r@gentoo.org>
* echangelog: Update copyright in other files too (except binaries and
my ($kw_re) = '^(?:([-~^]?)(\w[\w-]*)|([-^]\*))$';
my (@kw);
+my $PORTDIR = undef;
+my %ARCH = ();
+
sub file_parse {
my $fname = shift;
my @content = ();
die "I don't understand $a\n";
}
+$PORTDIR = get_portdir();
+get_architectures();
+
my $files = 0;
for my $f (@ARGV) {
- if ($f =~ /$kw_re/o) {
+ if ($f =~ m/$kw_re/o) {
+ my $arch = $2;
+
+ if(length($arch) > 0 && $arch ne "all") {
+ if(!defined($ARCH{$arch})) {
+ printf STDERR ("'%s' is an unknown architecture! skipping...\n", $arch);
+ next;
+ }
+ }
+
push @kw, $f;
next;
}