metadata.pl: add support for selecting packages available only via PROVIDES
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
91f205acaf
commit
4a3348ef09
1 changed files with 30 additions and 20 deletions
|
@ -457,28 +457,38 @@ sub mconf_depends {
|
||||||
$depend = $2;
|
$depend = $2;
|
||||||
}
|
}
|
||||||
next if $package{$depend} and $package{$depend}->{buildonly};
|
next if $package{$depend} and $package{$depend}->{buildonly};
|
||||||
if ($vdep = $package{$depend}->{vdepends}) {
|
if ($flags =~ /\+/) {
|
||||||
$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
|
if ($vdep = $package{$depend}->{vdepends}) {
|
||||||
} else {
|
my @vdeps = @$vdep;
|
||||||
$flags =~ /\+/ and do {
|
$depend = shift @vdeps;
|
||||||
# Menuconfig will not treat 'select FOO' as a real dependency
|
if (@vdeps > 1) {
|
||||||
# thus if FOO depends on other config options, these dependencies
|
$condition = '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
|
||||||
# will not be checked. To fix this, we simply emit all of FOO's
|
} elsif (@vdeps > 0) {
|
||||||
# depends here as well.
|
$condition = '!PACKAGE_'.$vdeps[0];
|
||||||
$package{$depend} and push @t_depends, [ $package{$depend}->{depends}, $condition ];
|
|
||||||
|
|
||||||
$m = "select";
|
|
||||||
next if $only_dep;
|
|
||||||
};
|
|
||||||
$flags =~ /@/ or $depend = "PACKAGE_$depend";
|
|
||||||
if ($condition) {
|
|
||||||
if ($m =~ /select/) {
|
|
||||||
next if $depend eq $condition;
|
|
||||||
$depend = "$depend if $condition";
|
|
||||||
} else {
|
|
||||||
$depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Menuconfig will not treat 'select FOO' as a real dependency
|
||||||
|
# thus if FOO depends on other config options, these dependencies
|
||||||
|
# will not be checked. To fix this, we simply emit all of FOO's
|
||||||
|
# depends here as well.
|
||||||
|
$package{$depend} and push @t_depends, [ $package{$depend}->{depends}, $condition ];
|
||||||
|
|
||||||
|
$m = "select";
|
||||||
|
next if $only_dep;
|
||||||
|
} else {
|
||||||
|
if ($vdep = $package{$depend}->{vdepends}) {
|
||||||
|
$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$flags =~ /@/ or $depend = "PACKAGE_$depend";
|
||||||
|
if ($condition) {
|
||||||
|
if ($m =~ /select/) {
|
||||||
|
next if $depend eq $condition;
|
||||||
|
$depend = "$depend if $condition";
|
||||||
|
} else {
|
||||||
|
$depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
|
$dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue