metadata: do not emit broken kconfig dependency statements
authorJo-Philipp Wich <jo@mein.io>
Sun, 14 Jan 2018 17:46:36 +0000 (18:46 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 14 Jan 2018 18:00:06 +0000 (19:00 +0100)
Prevent emitting broken dependency statements when resolving references
to non existing packages to an empty provider list.

Fixes: 47d6b05ad3 ("metadata: always resolve dependencies through provides list")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
scripts/package-metadata.pl

index 36b1160d8c927e9a4807bee4b15d0a9d7cb1a257..53bb45a62c83d628e62dc3857eb8d9d48d3b9ba3 100755 (executable)
@@ -209,7 +209,7 @@ sub mconf_depends {
                        $flags =~ /@/ or $depend = "PACKAGE_$depend";
                } else {
                        my $vdep = $vpackage{$depend};
-                       if ($vdep) {
+                       if ($vdep && @$vdep > 0) {
                                $depend = join("||", map { "PACKAGE_".$_->{name} } @$vdep);
                        } else {
                                $flags =~ /@/ or $depend = "PACKAGE_$depend";