From patchwork Sat Nov 19 14:40:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 6141 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4NDxCd4BcMz3wgd for ; Sat, 19 Nov 2022 14:40:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NDxCc6Q7Tz1KB; Sat, 19 Nov 2022 14:40:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NDxCc5cwLz2yWM; Sat, 19 Nov 2022 14:40:44 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4NDxCb5wfgz2xGV for ; Sat, 19 Nov 2022 14:40:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4NDxCb2sTrzdN; Sat, 19 Nov 2022 14:40:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1668868843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xcqozA+QaA9gYYb7cSB+4nba57kuizsMwE4FHOT51DY=; b=KWobMMJUjwJFsoTHdn6LVNxKkhM19mW7Hk4YVZc51fYIIITlKAZneyfHcMPUUkidDn/jf9 y0m0hhXYcNV2UZDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1668868843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xcqozA+QaA9gYYb7cSB+4nba57kuizsMwE4FHOT51DY=; b=efMnC0YQrMsz+tGk3XDgI1KUwpFvkUUz+C81fSaB+2xbwHa+/Tj0mBcp/sewM7N3hWkHDS SBmQjaFzpM3AGXhUAG/j8vEoAyCfcBXR2zzM5MVEN+oZ0w+CGpauqBQ4EwCzBN8vgQBYJc gmqnFUrAghnmMAwQDMgy6rDCfpxY81Ubuuvxdvjtk4JOi7BJIxwIQyokFM4KUV1d+FoB5M ZJ8jdW7jIH1Y+r6cZLxN8W5GvvxzsO2+lx1eH4FCP35BiLKyD+ixVj66Vrw3prtwSFzGHW mdhL6RJwo5m4ZylVYwe6FPM3/VhAaBxtrusrvJ68wSzbBMAWGQqVcC20iUMulg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 1/2] readline: Update to version 8.2 plus patch 1 Date: Sat, 19 Nov 2022 15:40:34 +0100 Message-Id: <20221119144035.382952-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Update from version 8.1 to 8.2 plus patch 1 - Update of rootfile - Changelog version 8.2 There is a new framework for readline timeouts, including new public functions to set timeouts and query how much time is remaining before a timeout hits, and a hook function that can trigger when readline times out. There is a new state value to indicate a timeout. There is a new option: `enable-active-region'. This separates control of the active region and bracketed-paste. It has the same default value as bracketed-paste, and enabling bracketed paste enables the active region. Users can now turn off the active region while leaving bracketed paste enabled. Two new bindable string variables are available; their values are terminal escape sequences that set the color used to display the active region and turn it off, respectively. If set, these are used in place of terminal standout mode. Finally, Readline now checks for changes to locale settings (LC_ALL/LC_CTYPE/LANG) each time it is called, and modifies the appropriate locale-specific display and key binding variables when the locale changes. There are a few bug fixes in the redisplay code when restoring the prompt after a digit-argument prompt or incremental search back to a prompt that contains invisible multibyte characters. There are more checks for read errors, especially in the middle of readline commands; previous versions could loop or return incorrect data. Full details are below. GNU Readline is a library which provides programs with an input facility including command-line editing and history. Editing commands similar to both emacs and vi are included. The GNU History library, which provides facilities for managing a list of previously-typed command lines and an interactive command line recall facility similar to that provided by csh, is also present. The history library is built as part of the readline as well as separately. 1. Changes to Readline a. Fixed a problem with cleaning up active marks when using callback mode. b. Fixed a problem with arithmetic comparison operators checking the version. c. Fixed a problem that could cause readline not to build on systems without POSIX signal functions. d. Fixed a bug that could cause readline to crash if the application removed the callback line handler before readline read all typeahead. e. Added additional checks for read errors in the middle of readline commands. f. Fixed a redisplay problem that occurred when switching from the digit- argument prompt `(arg: N)' back to the regular prompt and the regular prompt contained invisible characters. g. Fixed a problem with restoring the prompt when aborting an incremental search. h. Fix a problem with characters > 128 not being displayed correctly in certain single-byte encodings. i. Fixed a problem with unix-filename-rubout that caused it to delete too much when applied to a pathname consisting only of one or more slashes. j. Fixed a display problem that caused the prompt to be wrapped incorrectly if the screen changed dimensions during a call to readline() and the prompt became longer than the screen width. k. Fixed a problem that caused the \r output by turning off bracketed paste to overwrite the line if terminal echo was disabled. l. Fixed a bug that could cause colored-completion-prefix to not display if completion-prefix-display-length was set. m. Fixed a problem with line wrapping prompts when a group of invisible characters runs to the right edge of the screen and the prompt extends longer then the screen width. n. Fixed a couple problems that could cause rl_end to be set incorrectly by transpose-words. o. Prevent some display problems when running a command as the result of a trap or one bound using `bind -x' and the command generates output. p. Fixed an issue with multi-line prompt strings that have one or more invisible characters at the end of a physical line. q. Fixed an issue that caused a history line's undo list to be cleared when it should not have been. r. When replacing a history entry, make sure the existing entry has a non-NULL timestamp before copying it; it may have been added by the application, not the history library. 2. New Features in Readline a. There is now an HS_HISTORY_VERSION containing the version number of the history library for applications to use. b. History expansion better understands multiple history expansions that may contain strings that would ordinarily inhibit history expansion (e.g., `abc!$!$'). c. There is a new framework for readline timeouts, including new public functions to set timeouts and query how much time is remaining before a timeout hits, and a hook function that can trigger when readline times out. There is a new state value to indicate a timeout. d. Automatically bind termcap key sequences for page-up and page-down to history-search-backward and history-search-forward, respectively. e. There is a new `fetch-history' bindable command that retrieves the history entry corresponding to its numeric argument. Negative arguments count back from the end of the history. f. `vi-undo' is now a bindable command. g. There is a new option: `enable-active-region'. This separates control of the active region and bracketed-paste. It has the same default value as bracketed-paste, and enabling bracketed paste enables the active region. Users can now turn off the active region while leaving bracketed paste enabled. h. rl_completer_word_break_characters is now `const char *' like rl_basic_word_break_characters. i. Readline looks in $LS_COLORS for a custom filename extension (*.readline-colored-completion-prefix) and uses that as the default color for the common prefix displayed when `colored-completion-prefix' is set. j. Two new bindable string variables: active-region-start-color and active-region-end-color. The first sets the color used to display the active region; the second turns it off. If set, these are used in place of terminal standout mode. k. New readline state (RL_STATE_EOF) and application-visible variable (rl_eof_found) to allow applications to detect when readline reads EOF before calling the deprep-terminal hook. l. There is a new configuration option: --with-shared-termcap-library, which forces linking the shared readline library with the shared termcap (or curses/ncurses/termlib) library so applications don't have to do it. m. Readline now checks for changes to locale settings (LC_ALL/LC_CTYPE/LANG) each time it is called, and modifies the appropriate locale-specific display and key binding variables when the locale changes. Signed-off-by: Adolf Belka Reviewed-by: Michael Tremer --- config/rootfiles/common/readline | 5 ++-- lfs/readline | 10 +++---- src/patches/readline/readline82-001 | 42 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 src/patches/readline/readline82-001 diff --git a/config/rootfiles/common/readline b/config/rootfiles/common/readline index 31eab5298..834a7046f 100644 --- a/config/rootfiles/common/readline +++ b/config/rootfiles/common/readline @@ -9,10 +9,11 @@ #usr/include/readline/tilde.h #usr/lib/libhistory.so usr/lib/libhistory.so.8 -usr/lib/libhistory.so.8.1 +usr/lib/libhistory.so.8.2 #usr/lib/libreadline.so usr/lib/libreadline.so.8 -usr/lib/libreadline.so.8.1 +usr/lib/libreadline.so.8.2 +#usr/lib/pkgconfig/history.pc #usr/lib/pkgconfig/readline.pc #usr/share/doc/readline #usr/share/doc/readline/CHANGES diff --git a/lfs/readline b/lfs/readline index b899d6ebb..ef083a60c 100644 --- a/lfs/readline +++ b/lfs/readline @@ -24,7 +24,7 @@ include Config -VER = 8.1 +VER = 8.2 THISAPP = readline-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -40,7 +40,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_BLAKE2 = f0feca1ea3517b2b613adacac8c997cce0e86aa2f410c82a40ce1a2e128067112b4c68dbf25b808291c28c47583345abac994ce10b8d117958afcb96ee5e7c69 +$(DL_FILE)_BLAKE2 = 7974322b9c092a756a79e537df08e8532f8e0fcb598f77732e28287c33ebec9e9837ed88b43334c310892d56a871b423903f0f564def2fbe700a1004f2ae7b18 install : $(TARGET) @@ -71,9 +71,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) -# for i in $$(seq 1 1); do \ -# cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/readline/readline81-$$(printf "%03d" "$${i}") || exit 1; \ -# done + for i in $$(seq 1 1); do \ + cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/readline/readline82-$$(printf "%03d" "$${i}") || exit 1; \ + done cd $(DIR_APP) && ./configure --prefix=/usr --disable-static cd $(DIR_APP) && make $(MAKETUNING) SHLIB_LIBS=-lncurses diff --git a/src/patches/readline/readline82-001 b/src/patches/readline/readline82-001 new file mode 100644 index 000000000..a13ff4285 --- /dev/null +++ b/src/patches/readline/readline82-001 @@ -0,0 +1,42 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.2 +Patch-ID: readline82-001 + +Bug-Reported-by: Kan-Ru Chen +Bug-Reference-ID: +Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109 + +Bug-Description: + +Starting a readline application with an invalid locale specification for +LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline. + +Patch (apply with `patch -p0'): + +*** ../readline-8.2-patched/nls.c 2022-08-15 09:38:51.000000000 -0400 +--- nls.c 2022-10-05 09:23:22.000000000 -0400 +*************** +*** 142,145 **** +--- 142,149 ---- + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; + #else + ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec; + +*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2014-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 0 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 1