conf.c (0748cb3e1fbd89c03a98c15e91ad65797981de77) | conf.c (7cf3d73b4360e91b14326632ab1aeda4cb26308d) |
---|---|
1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <locale.h> 7#include <ctype.h> 8#include <stdio.h> --- 16 unchanged lines hidden (view full) --- 25 silentoldconfig, 26 oldconfig, 27 allnoconfig, 28 allyesconfig, 29 allmodconfig, 30 alldefconfig, 31 randconfig, 32 defconfig, | 1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <locale.h> 7#include <ctype.h> 8#include <stdio.h> --- 16 unchanged lines hidden (view full) --- 25 silentoldconfig, 26 oldconfig, 27 allnoconfig, 28 allyesconfig, 29 allmodconfig, 30 alldefconfig, 31 randconfig, 32 defconfig, |
33 savedefconfig, |
|
33 listnewconfig, 34 oldnoconfig, 35} input_mode = oldaskconfig; 36 37char *defconfig_file; 38 39static int indent = 1; 40static int valid_stdin = 1; --- 398 unchanged lines hidden (view full) --- 439 check_conf(child); 440} 441 442static struct option long_opts[] = { 443 {"oldaskconfig", no_argument, NULL, oldaskconfig}, 444 {"oldconfig", no_argument, NULL, oldconfig}, 445 {"silentoldconfig", no_argument, NULL, silentoldconfig}, 446 {"defconfig", optional_argument, NULL, defconfig}, | 34 listnewconfig, 35 oldnoconfig, 36} input_mode = oldaskconfig; 37 38char *defconfig_file; 39 40static int indent = 1; 41static int valid_stdin = 1; --- 398 unchanged lines hidden (view full) --- 440 check_conf(child); 441} 442 443static struct option long_opts[] = { 444 {"oldaskconfig", no_argument, NULL, oldaskconfig}, 445 {"oldconfig", no_argument, NULL, oldconfig}, 446 {"silentoldconfig", no_argument, NULL, silentoldconfig}, 447 {"defconfig", optional_argument, NULL, defconfig}, |
448 {"savedefconfig", required_argument, NULL, savedefconfig}, |
|
447 {"allnoconfig", no_argument, NULL, allnoconfig}, 448 {"allyesconfig", no_argument, NULL, allyesconfig}, 449 {"allmodconfig", no_argument, NULL, allmodconfig}, 450 {"alldefconfig", no_argument, NULL, alldefconfig}, 451 {"randconfig", no_argument, NULL, randconfig}, 452 {"listnewconfig", no_argument, NULL, listnewconfig}, 453 {"oldnoconfig", no_argument, NULL, oldnoconfig}, 454 {NULL, 0, NULL, 0} --- 11 unchanged lines hidden (view full) --- 466 467 while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) { 468 input_mode = (enum input_mode)opt; 469 switch (opt) { 470 case silentoldconfig: 471 sync_kconfig = 1; 472 break; 473 case defconfig: | 449 {"allnoconfig", no_argument, NULL, allnoconfig}, 450 {"allyesconfig", no_argument, NULL, allyesconfig}, 451 {"allmodconfig", no_argument, NULL, allmodconfig}, 452 {"alldefconfig", no_argument, NULL, alldefconfig}, 453 {"randconfig", no_argument, NULL, randconfig}, 454 {"listnewconfig", no_argument, NULL, listnewconfig}, 455 {"oldnoconfig", no_argument, NULL, oldnoconfig}, 456 {NULL, 0, NULL, 0} --- 11 unchanged lines hidden (view full) --- 468 469 while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) { 470 input_mode = (enum input_mode)opt; 471 switch (opt) { 472 case silentoldconfig: 473 sync_kconfig = 1; 474 break; 475 case defconfig: |
476 case savedefconfig: |
|
474 defconfig_file = optarg; 475 break; 476 case randconfig: 477 { 478 struct timeval now; 479 unsigned int seed; 480 481 /* --- 39 unchanged lines hidden (view full) --- 521 defconfig_file = conf_get_default_confname(); 522 if (conf_read(defconfig_file)) { 523 printf(_("***\n" 524 "*** Can't find default configuration \"%s\"!\n" 525 "***\n"), defconfig_file); 526 exit(1); 527 } 528 break; | 477 defconfig_file = optarg; 478 break; 479 case randconfig: 480 { 481 struct timeval now; 482 unsigned int seed; 483 484 /* --- 39 unchanged lines hidden (view full) --- 524 defconfig_file = conf_get_default_confname(); 525 if (conf_read(defconfig_file)) { 526 printf(_("***\n" 527 "*** Can't find default configuration \"%s\"!\n" 528 "***\n"), defconfig_file); 529 exit(1); 530 } 531 break; |
532 case savedefconfig: 533 conf_read(NULL); 534 break; |
|
529 case silentoldconfig: 530 case oldaskconfig: 531 case oldconfig: 532 case listnewconfig: 533 case oldnoconfig: 534 conf_read(NULL); 535 break; 536 case allnoconfig: --- 49 unchanged lines hidden (view full) --- 586 conf_set_all_new_symbols(def_default); 587 break; 588 case randconfig: 589 conf_set_all_new_symbols(def_random); 590 break; 591 case defconfig: 592 conf_set_all_new_symbols(def_default); 593 break; | 535 case silentoldconfig: 536 case oldaskconfig: 537 case oldconfig: 538 case listnewconfig: 539 case oldnoconfig: 540 conf_read(NULL); 541 break; 542 case allnoconfig: --- 49 unchanged lines hidden (view full) --- 592 conf_set_all_new_symbols(def_default); 593 break; 594 case randconfig: 595 conf_set_all_new_symbols(def_random); 596 break; 597 case defconfig: 598 conf_set_all_new_symbols(def_default); 599 break; |
600 case savedefconfig: 601 break; |
|
594 case oldconfig: 595 case oldaskconfig: 596 rootEntry = &rootmenu; 597 conf(&rootmenu); 598 input_mode = silentoldconfig; 599 /* fall through */ 600 case listnewconfig: 601 case oldnoconfig: --- 15 unchanged lines hidden (view full) --- 617 if (conf_get_changed() && conf_write(NULL)) { 618 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 619 exit(1); 620 } 621 if (conf_write_autoconf()) { 622 fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); 623 return 1; 624 } | 602 case oldconfig: 603 case oldaskconfig: 604 rootEntry = &rootmenu; 605 conf(&rootmenu); 606 input_mode = silentoldconfig; 607 /* fall through */ 608 case listnewconfig: 609 case oldnoconfig: --- 15 unchanged lines hidden (view full) --- 625 if (conf_get_changed() && conf_write(NULL)) { 626 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 627 exit(1); 628 } 629 if (conf_write_autoconf()) { 630 fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); 631 return 1; 632 } |
633 } else if (input_mode == savedefconfig) { 634 if (conf_write_defconfig(defconfig_file)) { 635 fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"), 636 defconfig_file); 637 return 1; 638 } |
|
625 } else if (input_mode != listnewconfig) { 626 if (conf_write(NULL)) { 627 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 628 exit(1); 629 } 630 } 631 return 0; 632} | 639 } else if (input_mode != listnewconfig) { 640 if (conf_write(NULL)) { 641 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 642 exit(1); 643 } 644 } 645 return 0; 646} |