diff options
author | Karsten Wiese <annabellesgarden@yahoo.de> | 2006-12-13 03:34:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:48 -0500 |
commit | b321429325e4c911c379a5bf4156c9fc9713e425 (patch) | |
tree | 8781e449e4b0b10da6394f7bf01e0e6004c074ac | |
parent | 3dfcaf16135150d0f025047a7525664a41bb2adf (diff) |
[PATCH] kconfig: new function "bool conf_get_changed(void)"
Run "make xconfig" on a freshly untarred kernel-tree. Look at the floppy disk
icon of the qt application, that has just started: Its in a normal, active
state.
Mouse click on it: .config is being saved.
This patch series changes things so taht
after the mouse click on the floppy disk icon, the icon is greyed out.
If you mouse click on it now, nothing happens.
If you change some CONFIG_*, the floppy disk icon returns to "active state",
that is, if you mouse click it now, .config is written.
This patch:
Returns sym_change_count to reflect the .config's change state.
All read only accesses of
sym_change_count
are replaced by calls to
conf_get_changed()
.
mconfig.c is manipulated to ask for saving only when
conf_get_changed() returned true.
Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | scripts/kconfig/conf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 7 | ||||
-rw-r--r-- | scripts/kconfig/lkc_proto.h | 1 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 21 | ||||
-rw-r--r-- | scripts/kconfig/qconf.cc | 2 |
5 files changed, 23 insertions, 10 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4dcb8867b5f4..124b341a18c0 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -600,7 +600,7 @@ int main(int ac, char **av) | |||
600 | input_mode = ask_silent; | 600 | input_mode = ask_silent; |
601 | valid_stdin = 1; | 601 | valid_stdin = 1; |
602 | } | 602 | } |
603 | } else if (sym_change_count) { | 603 | } else if (conf_get_changed()) { |
604 | name = getenv("KCONFIG_NOSILENTUPDATE"); | 604 | name = getenv("KCONFIG_NOSILENTUPDATE"); |
605 | if (name && *name) { | 605 | if (name && *name) { |
606 | fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); | 606 | fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 66b15ef02931..140742ebd73c 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -432,7 +432,7 @@ int conf_write(const char *name) | |||
432 | use_timestamp ? "# " : "", | 432 | use_timestamp ? "# " : "", |
433 | use_timestamp ? ctime(&now) : ""); | 433 | use_timestamp ? ctime(&now) : ""); |
434 | 434 | ||
435 | if (!sym_change_count) | 435 | if (!conf_get_changed()) |
436 | sym_clear_all_valid(); | 436 | sym_clear_all_valid(); |
437 | 437 | ||
438 | menu = rootmenu.list; | 438 | menu = rootmenu.list; |
@@ -765,3 +765,8 @@ int conf_write_autoconf(void) | |||
765 | 765 | ||
766 | return 0; | 766 | return 0; |
767 | } | 767 | } |
768 | |||
769 | bool conf_get_changed(void) | ||
770 | { | ||
771 | return sym_change_count; | ||
772 | } | ||
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index a263746cfa7d..9f1823c88b73 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -5,6 +5,7 @@ P(conf_read,int,(const char *name)); | |||
5 | P(conf_read_simple,int,(const char *name, int)); | 5 | P(conf_read_simple,int,(const char *name, int)); |
6 | P(conf_write,int,(const char *name)); | 6 | P(conf_write,int,(const char *name)); |
7 | P(conf_write_autoconf,int,(void)); | 7 | P(conf_write_autoconf,int,(void)); |
8 | P(conf_get_changed,bool,(void)); | ||
8 | 9 | ||
9 | /* menu.c */ | 10 | /* menu.c */ |
10 | P(rootmenu,struct menu,); | 11 | P(rootmenu,struct menu,); |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 08a4c7af93ea..3f9a1321b3e6 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -890,14 +890,19 @@ int main(int ac, char **av) | |||
890 | do { | 890 | do { |
891 | conf(&rootmenu); | 891 | conf(&rootmenu); |
892 | dialog_clear(); | 892 | dialog_clear(); |
893 | res = dialog_yesno(NULL, | 893 | if (conf_get_changed()) |
894 | _("Do you wish to save your " | 894 | res = dialog_yesno(NULL, |
895 | "new kernel configuration?\n" | 895 | _("Do you wish to save your " |
896 | "<ESC><ESC> to continue."), | 896 | "new kernel configuration?\n" |
897 | 6, 60); | 897 | "<ESC><ESC> to continue."), |
898 | 6, 60); | ||
899 | else | ||
900 | res = -1; | ||
898 | } while (res == KEY_ESC); | 901 | } while (res == KEY_ESC); |
899 | end_dialog(); | 902 | end_dialog(); |
900 | if (res == 0) { | 903 | |
904 | switch (res) { | ||
905 | case 0: | ||
901 | if (conf_write(NULL)) { | 906 | if (conf_write(NULL)) { |
902 | fprintf(stderr, _("\n\n" | 907 | fprintf(stderr, _("\n\n" |
903 | "Error during writing of the kernel configuration.\n" | 908 | "Error during writing of the kernel configuration.\n" |
@@ -905,11 +910,13 @@ int main(int ac, char **av) | |||
905 | "\n\n")); | 910 | "\n\n")); |
906 | return 1; | 911 | return 1; |
907 | } | 912 | } |
913 | case -1: | ||
908 | printf(_("\n\n" | 914 | printf(_("\n\n" |
909 | "*** End of Linux kernel configuration.\n" | 915 | "*** End of Linux kernel configuration.\n" |
910 | "*** Execute 'make' to build the kernel or try 'make help'." | 916 | "*** Execute 'make' to build the kernel or try 'make help'." |
911 | "\n\n")); | 917 | "\n\n")); |
912 | } else { | 918 | break; |
919 | default: | ||
913 | fprintf(stderr, _("\n\n" | 920 | fprintf(stderr, _("\n\n" |
914 | "Your kernel configuration changes were NOT saved." | 921 | "Your kernel configuration changes were NOT saved." |
915 | "\n\n")); | 922 | "\n\n")); |
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index f5628c57640b..8d60d99bd9f1 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -1585,7 +1585,7 @@ void ConfigMainWindow::showFullView(void) | |||
1585 | */ | 1585 | */ |
1586 | void ConfigMainWindow::closeEvent(QCloseEvent* e) | 1586 | void ConfigMainWindow::closeEvent(QCloseEvent* e) |
1587 | { | 1587 | { |
1588 | if (!sym_change_count) { | 1588 | if (!conf_get_changed()) { |
1589 | e->accept(); | 1589 | e->accept(); |
1590 | return; | 1590 | return; |
1591 | } | 1591 | } |