} elsif ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-CONFLICTS' || $tag eq 'BUILD-IGNORE' || $tag eq 'BUILD-DEPENDS-INDEP') {
my @d = split(/,\s*/, $data);
for my $d (@d) {
- if ($d =~ /^(.*?)\s*\[(.*)\]$/) {
- $d = $1;
- my $isneg = 0;
- my $bad;
- for my $q (split('[\s,]', $2)) {
- $isneg = 1 if $q =~ s/^\!//;
- $bad = 1 if !defined($bad) && !$isneg;
- if ($isneg) {
- if ($q eq $arch || $q eq "$os-$arch") {
- $bad = 1;
- last;
- }
- } elsif ($q eq $arch || $q eq "$os-$arch") {
- $bad = 0;
- }
- }
- next if $bad;
- }
+ my @alts = split('\s*\|\s*', $d);
+ my @needed;
+ for my $c (@alts) {
+ if ($c =~ /^(.*?)\s*\[(.*)\]$/) {
+ $c = $1;
+ my $isneg = 0;
+ my $bad;
+ for my $q (split('[\s,]', $2)) {
+ $isneg = 1 if $q =~ s/^\!//;
+ $bad = 1 if !defined($bad) && !$isneg;
+ if ($isneg) {
+ if ($q eq $arch || $q eq "$os-$arch") {
+ $bad = 1;
+ last;
+ }
+ } elsif ($q eq $arch || $q eq "$os-$arch") {
+ $bad = 0;
+ }
+ }
+ push @needed, $c unless $bad;
+ } else {
+ push @needed, $c;
+ }
+ }
+ next unless @needed;
+ $d = join(' | ', @needed);
$d =~ s/ \(([^\)]*)\)/ $1/g;
$d =~ s/>>/>/g;
$d =~ s/<</</g;