From d057ba5324a082ba28d3b81f90405fae860bb376 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Wed, 9 Dec 2020 22:22:43 +1300 Subject: [PATCH] kconfig: Sync with upstream v5.1 This commit introduces the following upstream changes: 9c38f1f04408 kconfig/[mn]conf: handle backspace (^H) key c71bb9f86666 kconfig: remove stale lxdialog/.gitignore 8741908b3e29 kconfig: fix 'Save As' menu of xconfig 058507195b53 kbuild: move ".config not found!" message from Kconfig to Makefile 769a1c022678 kconfig: rename zconf.y to parser.y 981e545a698a kconfig: rename zconf.l to lexer.l Signed-off-by: Chris Packham --- kconfig/Makefile.am | 18 +++++++++--------- kconfig/conf.c | 13 ------------- kconfig/expr.h | 2 +- kconfig/{zconf.l => lexer.l} | 2 +- kconfig/lkc.h | 2 +- kconfig/lxdialog/inputbox.c | 3 ++- kconfig/nconf.c | 2 +- kconfig/nconf.gui.c | 3 ++- kconfig/{zconf.y => parser.y} | 0 9 files changed, 17 insertions(+), 28 deletions(-) rename kconfig/{zconf.l => lexer.l} (99%) rename kconfig/{zconf.y => parser.y} (100%) diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 82456060..2db26155 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -5,26 +5,26 @@ transform = s,x,x, pkglibexec_PROGRAMS = conf nconf mconf -EXTRA_DIST = zconf.y zconf.l \ +EXTRA_DIST = parser.y lexer.l \ expr.h list.h lkc.h lkc_proto.h nconf.h lxdialog/dialog.h \ confdata.c expr.c kconf_id.c menu.c symbol.c util.c -CLEANFILES = zconf.lex.c zconf.tab.c -BUILT_SOURCES = zconf.lex.c zconf.tab.c +CLEANFILES = lexer.lex.c parser.tab.c parser.tab.h +BUILT_SOURCES = lexer.lex.c parser.tab.c AM_LFLAGS = -L 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 zconf.lex.c zconf.tab.c +conf_SOURCES = conf.c confdata.c expr.c symbol.c preprocess.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 zconf.lex.c zconf.tab.c +nconf_SOURCES = nconf.c nconf.gui.c confdata.c expr.c symbol.c preprocess.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 zconf.lex.c zconf.tab.c \ +mconf_SOURCES = mconf.c confdata.c expr.c symbol.c preprocess.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 @@ -43,8 +43,8 @@ AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; -zconf.tab.c: zconf.y - $(AM_V_YACC)$(YACCCOMPILE) -o$@ --defines=zconf.tab.h $< +parser.tab.c: parser.y + $(AM_V_YACC)$(YACCCOMPILE) -o$@ --defines=parser.tab.h $< -zconf.lex.c: zconf.l +lexer.lex.c: lexer.l $(AM_V_LEX)$(LEXCOMPILE) -o$@ $< diff --git a/kconfig/conf.c b/kconfig/conf.c index b86c7de8..67e32197 100644 --- a/kconfig/conf.c +++ b/kconfig/conf.c @@ -468,7 +468,6 @@ int main(int ac, char **av) const char *progname = av[0]; int opt; const char *name, *defconfig_file = NULL /* gcc uninit */; - struct stat tmpstat; int no_conf_write = 0; tty_stdio = isatty(0) && isatty(1); @@ -540,18 +539,6 @@ int main(int ac, char **av) name = av[optind]; conf_parse(name); //zconfdump(stdout); - if (sync_kconfig) { - name = conf_get_configname(); - if (stat(name, &tmpstat)) { - fprintf(stderr, "***\n" - "*** Configuration file \"%s\" not found!\n" - "***\n" - "*** Please configure with \"menuconfig\", or use a\n" - "*** pre-existing sample (see list with \"list-samples\").\n" - "***\n", name); - exit(1); - } - } switch (input_mode) { case defconfig: diff --git a/kconfig/expr.h b/kconfig/expr.h index 999edb60..8dde65bc 100644 --- a/kconfig/expr.h +++ b/kconfig/expr.h @@ -172,7 +172,7 @@ struct symbol { * int "BAZ Value" * range 1..255 * - * Please, also check zconf.y:print_symbol() when modifying the + * Please, also check parser.y:print_symbol() when modifying the * list of property types! */ enum prop_type { diff --git a/kconfig/zconf.l b/kconfig/lexer.l similarity index 99% rename from kconfig/zconf.l rename to kconfig/lexer.l index b2d0a3b0..c9df1c8b 100644 --- a/kconfig/zconf.l +++ b/kconfig/lexer.l @@ -15,7 +15,7 @@ #include #include "lkc.h" -#include "zconf.tab.h" +#include "parser.tab.h" #define YY_DECL static int yylex1(void) diff --git a/kconfig/lkc.h b/kconfig/lkc.h index 531ff7c5..d871539e 100644 --- a/kconfig/lkc.h +++ b/kconfig/lkc.h @@ -90,7 +90,7 @@ void *xrealloc(void *p, size_t size); char *xstrdup(const char *s); char *xstrndup(const char *s, size_t n); -/* zconf.l */ +/* lexer.l */ int yylex(void); struct gstr { diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c index 61194561..1dcfb288 100644 --- a/kconfig/lxdialog/inputbox.c +++ b/kconfig/lxdialog/inputbox.c @@ -113,7 +113,8 @@ do_resize: case KEY_DOWN: break; case KEY_BACKSPACE: - case 127: + case 8: /* ^H */ + case 127: /* ^? */ if (pos) { wattrset(dialog, dlg.inputbox.atr); if (input_x == 0) { diff --git a/kconfig/nconf.c b/kconfig/nconf.c index fb6027af..96a6bac0 100644 --- a/kconfig/nconf.c +++ b/kconfig/nconf.c @@ -1051,7 +1051,7 @@ static int do_match(int key, struct match_state *state, int *ans) state->match_direction = FIND_NEXT_MATCH_UP; *ans = get_mext_match(state->pattern, state->match_direction); - } else if (key == KEY_BACKSPACE || key == 127) { + } else if (key == KEY_BACKSPACE || key == 8 || key == 127) { state->pattern[strlen(state->pattern)-1] = '\0'; adj_match_dir(&state->match_direction); } else diff --git a/kconfig/nconf.gui.c b/kconfig/nconf.gui.c index 7be620a1..77f525a8 100644 --- a/kconfig/nconf.gui.c +++ b/kconfig/nconf.gui.c @@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window, case KEY_F(F_EXIT): case KEY_F(F_BACK): break; - case 127: + case 8: /* ^H */ + case 127: /* ^? */ case KEY_BACKSPACE: if (cursor_position > 0) { memmove(&result[cursor_position-1], diff --git a/kconfig/zconf.y b/kconfig/parser.y similarity index 100% rename from kconfig/zconf.y rename to kconfig/parser.y