Skip to content

Commit fb16d89

Browse files
adam8157michal42
authored andcommitted
kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias
As 67d34a6 said, 'oldnoconfig' doesn't set new symbols to 'n', but instead sets it to their default values. So, this patch replaces 'oldnoconfig' with 'olddefconfig', stop making people confused, and keep the old name 'oldnoconfig' as an alias, because people already are dependent on its behavior with the counter-intuitive name. Signed-off-by: Adam Lee <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent 95ac9b3 commit fb16d89

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

scripts/kconfig/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
7676
allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
7777
$< --$@ $(Kconfig)
7878

79-
PHONY += listnewconfig oldnoconfig savedefconfig defconfig
79+
PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
8080

81-
listnewconfig oldnoconfig: $(obj)/conf
81+
listnewconfig olddefconfig: $(obj)/conf
8282
$< --$@ $(Kconfig)
8383

84+
# oldnoconfig is an alias of olddefconfig, because people already are dependent
85+
# on its behavior(sets new symbols to their default value but not 'n') with the
86+
# counter-intuitive name.
87+
oldnoconfig: $(obj)/conf
88+
$< --olddefconfig $(Kconfig)
89+
8490
savedefconfig: $(obj)/conf
8591
$< --$@=defconfig $(Kconfig)
8692

@@ -114,7 +120,7 @@ help:
114120
@echo ' alldefconfig - New config with all symbols set to default'
115121
@echo ' randconfig - New config with random answer to all options'
116122
@echo ' listnewconfig - List new options'
117-
@echo ' oldnoconfig - Same as silentoldconfig but sets new symbols to their default value'
123+
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
118124

119125
# lxdialog stuff
120126
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh

scripts/kconfig/conf.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum input_mode {
3232
defconfig,
3333
savedefconfig,
3434
listnewconfig,
35-
oldnoconfig,
35+
olddefconfig,
3636
} input_mode = oldaskconfig;
3737

3838
static int indent = 1;
@@ -365,7 +365,7 @@ static void conf(struct menu *menu)
365365
case P_MENU:
366366
if ((input_mode == silentoldconfig ||
367367
input_mode == listnewconfig ||
368-
input_mode == oldnoconfig) &&
368+
input_mode == olddefconfig) &&
369369
rootEntry != menu) {
370370
check_conf(menu);
371371
return;
@@ -429,7 +429,7 @@ static void check_conf(struct menu *menu)
429429
if (sym->name && !sym_is_choice_value(sym)) {
430430
printf("%s%s\n", CONFIG_, sym->name);
431431
}
432-
} else if (input_mode != oldnoconfig) {
432+
} else if (input_mode != olddefconfig) {
433433
if (!conf_cnt++)
434434
printf(_("*\n* Restart config...\n*\n"));
435435
rootEntry = menu_get_parent_menu(menu);
@@ -454,7 +454,13 @@ static struct option long_opts[] = {
454454
{"alldefconfig", no_argument, NULL, alldefconfig},
455455
{"randconfig", no_argument, NULL, randconfig},
456456
{"listnewconfig", no_argument, NULL, listnewconfig},
457-
{"oldnoconfig", no_argument, NULL, oldnoconfig},
457+
{"olddefconfig", no_argument, NULL, olddefconfig},
458+
/*
459+
* oldnoconfig is an alias of olddefconfig, because people already
460+
* are dependent on its behavior(sets new symbols to their default
461+
* value but not 'n') with the counter-intuitive name.
462+
*/
463+
{"oldnoconfig", no_argument, NULL, olddefconfig},
458464
{NULL, 0, NULL, 0}
459465
};
460466

@@ -467,7 +473,8 @@ static void conf_usage(const char *progname)
467473
printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
468474
printf(" --oldconfig Update a configuration using a provided .config as base\n");
469475
printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n");
470-
printf(" --oldnoconfig Same as silentoldconfig but sets new symbols to their default value\n");
476+
printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n");
477+
printf(" --oldnoconfig An alias of olddefconfig\n");
471478
printf(" --defconfig <file> New config with default defined in <file>\n");
472479
printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n");
473480
printf(" --allnoconfig New config where all options are answered with no\n");
@@ -520,7 +527,7 @@ int main(int ac, char **av)
520527
case allmodconfig:
521528
case alldefconfig:
522529
case listnewconfig:
523-
case oldnoconfig:
530+
case olddefconfig:
524531
break;
525532
case '?':
526533
conf_usage(progname);
@@ -565,7 +572,7 @@ int main(int ac, char **av)
565572
case oldaskconfig:
566573
case oldconfig:
567574
case listnewconfig:
568-
case oldnoconfig:
575+
case olddefconfig:
569576
conf_read(NULL);
570577
break;
571578
case allnoconfig:
@@ -645,15 +652,15 @@ int main(int ac, char **av)
645652
/* fall through */
646653
case oldconfig:
647654
case listnewconfig:
648-
case oldnoconfig:
655+
case olddefconfig:
649656
case silentoldconfig:
650657
/* Update until a loop caused no more changes */
651658
do {
652659
conf_cnt = 0;
653660
check_conf(&rootmenu);
654661
} while (conf_cnt &&
655662
(input_mode != listnewconfig &&
656-
input_mode != oldnoconfig));
663+
input_mode != olddefconfig));
657664
break;
658665
}
659666

tools/testing/ktest/ktest.pl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,10 +1871,10 @@ sub make_oldconfig {
18711871
apply_min_config;
18721872
}
18731873

1874-
if (!run_command "$make oldnoconfig") {
1875-
# Perhaps oldnoconfig doesn't exist in this version of the kernel
1874+
if (!run_command "$make olddefconfig") {
1875+
# Perhaps olddefconfig doesn't exist in this version of the kernel
18761876
# try a yes '' | oldconfig
1877-
doprint "oldnoconfig failed, trying yes '' | make oldconfig\n";
1877+
doprint "olddefconfig failed, trying yes '' | make oldconfig\n";
18781878
run_command "yes '' | $make oldconfig" or
18791879
dodie "failed make config oldconfig";
18801880
}
@@ -1927,7 +1927,7 @@ sub build {
19271927

19281928
# old config can ask questions
19291929
if ($type eq "oldconfig") {
1930-
$type = "oldnoconfig";
1930+
$type = "olddefconfig";
19311931

19321932
# allow for empty configs
19331933
run_command "touch $output_config";
@@ -1957,7 +1957,7 @@ sub build {
19571957
load_force_config($minconfig);
19581958
}
19591959

1960-
if ($type ne "oldnoconfig") {
1960+
if ($type ne "olddefconfig") {
19611961
run_command "$make $type" or
19621962
dodie "failed make config";
19631963
}
@@ -2456,8 +2456,7 @@ sub bisect {
24562456

24572457
# config_off holds the set of configs that the bad config had disabled.
24582458
# We need to record them and set them in the .config when running
2459-
# oldnoconfig, because oldnoconfig does not turn off new symbols, but
2460-
# instead just keeps the defaults.
2459+
# olddefconfig, because olddefconfig keeps the defaults.
24612460
my %config_off;
24622461

24632462
# config_off_tmp holds a set of configs to turn off for now
@@ -3248,7 +3247,7 @@ sub test_this_config {
32483247
}
32493248

32503249
# Remove this config from the list of configs
3251-
# do a make oldnoconfig and then read the resulting
3250+
# do a make olddefconfig and then read the resulting
32523251
# .config to make sure it is missing the config that
32533252
# we had before
32543253
my %configs = %min_configs;

0 commit comments

Comments
 (0)