summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/confdata.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-08 22:12:38 -0700
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-09 07:31:30 +0200
commitddc97cacb310ad68483952e67764c4153c138ed2 (patch)
treee54e75a17460b9852d061f0663a9058d61397c21 /scripts/kconfig/confdata.c
parent909252d279dd5d47e44c125558e87bb44097289f (diff)
downloadlinux-stable-ddc97cacb310ad68483952e67764c4153c138ed2.tar.gz
linux-stable-ddc97cacb310ad68483952e67764c4153c138ed2.tar.bz2
linux-stable-ddc97cacb310ad68483952e67764c4153c138ed2.zip
kconfig: improve config load/save output
During loading special case the first common case (.config), be silent about it and otherwise mark it as a change that requires saving. Instead output that the file has been changed. IOW if conf does nothing (special), it's silent. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r--scripts/kconfig/confdata.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 1b5df589f3ae..a9e3b6abf661 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -98,20 +98,28 @@ int conf_read_simple(const char *name)
in = zconf_fopen(name);
} else {
const char **names = conf_confnames;
+ name = *names++;
+ if (!name)
+ return 1;
+ in = zconf_fopen(name);
+ if (in)
+ goto load;
+ sym_change_count++;
while ((name = *names++)) {
name = conf_expand_value(name);
in = zconf_fopen(name);
if (in) {
printf(_("#\n"
- "# using defaults found in %s\n"
- "#\n"), name);
- break;
+ "# using defaults found in %s\n"
+ "#\n"), name);
+ goto load;
}
}
}
if (!in)
return 1;
+load:
conf_filename = name;
conf_lineno = 0;
conf_warnings = 0;
@@ -275,6 +283,8 @@ int conf_read(const char *name)
struct expr *e;
int i;
+ sym_change_count = 0;
+
if (conf_read_simple(name))
return 1;
@@ -325,7 +335,7 @@ int conf_read(const char *name)
sym->flags |= e->right.sym->flags & SYMBOL_NEW;
}
- sym_change_count = conf_warnings || conf_unsaved;
+ sym_change_count += conf_warnings || conf_unsaved;
return 0;
}
@@ -524,6 +534,10 @@ int conf_write(const char *name)
if (rename(newname, tmpname))
return 1;
+ printf(_("#\n"
+ "# configuration written to %s\n"
+ "#\n"), tmpname);
+
sym_change_count = 0;
return 0;