scripts/package-metadata.pl: strip already selected conditions from dependencies

When a dependency is pulled in via conditional depends, and the condition
is already selected earlier in the chain, drop the condition.
This avoids some corner cases that trigger recursive dependencies.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2023-09-01 19:26:29 +02:00
parent 6252c18d1c
commit ae88f00357
1 changed files with 2 additions and 0 deletions

View File

@ -160,6 +160,8 @@ sub mconf_depends {
$depend =~ s/^([@\+]+)// and $flags = $1;
my $condition = $parent_condition;
$depend = $2 if $depend =~ /^(.+):(.+)$/ and $dep->{$1} eq 'select';
next if $condition eq $depend;
next if $seen->{"$parent_condition:$depend"};
next if $seen->{":$depend"};