summaryrefslogtreecommitdiff
path: root/kconfig/confdata.c
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2020-12-09 08:24:45 (GMT)
committerChris Packham <judge.packham@gmail.com>2021-02-02 07:06:32 (GMT)
commitbbc4db133746d49893c3c9b70ef710747df27441 (patch)
tree6bd2bd5cc2970f7c896841939ce834754f678c3f /kconfig/confdata.c
parent689dc60f212db105243b60290480f29475578e0d (diff)
kconfig: Sync with upstream v4.18
This commit introduces the following upstream changes: 73d1c580f92b kconfig: loop boundary condition fix ecd53ac2f2c6 kconfig: handle P_SYMBOL in print_symbol() b2d00d7c61c8 kconfig: fix line numbers for if-entries in menu tree 8593080c0fcf kconfig: fix localmodconfig 2ae89c7a82ea kconfig: Avoid format overflow warning from GCC 8.1 bb6d83dde191 kbuild: Move last word of nconfig help to the previous line d6a0c8a1326b kconfig: Add testconfig into make help output 2bece88f89fa kconfig: test: add Kconfig macro language tests 915f64901eb3 kconfig: error out if a recursive variable references itself a702a6176e2f kconfig: add 'filename' and 'lineno' built-in variables 1d6272e6fe43 kconfig: add 'info', 'warning-if', and 'error-if' built-in functions 82bc8bd82e5c kconfig: expand lefthand side of assignment statement ed2a22f277c6 kconfig: support append assignment operator 1175c02506ff kconfig: support simply expanded variable 9ced3bddec08 kconfig: support user-defined function and recursively expanded variable 9de071536c87 kconfig: begin PARAM state only when seeing a command keyword 2fd5b09c201e kconfig: add 'shell' built-in function e298f3b49def kconfig: add built-in function support 137c0118a900 kconfig: make default prompt of mainmenu less specific 5b31a9746756 kconfig: remove sym_expand_string_value() 96d8e48da55a kconfig: remove string expansion for mainmenu after yyparse() bb222ceeb327 kconfig: remove string expansion in file_lookup() 104daea149c4 kconfig: reference environment variables directly and remove 'option env=' 694c49a7c01c kconfig: drop localization support 1c5af5cf9308 kconfig: refactor ncurses package checks for building mconf and nconf b464ef583dc7 kconfig: refactor GTK+ package checks for building gconf 0b669a5076fd kconfig: refactor Qt package checks for building qconf Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'kconfig/confdata.c')
-rw-r--r--kconfig/confdata.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/kconfig/confdata.c b/kconfig/confdata.c
index df26c7b..39e2097 100644
--- a/kconfig/confdata.c
+++ b/kconfig/confdata.c
@@ -30,7 +30,7 @@ static void conf_message(const char *fmt, ...)
static const char *conf_filename;
static int conf_lineno, conf_warnings;
-const char conf_defname[] = "arch/$ARCH/defconfig";
+const char conf_defname[] = "arch/$(ARCH)/defconfig";
static void conf_warning(const char *fmt, ...)
{
@@ -81,39 +81,13 @@ const char *conf_get_autoconfig_name(void)
return name ? name : "include/config/auto.conf";
}
-static char *conf_expand_value(const char *in)
-{
- struct symbol *sym;
- const char *src;
- static char res_value[SYMBOL_MAXLENGTH];
- char *dst, name[SYMBOL_MAXLENGTH];
-
- res_value[0] = 0;
- dst = name;
- while ((src = strchr(in, '$'))) {
- strncat(res_value, in, src - in);
- src++;
- dst = name;
- while (isalnum(*src) || *src == '_')
- *dst++ = *src++;
- *dst = 0;
- sym = sym_lookup(name, 0);
- sym_calc_value(sym);
- strcat(res_value, sym_get_string_value(sym));
- in = src;
- }
- strcat(res_value, in);
-
- return res_value;
-}
-
char *conf_get_default_confname(void)
{
struct stat buf;
static char fullname[PATH_MAX+1];
char *env, *name;
- name = conf_expand_value(conf_defname);
+ name = expand_string(conf_defname);
env = getenv(SRCTREE);
if (env) {
sprintf(fullname, "%s/%s", env, name);
@@ -274,10 +248,11 @@ int conf_read_simple(const char *name, int def)
if (expr_calc_value(prop->visible.expr) == no ||
prop->expr->type != E_SYMBOL)
continue;
- name = conf_expand_value(prop->expr->left.sym->name);
+ sym_calc_value(prop->expr->left.sym);
+ name = sym_get_string_value(prop->expr->left.sym);
in = zconf_fopen(name);
if (in) {
- conf_message(_("using defaults found in %s"),
+ conf_message("using defaults found in %s",
name);
goto load;
}
@@ -745,7 +720,7 @@ int conf_write(const char *name)
struct menu *menu;
const char *basename;
const char *str;
- char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
+ char dirname[PATH_MAX+1], tmpname[PATH_MAX+22], newname[PATH_MAX+8];
char *env;
dirname[0] = 0;
@@ -831,7 +806,7 @@ next:
return 1;
}
- conf_message(_("configuration written to %s"), newname);
+ conf_message("configuration written to %s", newname);
sym_set_change_count(0);