aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-09-27 10:08:12 +0100
committerRon Yorston <rmy@pobox.com>2017-09-27 10:11:19 +0100
commitd9383e984da8de72e61e5094a3cf6404c5707ddc (patch)
treedd42825854fc42aea40d4f7a95548d53721d1733 /scripts
parent166b3e4e82799f87d3b002c7177891111eff079e (diff)
parent0c4dbd481aedb5d22c1048e7f7eb547a3b5e50a5 (diff)
downloadbusybox-w32-d9383e984da8de72e61e5094a3cf6404c5707ddc.tar.gz
busybox-w32-d9383e984da8de72e61e5094a3cf6404c5707ddc.tar.bz2
busybox-w32-d9383e984da8de72e61e5094a3cf6404c5707ddc.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/conf.c56
1 files changed, 54 insertions, 2 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 41ac23936..f69591c69 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -76,14 +76,53 @@ static void conf_askvalue(struct symbol *sym, const char *def)
76 76
77 line[0] = '\n'; 77 line[0] = '\n';
78 line[1] = 0; 78 line[1] = 0;
79 line[2] = 0;
79 80
80 if (!sym_is_changable(sym)) { 81 if (!sym_is_changable(sym)) {
81 printf("%s\n", def); 82 printf("%s\n", def);
82 line[0] = '\n';
83 line[1] = 0;
84 return; 83 return;
85 } 84 }
86 85
86 // If autoconf run (allnoconfig and such), reset bool and tristates:
87 // "select ITEM" sets ITEM=y and then parent item might have been
88 // reset to "n" later. Try to set ITEM to "n" on the second run.
89 if (type == S_BOOLEAN || type == S_TRISTATE) {
90 switch (input_mode) {
91 case set_yes:
92 if (sym_tristate_within_range(sym, yes)) {
93 line[0] = 'y';
94 line[1] = '\n';
95 printf("%s", line);
96 return;
97 }
98 case set_mod:
99 if (type == S_TRISTATE) {
100 if (sym_tristate_within_range(sym, mod)) {
101 line[0] = 'm';
102 line[1] = '\n';
103 printf("%s", line);
104 return;
105 }
106 } else {
107 if (sym_tristate_within_range(sym, yes)) {
108 line[0] = 'y';
109 line[1] = '\n';
110 printf("%s", line);
111 return;
112 }
113 }
114 case set_no:
115 if (sym_tristate_within_range(sym, no)) {
116 line[0] = 'n';
117 line[1] = '\n';
118 printf("%s", line);
119 return;
120 }
121 default: // placate compiler
122 break;
123 }
124 }
125
87 switch (input_mode) { 126 switch (input_mode) {
88 case set_no: 127 case set_no:
89 case set_mod: 128 case set_mod:
@@ -605,6 +644,19 @@ int main(int ac, char **av)
605 if (input_mode != ask_silent) { 644 if (input_mode != ask_silent) {
606 rootEntry = &rootmenu; 645 rootEntry = &rootmenu;
607 conf(&rootmenu); 646 conf(&rootmenu);
647 // If autoconf run (allnoconfig and such), run it twice:
648 // "select ITEM" sets ITEM=y and then parent item
649 // is reset to "n" later. Second run sets ITEM to "n".
650 // Example: ADDUSER selects LONG_OPTS.
651 // allnoconfig must set _both_ to "n".
652 // Before, LONG_OPTS remained "y".
653 if (input_mode == set_no
654 || input_mode == set_mod
655 || input_mode == set_yes
656 ) {
657 rootEntry = &rootmenu;
658 conf(&rootmenu);
659 }
608 if (input_mode == ask_all) { 660 if (input_mode == ask_all) {
609 input_mode = ask_silent; 661 input_mode = ask_silent;
610 valid_stdin = 1; 662 valid_stdin = 1;