diff options
Diffstat (limited to 'scripts/package-metadata.pl')
-rwxr-xr-x | scripts/package-metadata.pl | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 1a4f103810..f8f16f07fa 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -176,8 +176,21 @@ sub mconf_depends { next if $package{$depend} and $package{$depend}->{buildonly}; if ($flags =~ /\+/) { if ($vdep = $package{$depend}->{vdepends}) { - my @vdeps = @$vdep; - $depend = shift @vdeps; + my @vdeps; + $depend = undef; + + foreach my $v (@$vdep) { + if ($package{$v} && $package{$v}->{variant_default}) { + $depend = $v; + } else { + push @vdeps, $v; + } + } + + if (!$depend) { + $depend = shift @vdeps; + } + if (@vdeps > 1) { $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')'; } elsif (@vdeps > 0) { |