scripts/package-metadata.pl: fix handling of virtual (PROVIDES) depends
[openwrt/staging/stintel.git] / scripts / package-metadata.pl
index f5d28e41a362eabe6fa296d2e83c3580ee97f182..1a4f103810a6b66a620377f18199a84d4d971601 100755 (executable)
@@ -179,9 +179,9 @@ sub mconf_depends {
                                my @vdeps = @$vdep;
                                $depend = shift @vdeps;
                                if (@vdeps > 1) {
-                                       $condition = '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
+                                       $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
                                } elsif (@vdeps > 0) {
-                                       $condition = '!PACKAGE_'.$vdeps[0];
+                                       $condition = ($condition ? "$condition && " : '') . '!PACKAGE_'.$vdeps[0];
                                }
                        }