From bb33eed5cc6bdce2b65aa570ecd9a400bcd9c180 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 25 May 2019 13:52:09 +0200 Subject: Strip direct deps. from property conditions in Symbol/Choice/MenuNode.__str__() Commit e81a77b ("Consistently put direct deps. last when propagating") makes the position of the direct deps. in property conditions predictable after dependency propagation, making it easy to strip them as needed. Use this to implement MenuNode.orig_{prompt,defaults,selects,implies,ranges}, which work like the non-orig_* versions but omit the direct deps. Use those in turn to omit the direct deps in Symbol/Choice.__str__(). The direct deps. (with propagated parent deps.) can still be seen after 'depends on ...', so there is no loss of information. This unclutters Kconfig definitions shown in menuconfig/guiconfig and in any generated documentation. The old output also had duplicated dependencies, though it doesn't matter for evaluation. Before: config A bool prompt "A" if DEP default y if FOO && DEP depends on DEP After: config A bool prompt "A" default y if FOO depends on DEP --- tests/Kstr | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tests/Kstr') diff --git a/tests/Kstr b/tests/Kstr index 58d25e6..07d7b8d 100644 --- a/tests/Kstr +++ b/tests/Kstr @@ -201,3 +201,40 @@ config ADVANCED_COMMENT_HOOK comment "advanced comment" depends on A depends on B + +# Corner cases when removing direct dependencies + +config DEP_REM_CORNER_CASES + bool + default A + depends on n + +config DEP_REM_CORNER_CASES + default B if n + +config DEP_REM_CORNER_CASES + default C + depends on m + +config DEP_REM_CORNER_CASES + default D if A && y + depends on y + +config DEP_REM_CORNER_CASES + default E if !E1 + default F if F1 = F2 + default G if G1 || H1 + depends on !H + +config DEP_REM_CORNER_CASES + default H + depends on "foo" = "bar" + +menu "menu" + visible if FOO || BAR + +config DEP_REM_CORNER_CASES + prompt "prompt" + depends on BAZ && QAZ + +endmenu -- cgit v1.2.3