Commit 861b4ea4 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Michal Marek

kconfig: change nonint_oldconfig to listnewconfig

Rename to a name that better match the other kconfig targets.

listnewconfig shall read as:

- list new options compared to current configuration

New options are now written to stdout so one can redirect the output.

Do not exit with an error code if there is new options.

These are feature changes compared to the original
nonint_oldconfig - but as this feature has not yet been in a
released kernel it should not matter.

It is still possible to do:

make listnewconfig
lookup new config options in Kconfig*
edit .config
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Acked-by: default avatarAristeu Rozanski <aris@redhat.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent ef61ca88
...@@ -90,9 +90,9 @@ PHONY += allnoconfig allyesconfig allmodconfig randconfig ...@@ -90,9 +90,9 @@ PHONY += allnoconfig allyesconfig allmodconfig randconfig
allnoconfig allyesconfig allmodconfig randconfig: $(obj)/conf allnoconfig allyesconfig allmodconfig randconfig: $(obj)/conf
$< --$@ $(Kconfig) $< --$@ $(Kconfig)
PHONY += nonint_oldconfig oldnoconfig defconfig PHONY += listnewconfig oldnoconfig defconfig
nonint_oldconfig oldnoconfig: $(obj)/conf listnewconfig oldnoconfig: $(obj)/conf
$< --$@ $(Kconfig) $< --$@ $(Kconfig)
defconfig: $(obj)/conf defconfig: $(obj)/conf
...@@ -122,8 +122,7 @@ help: ...@@ -122,8 +122,7 @@ help:
@echo ' allmodconfig - New config selecting modules when possible' @echo ' allmodconfig - New config selecting modules when possible'
@echo ' allyesconfig - New config where all options are accepted with yes' @echo ' allyesconfig - New config where all options are accepted with yes'
@echo ' allnoconfig - New config where all options are answered with no' @echo ' allnoconfig - New config where all options are answered with no'
@echo ' nonint_oldconfig - Checks the current configuration and fails if an option is ' @echo ' listnewconfig - List new options'
@echo ' not set'
@echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)'
# lxdialog stuff # lxdialog stuff
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
/* Return codes */
#define EUNSETOPT 2 /* if -B and -b are used and unset config
* options were found */
static void conf(struct menu *menu); static void conf(struct menu *menu);
static void check_conf(struct menu *menu); static void check_conf(struct menu *menu);
...@@ -33,7 +29,7 @@ enum input_mode { ...@@ -33,7 +29,7 @@ enum input_mode {
allmodconfig, allmodconfig,
randconfig, randconfig,
defconfig, defconfig,
nonint_oldconfig, listnewconfig,
oldnoconfig, oldnoconfig,
} input_mode = oldaskconfig; } input_mode = oldaskconfig;
...@@ -45,7 +41,6 @@ static int sync_kconfig; ...@@ -45,7 +41,6 @@ static int sync_kconfig;
static int conf_cnt; static int conf_cnt;
static char line[128]; static char line[128];
static struct menu *rootEntry; static struct menu *rootEntry;
static int unset_variables;
static void print_help(struct menu *menu) static void print_help(struct menu *menu)
{ {
...@@ -366,7 +361,7 @@ static void conf(struct menu *menu) ...@@ -366,7 +361,7 @@ static void conf(struct menu *menu)
switch (prop->type) { switch (prop->type) {
case P_MENU: case P_MENU:
if ((input_mode == silentoldconfig || if ((input_mode == silentoldconfig ||
input_mode == nonint_oldconfig || input_mode == listnewconfig ||
input_mode == oldnoconfig) && input_mode == oldnoconfig) &&
rootEntry != menu) { rootEntry != menu) {
check_conf(menu); check_conf(menu);
...@@ -426,16 +421,9 @@ static void check_conf(struct menu *menu) ...@@ -426,16 +421,9 @@ static void check_conf(struct menu *menu)
if (sym && !sym_has_value(sym)) { if (sym && !sym_has_value(sym)) {
if (sym_is_changable(sym) || if (sym_is_changable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
if (input_mode == nonint_oldconfig || if (input_mode == listnewconfig) {
input_mode == oldnoconfig) { if (sym->name && !sym_is_choice_value(sym)) {
if (input_mode == nonint_oldconfig && printf("CONFIG_%s\n", sym->name);
sym->name && !sym_is_choice_value(sym)) {
if (!unset_variables)
fprintf(stderr, "The following"
" variables are not set:\n");
fprintf(stderr, "CONFIG_%s\n",
sym->name);
unset_variables++;
} }
} else { } else {
if (!conf_cnt++) if (!conf_cnt++)
...@@ -459,7 +447,7 @@ static struct option long_opts[] = { ...@@ -459,7 +447,7 @@ static struct option long_opts[] = {
{"allyesconfig", no_argument, NULL, allyesconfig}, {"allyesconfig", no_argument, NULL, allyesconfig},
{"allmodconfig", no_argument, NULL, allmodconfig}, {"allmodconfig", no_argument, NULL, allmodconfig},
{"randconfig", no_argument, NULL, randconfig}, {"randconfig", no_argument, NULL, randconfig},
{"nonint_oldconfig", no_argument, NULL, nonint_oldconfig}, {"listnewconfig", no_argument, NULL, listnewconfig},
{"oldnoconfig", no_argument, NULL, oldnoconfig}, {"oldnoconfig", no_argument, NULL, oldnoconfig},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -539,7 +527,7 @@ int main(int ac, char **av) ...@@ -539,7 +527,7 @@ int main(int ac, char **av)
case silentoldconfig: case silentoldconfig:
case oldaskconfig: case oldaskconfig:
case oldconfig: case oldconfig:
case nonint_oldconfig: case listnewconfig:
case oldnoconfig: case oldnoconfig:
conf_read(NULL); conf_read(NULL);
break; break;
...@@ -602,7 +590,7 @@ int main(int ac, char **av) ...@@ -602,7 +590,7 @@ int main(int ac, char **av)
conf(&rootmenu); conf(&rootmenu);
input_mode = silentoldconfig; input_mode = silentoldconfig;
/* fall through */ /* fall through */
case nonint_oldconfig: case listnewconfig:
case oldnoconfig: case oldnoconfig:
case silentoldconfig: case silentoldconfig:
/* Update until a loop caused no more changes */ /* Update until a loop caused no more changes */
...@@ -610,7 +598,7 @@ int main(int ac, char **av) ...@@ -610,7 +598,7 @@ int main(int ac, char **av)
conf_cnt = 0; conf_cnt = 0;
check_conf(&rootmenu); check_conf(&rootmenu);
} while (conf_cnt && } while (conf_cnt &&
(input_mode != nonint_oldconfig && (input_mode != listnewconfig &&
input_mode != oldnoconfig)); input_mode != oldnoconfig));
break; break;
} }
...@@ -627,11 +615,11 @@ int main(int ac, char **av) ...@@ -627,11 +615,11 @@ int main(int ac, char **av)
fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n"));
return 1; return 1;
} }
} else if (!unset_variables || input_mode != nonint_oldconfig) { } else if (input_mode != listnewconfig) {
if (conf_write(NULL)) { if (conf_write(NULL)) {
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
exit(1); exit(1);
} }
} }
return unset_variables ? EUNSETOPT : 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment