X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=scripts%2Fconfig%2Fconf.c;h=0a44a2edd13618d6377719303c623086cf4c65f9;hb=3ebef1c4b57494636f238c468d095bf8b6798969;hp=cb2093691e341db2be6149650a281d419cba8d9f;hpb=f52d66ff00b24111f87c274d3d7085ef2e1d27b1;p=openwrt-10.03%2F.git diff --git a/scripts/config/conf.c b/scripts/config/conf.c index cb2093691..0a44a2edd 100644 --- a/scripts/config/conf.c +++ b/scripts/config/conf.c @@ -508,9 +508,10 @@ int main(int ac, char **av) { int i = 1; const char *name; + char *output = NULL; struct stat tmpstat; - if (ac > i && av[i][0] == '-') { + while (ac > i && av[i][0] == '-') { switch (av[i++][1]) { case 'o': input_mode = ask_new; @@ -531,6 +532,9 @@ int main(int ac, char **av) exit(1); } break; + case 'w': + output = av[i++]; + break; case 'n': input_mode = set_no; break; @@ -579,28 +583,11 @@ int main(int ac, char **av) } case ask_all: case ask_new: - conf_read(NULL); - break; case set_no: case set_mod: case set_yes: case set_random: - name = getenv("KCONFIG_ALLCONFIG"); - if (name && !stat(name, &tmpstat)) { - conf_read_simple(name); - break; - } - switch (input_mode) { - case set_no: name = "allno.config"; break; - case set_mod: name = "allmod.config"; break; - case set_yes: name = "allyes.config"; break; - case set_random: name = "allrandom.config"; break; - default: break; - } - if (!stat(name, &tmpstat)) - conf_read_simple(name); - else if (!stat("all.config", &tmpstat)) - conf_read_simple("all.config"); + conf_read(NULL); break; default: break; @@ -618,7 +605,7 @@ int main(int ac, char **av) conf_cnt = 0; check_conf(&rootmenu); } while (conf_cnt); - if (conf_write(NULL)) { + if (conf_write(output)) { fprintf(stderr, _("\n*** Error during writing of the build configuration.\n\n")); return 1; }