diff mbox

[LEDE-DEV,RFCv2,1/3] scripts/package-metadata.pl: fix handling of virtual (PROVIDES) depends

Message ID 20161025095231.6563-2-jo@mein.io
State RFC
Headers show

Commit Message

Jo-Philipp Wich Oct. 25, 2016, 9:52 a.m. UTC
Currently the code emitting dependencies for provide candidates is overwriting
the specification calculated by the previous conditional dependency handling
code, rendering dependencies on virtual PROVIDES packages in conjunction with
conditional dependencies unusable.

Instead of overwriting, append the PROVIDES dependency spec in order to fix
using DEPENDS on virtual provider packages in conjunction with conditions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
 scripts/package-metadata.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index f5d28e4..1a4f103 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -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];
 				}
 			}