scripts/package-metadata.pl: fix overriding conditional dependencies with conditional...
authorFelix Fietkau <nbd@nbd.name>
Wed, 11 Jan 2017 17:22:56 +0000 (18:22 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 11 Jan 2017 17:24:39 +0000 (18:24 +0100)
Conditional dependencies use the '(!cond) || dep' syntax, whereas
conditional select uses 'dep if cond'.
Add an extra check to suppress emitting a conditional if an equal
conditional select already exists.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
scripts/package-metadata.pl

index f8f16f07fa8bb67a037e86473233343e7d2ced0a..2da32c770ef3333bfcc18922ede556f9734510c7 100755 (executable)
@@ -215,11 +215,13 @@ sub mconf_depends {
                                $flags =~ /@/ or $depend = "PACKAGE_$depend";
                        }
                }
+
                if ($condition) {
                        if ($m =~ /select/) {
                                next if $depend eq $condition;
                                $depend = "$depend if $condition";
                        } else {
+                               next if $dep->{"$depend if $condition"};
                                $depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
                        }
                }