[source] scripts/package-metadata.pl: fix overriding conditional dependencies with conditional select

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 11 09:25:02 PST 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/cfd83555fc4f0bab18a26f6812da18e64df46ff3

commit cfd83555fc4f0bab18a26f6812da18e64df46ff3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jan 11 18:22:56 2017 +0100

    scripts/package-metadata.pl: fix overriding conditional dependencies with conditional select
    
    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 at nbd.name>
---
 scripts/package-metadata.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index f8f16f0..2da32c7 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -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';
 			}
 		}



More information about the lede-commits mailing list