summaryrefslogtreecommitdiff
path: root/kconfig/conf.c
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2020-12-09 08:03:27 (GMT)
committerChris Packham <judge.packham@gmail.com>2021-02-02 07:06:32 (GMT)
commit689dc60f212db105243b60290480f29475578e0d (patch)
tree3e4a6332013209dd63809f4e719f1add8fe9b21a /kconfig/conf.c
parent07ae8dd48dfb19a7b89bc4c208bc5778c79ce446 (diff)
kconfig: Sync with upstream v4.17
This commit introduces the following upstream changes: 17baab68d337 kconfig: extend output of 'listnewconfig' b23d1a241f4e kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically 9a8dfb394c04 kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile 598893002745 .gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore 18492685e479 kconfig: use yylineno option instead of manual lineno increments 379a8eb8eb1a kconfig: detect recursive inclusion earlier 32a94b8b0c3e kconfig: remove duplicated file name and lineno of recursive inclusion 26561514cc9d kconfig: do not include both curses.h and ncurses.h for nconfig f8f69dc0b4e0 kconfig: make unmet dependency warnings readable f622f8279581 kconfig: warn unmet direct dependency of tristate symbols selected by y e2c75e7667c7 kconfig: tests: test if recursive inclusion is detected 29c434f367ea kconfig: tests: test if recursive dependencies are detected 3e4888c2e3d7 kconfig: tests: test randconfig for choice in choice beaaddb62540 kconfig: tests: test defconfig when two choices interact ee236610653e kconfig: tests: check visibility of tristate choice values in y choice 930c429a656f kconfig: tests: check unneeded "is not set" with unmet dependency b76960c0f6b2 kconfig: tests: test if new symbols in choice are asked 49ac3c0c3aa3 kconfig: tests: test automatic submenu creation 1903c5119059 kconfig: tests: add basic choice tests 022a4bf6b59d kconfig: tests: add framework for Kconfig unit testing 2a61625835c7 kconfig: remove redundant streamline_config.pl prerequisite 911a91c39cab kconfig: rename silentoldconfig to syncconfig 81d2bc227305 kconfig: invoke oldconfig instead of silentoldconfig from local*config 2aad9b896213 kconfig: hide irrelevant sub-menus for oldconfig 99f0b6578bab kconfig: remove redundant input_mode test for check_conf() loop 4bb3a5b085cd kconfig: remove unneeded input_mode test in conf() 59a80b5e892d kconfig: do not call check_conf() for olddefconfig f467c5640c29 kconfig: only write '# CONFIG_FOO is not set' for visible symbols d9119b5925a0 kconfig: Print reverse dependencies in groups 9a47ceec543b kconfig: clean-up reverse dependency help implementation 07a422bb213a kbuild: restore autoksyms.h touch to the top Makefile Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'kconfig/conf.c')
-rw-r--r--kconfig/conf.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/kconfig/conf.c b/kconfig/conf.c
index 55e4f7c..5141be2 100644
--- a/kconfig/conf.c
+++ b/kconfig/conf.c
@@ -23,7 +23,7 @@ static void check_conf(struct menu *menu);
enum input_mode {
oldaskconfig,
- silentoldconfig,
+ syncconfig,
oldconfig,
allnoconfig,
allyesconfig,
@@ -100,7 +100,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
switch (input_mode) {
case oldconfig:
- case silentoldconfig:
+ case syncconfig:
if (sym_has_value(sym)) {
printf("%s\n", def);
return 0;
@@ -293,7 +293,7 @@ static int conf_choice(struct menu *menu)
printf("[1-%d?]: ", cnt);
switch (input_mode) {
case oldconfig:
- case silentoldconfig:
+ case syncconfig:
if (!is_new) {
cnt = def;
printf("%d\n", cnt);
@@ -358,10 +358,11 @@ static void conf(struct menu *menu)
switch (prop->type) {
case P_MENU:
- if ((input_mode == silentoldconfig ||
- input_mode == listnewconfig ||
- input_mode == olddefconfig) &&
- rootEntry != menu) {
+ /*
+ * Except in oldaskconfig mode, we show only menus that
+ * contain new symbols.
+ */
+ if (input_mode != oldaskconfig && rootEntry != menu) {
check_conf(menu);
return;
}
@@ -421,10 +422,20 @@ static void check_conf(struct menu *menu)
if (sym_is_changable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
if (input_mode == listnewconfig) {
- if (sym->name && !sym_is_choice_value(sym)) {
- printf("%s%s\n", CONFIG_, sym->name);
+ if (sym->name) {
+ const char *str;
+
+ if (sym->type == S_STRING) {
+ str = sym_get_string_value(sym);
+ str = sym_escape_string_value(str);
+ printf("%s%s=%s\n", CONFIG_, sym->name, str);
+ free((void *)str);
+ } else {
+ str = sym_get_string_value(sym);
+ printf("%s%s=%s\n", CONFIG_, sym->name, str);
+ }
}
- } else if (input_mode != olddefconfig) {
+ } else {
if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
@@ -440,7 +451,7 @@ static void check_conf(struct menu *menu)
static struct option long_opts[] = {
{"oldaskconfig", no_argument, NULL, oldaskconfig},
{"oldconfig", no_argument, NULL, oldconfig},
- {"silentoldconfig", no_argument, NULL, silentoldconfig},
+ {"syncconfig", no_argument, NULL, syncconfig},
{"defconfig", optional_argument, NULL, defconfig},
{"savedefconfig", required_argument, NULL, savedefconfig},
{"allnoconfig", no_argument, NULL, allnoconfig},
@@ -479,7 +490,7 @@ int main(int ac, char **av)
}
input_mode = (enum input_mode)opt;
switch (opt) {
- case silentoldconfig:
+ case syncconfig:
sync_kconfig = 1;
break;
case defconfig:
@@ -561,7 +572,7 @@ int main(int ac, char **av)
}
break;
case savedefconfig:
- case silentoldconfig:
+ case syncconfig:
case oldaskconfig:
case oldconfig:
case listnewconfig:
@@ -641,24 +652,24 @@ int main(int ac, char **av)
case oldaskconfig:
rootEntry = &rootmenu;
conf(&rootmenu);
- input_mode = silentoldconfig;
+ input_mode = oldconfig;
/* fall through */
case oldconfig:
case listnewconfig:
- case olddefconfig:
- case silentoldconfig:
+ case syncconfig:
/* Update until a loop caused no more changes */
do {
conf_cnt = 0;
check_conf(&rootmenu);
- } while (conf_cnt &&
- (input_mode != listnewconfig &&
- input_mode != olddefconfig));
+ } while (conf_cnt);
+ break;
+ case olddefconfig:
+ default:
break;
}
if (sync_kconfig) {
- /* silentoldconfig is used during the build so we shall update autoconf.
+ /* syncconfig is used during the build so we shall update autoconf.
* All other commands are only used to generate a config.
*/
if (conf_get_changed() && conf_write(NULL)) {