From acce58834d83602b5c97cb01f04c9f540e40792b Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 10 Dec 2020 19:51:50 +1300 Subject: kconfig: Sync with upstream v5.5 This commit introduces the following upstream changes: 272a72103012 kconfig: don't crash on NULL expressions in expr_eq() 46b2afa6890d kconfig: be more helpful if pkg-config is missing 5d8b42aa7ccb kconfig: Add option to get the full help text with listnewconfig a64c0440dda1 kbuild: Wrap long "make help" text lines 521b29b6ff53 kconfig: split util.c out of parser.y 60bef52c7a68 merge_config.sh: ignore unwanted grep errors 54b8ae66ae1a kbuild: change *FLAGS_.o to take the path relative to $(obj) 1634f2bfdb84 kbuild: remove clean-dirs syntax cdfca821571d merge_config.sh: Check error codes from make Signed-off-by: Chris Packham diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 2db2615..a6d47fc 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -17,14 +17,14 @@ AM_YFLAGS = -t -l AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\" AM_LIBTOOLFLAGS = --tag CC -conf_SOURCES = conf.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c +conf_SOURCES = conf.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c conf_LDADD = $(LIBINTL) -nconf_SOURCES = nconf.c nconf.gui.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c +nconf_SOURCES = nconf.c nconf.gui.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c nconf_CFLAGS = $(CURSES_CFLAGS) nconf_LDADD = $(MENU_LIBS) $(PANEL_LIBS) $(CURSES_LIBS) $(LIBINTL) -mconf_SOURCES = mconf.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c \ +mconf_SOURCES = mconf.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c \ lxdialog/checklist.c lxdialog/inputbox.c \ lxdialog/menubox.c lxdialog/textbox.c lxdialog/util.c \ lxdialog/yesno.c diff --git a/kconfig/conf.c b/kconfig/conf.c index dd714b4..393e96e 100644 --- a/kconfig/conf.c +++ b/kconfig/conf.c @@ -32,6 +32,7 @@ enum input_mode { defconfig, savedefconfig, listnewconfig, + helpnewconfig, olddefconfig, }; static enum input_mode input_mode = oldaskconfig; @@ -434,6 +435,11 @@ static void check_conf(struct menu *menu) printf("%s%s=%s\n", CONFIG_, sym->name, str); } } + } else if (input_mode == helpnewconfig) { + printf("-----\n"); + print_help(menu); + printf("-----\n"); + } else { if (!conf_cnt++) printf("*\n* Restart config...\n*\n"); @@ -459,6 +465,7 @@ static struct option long_opts[] = { {"alldefconfig", no_argument, NULL, alldefconfig}, {"randconfig", no_argument, NULL, randconfig}, {"listnewconfig", no_argument, NULL, listnewconfig}, + {"helpnewconfig", no_argument, NULL, helpnewconfig}, {"olddefconfig", no_argument, NULL, olddefconfig}, {NULL, 0, NULL, 0} }; @@ -523,6 +530,7 @@ int main(int ac, char **av) case allmodconfig: case alldefconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: break; case '?': @@ -556,6 +564,7 @@ int main(int ac, char **av) case oldaskconfig: case oldconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: conf_read(NULL); break; @@ -637,6 +646,7 @@ int main(int ac, char **av) /* fall through */ case oldconfig: case listnewconfig: + case helpnewconfig: case syncconfig: /* Update until a loop caused no more changes */ do { @@ -655,7 +665,7 @@ int main(int ac, char **av) defconfig_file); return 1; } - } else if (input_mode != listnewconfig) { + } else if (input_mode != listnewconfig && input_mode != helpnewconfig) { if (!no_conf_write && conf_write(NULL)) { fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); exit(1); diff --git a/kconfig/expr.c b/kconfig/expr.c index 77ffff3..9f1de58 100644 --- a/kconfig/expr.c +++ b/kconfig/expr.c @@ -254,6 +254,13 @@ static int expr_eq(struct expr *e1, struct expr *e2) { int res, old_count; + /* + * A NULL expr is taken to be yes, but there's also a different way to + * represent yes. expr_is_yes() checks for either representation. + */ + if (!e1 || !e2) + return expr_is_yes(e1) && expr_is_yes(e2); + if (e1->type != e2->type) return 0; switch (e1->type) { diff --git a/kconfig/parser.y b/kconfig/parser.y index 60936c7..b3eff96 100644 --- a/kconfig/parser.y +++ b/kconfig/parser.y @@ -727,5 +727,4 @@ void zconfdump(FILE *out) } } -#include "util.c" #include "menu.c" -- cgit v0.10.2-6-g49f6