aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2016-05-10 22:36:57 +0000
committerLuka Perkov <luka@openwrt.org>2016-06-19 19:32:34 +0200
commit78308aadbc348c19b4cb7464b576e5408b74a695 (patch)
tree2cf8ca7527524e54d09f702b3a1abccd7a69b65c /scripts
parentf433a43aac4091cf4f71228345500a47ff4812ac (diff)
downloadmaster-187ad058-78308aadbc348c19b4cb7464b576e5408b74a695.tar.gz
master-187ad058-78308aadbc348c19b4cb7464b576e5408b74a695.tar.bz2
master-187ad058-78308aadbc348c19b4cb7464b576e5408b74a695.zip
metadata.pl: add support for selecting packages available only via PROVIDES
Signed-off-by: Felix Fietkau <nbd@nbd.name> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49346 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/metadata.pl50
1 files changed, 30 insertions, 20 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 6ad3c39f00..96d5ee4208 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -457,28 +457,38 @@ sub mconf_depends {
$depend = $2;
}
next if $package{$depend} and $package{$depend}->{buildonly};
- if ($vdep = $package{$depend}->{vdepends}) {
- $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
- } else {
- $flags =~ /\+/ and do {
- # 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;
- };
- $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';
+ if ($flags =~ /\+/) {
+ if ($vdep = $package{$depend}->{vdepends}) {
+ my @vdeps = @$vdep;
+ $depend = shift @vdeps;
+ 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
+ # 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;
}