summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-10-29 12:14:41 +0100
committerMichael Schroeder <mls@suse.de>2012-10-29 12:14:41 +0100
commitf83e273bca0b64b145d1633a300376a7c6b10f0a (patch)
tree62c64ef7b7aab6dd15bf9f803a3adf78fc2b13e9
parentcca643cb1db7d887d1025da01ec42e971c5609fb (diff)
downloadbuild-f83e273bca0b64b145d1633a300376a7c6b10f0a.tar.gz
build-f83e273bca0b64b145d1633a300376a7c6b10f0a.tar.bz2
build-f83e273bca0b64b145d1633a300376a7c6b10f0a.zip
Support 'Constraint:' directive
-rw-r--r--Build.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/Build.pm b/Build.pm
index e4ed7e4..1f8254d 100644
--- a/Build.pm
+++ b/Build.pm
@@ -202,6 +202,7 @@ sub read_config {
$config->{'repotype'} = [];
$config->{'patterntype'} = [];
$config->{'fileprovides'} = {};
+ $config->{'constraint'} = [];
for my $l (@spec) {
$l = $l->[1] if ref $l;
next unless defined $l;
@@ -288,6 +289,13 @@ sub read_config {
push @macros, "%define _target_cpu ".(split('-', $config->{'target'}))[0] if $config->{'target'};
} elsif ($l0 eq 'hostarch:') {
$config->{'hostarch'} = join(' ', @l);
+ } elsif ($l0 eq 'constraint:') {
+ my $l = join(' ', @l);
+ if ($l eq '!*') {
+ $config->{'constraint'} = [];
+ } else {
+ push @{$config->{'constraint'}}, $l;
+ }
} elsif ($l0 !~ /^[#%]/) {
warn("unknown keyword in config: $l0\n");
}