[OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

Yousong Zhou yszhou4tech at gmail.com
Mon Dec 22 05:29:08 EST 2014


`kmod-ipt-ipset' has a `DEPENDS' value of `@(!(TARGET_ps3||TARGET_pxcab)||BROKEN)'.
Recursive dependency will occur if another package conditionally depends
on it with something like `+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset'
which will produce the following kconfig content.

	config PACKAGE_dnsmasq-full
		...
		depends on !(PACKAGE_dnsmasq_full_ipset) || (!(TARGET_ps3||TARGET_pxcab)||BROKEN)

		if PACKAGE_dnsmasq-full
		...
		config PACKAGE_dnsmasq_full_ipset
			bool "Build with ipset support."
			default y
		...
		endif

And mconf will complain with

	tmp/.config-package.in:127:error: recursive dependency detected!
	tmp/.config-package.in:127:     symbol PACKAGE_dnsmasq-full depends on PACKAGE_dnsmasq_full_ipset
	tmp/.config-package.in:157:     symbol PACKAGE_dnsmasq_full_ipset depends on PACKAGE_dnsmasq-full

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 scripts/metadata.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index f3d04db..a2465d1 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -500,7 +500,7 @@ sub mconf_depends {
 			};
 			$flags =~ /@/ or $depend = "PACKAGE_$depend";
 			if ($condition) {
-				if ($m =~ /select/) {
+				if ($m =~ /select/ or $condition = $depend) {
 					next if $depend eq $condition;
 					$depend = "$depend if $condition";
 				} else {
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list