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 <judge.packham@gmail.com>
This commit is contained in:
Chris Packham 2020-12-09 22:22:43 +13:00
parent 21095fab67
commit d057ba5324
9 changed files with 17 additions and 28 deletions

View File

@ -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$@ $<

View File

@ -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:

View File

@ -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 {

View File

@ -15,7 +15,7 @@
#include <unistd.h>
#include "lkc.h"
#include "zconf.tab.h"
#include "parser.tab.h"
#define YY_DECL static int yylex1(void)

View File

@ -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 {

View File

@ -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) {

View File

@ -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

View File

@ -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],