|
@@ -16,6 +16,10 @@
|
|
#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);
|
|
|
|
|
|
@@ -23,6 +27,8 @@ enum {
|
|
ask_all,
|
|
ask_all,
|
|
ask_new,
|
|
ask_new,
|
|
ask_silent,
|
|
ask_silent,
|
|
|
|
+ dont_ask,
|
|
|
|
+ dont_ask_dont_tell,
|
|
set_default,
|
|
set_default,
|
|
set_yes,
|
|
set_yes,
|
|
set_mod,
|
|
set_mod,
|
|
@@ -37,6 +43,7 @@ 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)
|
|
{
|
|
{
|
|
@@ -360,7 +367,10 @@ static void conf(struct menu *menu)
|
|
|
|
|
|
switch (prop->type) {
|
|
switch (prop->type) {
|
|
case P_MENU:
|
|
case P_MENU:
|
|
- if (input_mode == ask_silent && rootEntry != menu) {
|
|
|
|
|
|
+ if ((input_mode == ask_silent ||
|
|
|
|
+ input_mode == dont_ask ||
|
|
|
|
+ input_mode == dont_ask_dont_tell) &&
|
|
|
|
+ rootEntry != menu) {
|
|
check_conf(menu);
|
|
check_conf(menu);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -418,10 +428,23 @@ 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 (!conf_cnt++)
|
|
|
|
- printf(_("*\n* Restart config...\n*\n"));
|
|
|
|
- rootEntry = menu_get_parent_menu(menu);
|
|
|
|
- conf(rootEntry);
|
|
|
|
|
|
+ if (input_mode == dont_ask ||
|
|
|
|
+ input_mode == dont_ask_dont_tell) {
|
|
|
|
+ if (input_mode == dont_ask &&
|
|
|
|
+ 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 {
|
|
|
|
+ if (!conf_cnt++)
|
|
|
|
+ printf(_("*\n* Restart config...\n*\n"));
|
|
|
|
+ rootEntry = menu_get_parent_menu(menu);
|
|
|
|
+ conf(rootEntry);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -439,7 +462,7 @@ int main(int ac, char **av)
|
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
textdomain(PACKAGE);
|
|
textdomain(PACKAGE);
|
|
|
|
|
|
- while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
|
|
|
|
|
|
+ while ((opt = getopt(ac, av, "osbBdD:nmyrh")) != -1) {
|
|
switch (opt) {
|
|
switch (opt) {
|
|
case 'o':
|
|
case 'o':
|
|
input_mode = ask_silent;
|
|
input_mode = ask_silent;
|
|
@@ -448,6 +471,12 @@ int main(int ac, char **av)
|
|
input_mode = ask_silent;
|
|
input_mode = ask_silent;
|
|
sync_kconfig = 1;
|
|
sync_kconfig = 1;
|
|
break;
|
|
break;
|
|
|
|
+ case 'b':
|
|
|
|
+ input_mode = dont_ask;
|
|
|
|
+ break;
|
|
|
|
+ case 'B':
|
|
|
|
+ input_mode = dont_ask_dont_tell;
|
|
|
|
+ break;
|
|
case 'd':
|
|
case 'd':
|
|
input_mode = set_default;
|
|
input_mode = set_default;
|
|
break;
|
|
break;
|
|
@@ -525,6 +554,8 @@ int main(int ac, char **av)
|
|
case ask_silent:
|
|
case ask_silent:
|
|
case ask_all:
|
|
case ask_all:
|
|
case ask_new:
|
|
case ask_new:
|
|
|
|
+ case dont_ask:
|
|
|
|
+ case dont_ask_dont_tell:
|
|
conf_read(NULL);
|
|
conf_read(NULL);
|
|
break;
|
|
break;
|
|
case set_no:
|
|
case set_no:
|
|
@@ -586,12 +617,16 @@ int main(int ac, char **av)
|
|
conf(&rootmenu);
|
|
conf(&rootmenu);
|
|
input_mode = ask_silent;
|
|
input_mode = ask_silent;
|
|
/* fall through */
|
|
/* fall through */
|
|
|
|
+ case dont_ask:
|
|
|
|
+ case dont_ask_dont_tell:
|
|
case ask_silent:
|
|
case ask_silent:
|
|
/* Update until a loop caused no more changes */
|
|
/* Update until a loop caused no more changes */
|
|
do {
|
|
do {
|
|
conf_cnt = 0;
|
|
conf_cnt = 0;
|
|
check_conf(&rootmenu);
|
|
check_conf(&rootmenu);
|
|
- } while (conf_cnt);
|
|
|
|
|
|
+ } while (conf_cnt &&
|
|
|
|
+ (input_mode != dont_ask &&
|
|
|
|
+ input_mode != dont_ask_dont_tell));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -607,11 +642,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 {
|
|
|
|
|
|
+ } else if (!unset_variables || input_mode != dont_ask) {
|
|
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 0;
|
|
|
|
|
|
+ return unset_variables ? EUNSETOPT : 0;
|
|
}
|
|
}
|