scripts/package-metadata.pl: strip already selected conditions from dependencies
authorFelix Fietkau <nbd@nbd.name>
Fri, 1 Sep 2023 17:26:29 +0000 (19:26 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 1 Sep 2023 17:30:32 +0000 (19:30 +0200)
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>
scripts/package-metadata.pl

index 4b2f5c8bde61bf8fe651f90c56d82e8360e3b93c..8d8a9fd30659a3c40b7943b5e6fa2af589723f63 100755 (executable)
@@ -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"};