diff mbox series

kconfig: restore prompt dependencies in help text

Message ID 20200102231402.1052657-1-nivedita@alum.mit.edu (mailing list archive)
State New, archived
Headers show
Series kconfig: restore prompt dependencies in help text | expand

Commit Message

Arvind Sankar Jan. 2, 2020, 11:14 p.m. UTC
Commit bcdedcc1afd6 ("menuconfig: print more info for symbol without
prompts") moved some code from get_prompt_str to get_symbol_str so that
dependency information for symbols without prompts could be shown.

This code would be better copied rather than moved, as the change had
the side-effect of not showing any extra dependencies that the prompt
might have over the symbol.

Put back a copy of the dependency printing code in get_prompt_str.

The following is an example for NAMESPACES:

Before:
	Symbol: NAMESPACES [=y]
	Type  : bool
	Prompt: Namespaces support
	  Location:
	(2) -> General setup
	  Defined at init/Kconfig:1064
	  Depends on: MULTIUSER [=y]

After:
	Symbol: NAMESPACES [=y]
	Type  : bool
	Prompt: Namespaces support
	  Editable if: MULTIUSER [=y] && EXPERT [=y]
	  Location:
	(2) -> General setup
	  Defined at init/Kconfig:1064
	  Depends on: MULTIUSER [=y]

Fixes: bcdedcc1afd6 ("menuconfig: print more info for symbol without prompts")
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
---
 scripts/kconfig/menu.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Masahiro Yamada Jan. 3, 2020, 2:10 a.m. UTC | #1
On Fri, Jan 3, 2020 at 8:14 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
>
> Commit bcdedcc1afd6 ("menuconfig: print more info for symbol without
> prompts") moved some code from get_prompt_str to get_symbol_str so that
> dependency information for symbols without prompts could be shown.
>
> This code would be better copied rather than moved, as the change had
> the side-effect of not showing any extra dependencies that the prompt
> might have over the symbol.
>
> Put back a copy of the dependency printing code in get_prompt_str.
>
> The following is an example for NAMESPACES:
>
> Before:
>         Symbol: NAMESPACES [=y]
>         Type  : bool
>         Prompt: Namespaces support
>           Location:
>         (2) -> General setup
>           Defined at init/Kconfig:1064
>           Depends on: MULTIUSER [=y]
>
> After:
>         Symbol: NAMESPACES [=y]
>         Type  : bool
>         Prompt: Namespaces support
>           Editable if: MULTIUSER [=y] && EXPERT [=y]
>           Location:
>         (2) -> General setup
>           Defined at init/Kconfig:1064
>           Depends on: MULTIUSER [=y]
>
> Fixes: bcdedcc1afd6 ("menuconfig: print more info for symbol without prompts")
> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
> ---


I had already applied the following patch;
https://patchwork.kernel.org/patch/11298143/

It it available in linux-next.




>  scripts/kconfig/menu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index d9d16469859a..6fbbe41302dc 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -706,6 +706,12 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
>         struct jump_key *jump = NULL;
>
>         str_printf(r, "Prompt: %s\n", prop->text);
> +       if (!expr_is_yes(prop->visible.expr)) {
> +               str_append(r, "  Editable if: ");
> +               expr_gstr_print(prop->visible.expr, r);
> +               str_append(r, "\n");
> +       }
> +
>         menu = prop->menu->parent;
>         for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
>                 bool accessible = menu_is_visible(menu);
> --
> 2.24.1
>
Arvind Sankar Jan. 3, 2020, 4:20 a.m. UTC | #2
On Fri, Jan 03, 2020 at 11:10:28AM +0900, Masahiro Yamada wrote:
> 
> I had already applied the following patch;
> https://patchwork.kernel.org/patch/11298143/
> 
> It it available in linux-next.
> 

Oh cool
diff mbox series

Patch

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index d9d16469859a..6fbbe41302dc 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -706,6 +706,12 @@  static void get_prompt_str(struct gstr *r, struct property *prop,
 	struct jump_key *jump = NULL;
 
 	str_printf(r, "Prompt: %s\n", prop->text);
+	if (!expr_is_yes(prop->visible.expr)) {
+		str_append(r, "  Editable if: ");
+		expr_gstr_print(prop->visible.expr, r);
+		str_append(r, "\n");
+	}
+
 	menu = prop->menu->parent;
 	for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
 		bool accessible = menu_is_visible(menu);