metadata.pl: add support for selecting packages available only via PROVIDES

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2016-05-09 14:48:49 +02:00
parent 91f205acaf
commit 4a3348ef09

View file

@ -457,10 +457,17 @@ sub mconf_depends {
$depend = $2; $depend = $2;
} }
next if $package{$depend} and $package{$depend}->{buildonly}; next if $package{$depend} and $package{$depend}->{buildonly};
if ($flags =~ /\+/) {
if ($vdep = $package{$depend}->{vdepends}) { if ($vdep = $package{$depend}->{vdepends}) {
$depend = join("||", map { "PACKAGE_".$_ } @$vdep); my @vdeps = @$vdep;
} else { $depend = shift @vdeps;
$flags =~ /\+/ and do { if (@vdeps > 1) {
$condition = '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
} elsif (@vdeps > 0) {
$condition = '!PACKAGE_'.$vdeps[0];
}
}
# Menuconfig will not treat 'select FOO' as a real dependency # Menuconfig will not treat 'select FOO' as a real dependency
# thus if FOO depends on other config options, these dependencies # thus if FOO depends on other config options, these dependencies
# will not be checked. To fix this, we simply emit all of FOO's # will not be checked. To fix this, we simply emit all of FOO's
@ -469,7 +476,11 @@ sub mconf_depends {
$m = "select"; $m = "select";
next if $only_dep; next if $only_dep;
}; } else {
if ($vdep = $package{$depend}->{vdepends}) {
$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
}
}
$flags =~ /@/ or $depend = "PACKAGE_$depend"; $flags =~ /@/ or $depend = "PACKAGE_$depend";
if ($condition) { if ($condition) {
if ($m =~ /select/) { if ($m =~ /select/) {
@ -479,7 +490,6 @@ sub mconf_depends {
$depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select'; $depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
} }
} }
}
$dep->{$depend} =~ /select/ or $dep->{$depend} = $m; $dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
} }