Commit d84876f9 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Sam Ravnborg

kconfig: allow overriding symbols

Allow config variables in .config to override earlier ones in the same
file. In other words,

	# CONFIG_SECURITY is not defined
	CONFIG_SECURITY=y

will activate it. This makes it a bit easier to do

cat original-config myconfig myconfig2 ... >.config;
and run *config as expected.
Signed-off-by: default avatarJan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
parent 09af091f
...@@ -232,8 +232,7 @@ int conf_read_simple(const char *name, int def) ...@@ -232,8 +232,7 @@ int conf_read_simple(const char *name, int def)
sym->type = S_BOOLEAN; sym->type = S_BOOLEAN;
} }
if (sym->flags & def_flags) { if (sym->flags & def_flags) {
conf_warning("trying to reassign symbol %s", sym->name); conf_warning("override: reassigning to symbol %s", sym->name);
break;
} }
switch (sym->type) { switch (sym->type) {
case S_BOOLEAN: case S_BOOLEAN:
...@@ -272,8 +271,7 @@ int conf_read_simple(const char *name, int def) ...@@ -272,8 +271,7 @@ int conf_read_simple(const char *name, int def)
sym->type = S_OTHER; sym->type = S_OTHER;
} }
if (sym->flags & def_flags) { if (sym->flags & def_flags) {
conf_warning("trying to reassign symbol %s", sym->name); conf_warning("override: reassigning to symbol %s", sym->name);
break;
} }
if (conf_set_sym_val(sym, def, def_flags, p)) if (conf_set_sym_val(sym, def, def_flags, p))
continue; continue;
...@@ -297,10 +295,8 @@ int conf_read_simple(const char *name, int def) ...@@ -297,10 +295,8 @@ int conf_read_simple(const char *name, int def)
} }
break; break;
case yes: case yes:
if (cs->def[def].tri != no) { if (cs->def[def].tri != no)
conf_warning("%s creates inconsistent choice state", sym->name); conf_warning("override: %s changes choice state", sym->name);
cs->flags &= ~def_flags;
} else
cs->def[def].val = sym; cs->def[def].val = sym;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment