summaryrefslogtreecommitdiff
path: root/app-shells/zsh/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-11-27 01:15:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-11-27 01:15:54 +0000
commit4b5a61a22263bba1a5119af1b9b61f80517d02fd (patch)
tree7acb10c8fed343782088865ecd16bd3efe268ad7 /app-shells/zsh/files
parentb3e456d42287ef73c7ff48148d18a9ea8fb8debf (diff)
gentoo auto-resync : 27:11:2022 - 01:15:53
Diffstat (limited to 'app-shells/zsh/files')
-rw-r--r--app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch76
-rw-r--r--app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch139
2 files changed, 0 insertions, 215 deletions
diff --git a/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch b/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch
deleted file mode 100644
index 6e202fa2fb24..000000000000
--- a/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From da8be06c2062ea02795bcba25172369ec68848cf Mon Sep 17 00:00:00 2001
-From: Peter Stephenson <p.w.stephenson@ntlworld.com>
-Date: Thu, 3 Mar 2022 19:19:35 +0000
-Subject: [PATCH] 49792: Non-interative shell input is line buffered.
-
----
- ChangeLog | 5 +++++
- Src/input.c | 21 ++++++++++++++-------
- Test/A01grammar.ztst | 9 +++++++++
- 3 files changed, 28 insertions(+), 7 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 8a5ad4941..cae2fc4e3 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,8 @@
-+2022-03-03 Peter Stephenson <p.w.stephenson@ntlworld.com>
-+
-+ * 49792: Src/input.c, Test/A01grammar.ztst: Use line buffering
-+ for non-interactive input.
-+
- 2022-02-12 dana <dana@dana.is>
-
- * unposted: Config/version.mk, Etc/FAQ.yo, README: Update
-diff --git a/Src/input.c b/Src/input.c
-index 18228b37d..caa8e23b0 100644
---- a/Src/input.c
-+++ b/Src/input.c
-@@ -223,13 +223,20 @@ shingetchar(void)
- return STOUC(*shinbufptr++);
-
- shinbufreset();
-- do {
-- errno = 0;
-- nread = read(SHIN, shinbuffer, SHINBUFSIZE);
-- } while (nread < 0 && errno == EINTR);
-- if (nread <= 0)
-- return -1;
-- shinbufendptr = shinbuffer + nread;
-+ for (;;) {
-+ errno = 0;
-+ nread = read(SHIN, shinbufendptr, 1);
-+ if (nread > 0) {
-+ /* Use line buffering (POSIX requirement) */
-+ if (*shinbufendptr++ == '\n')
-+ break;
-+ if (shinbufendptr == shinbuffer + SHINBUFSIZE)
-+ break;
-+ } else if (nread == 0 || errno != EINTR)
-+ break;
-+ }
-+ if (shinbufendptr == shinbuffer)
-+ return -1;
- return STOUC(*shinbufptr++);
- }
-
-diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
-index 1e0e9a04e..adbf5f1d9 100644
---- a/Test/A01grammar.ztst
-+++ b/Test/A01grammar.ztst
-@@ -932,3 +932,12 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci
- $ZTST_testdir/../Src/zsh -fc '{ ( ) } always { echo foo }'
- -f:exec last command optimization inhibited for try/always
- >foo
-+
-+ (
-+ export VALUE=first
-+ print -l 'echo Value is $VALUE' 'VALUE=second sh' 'echo Value is $VALUE' |
-+ $ZTST_testdir/../Src/zsh -f
-+ )
-+0:Non-interactive shell command input is line buffered
-+>Value is first
-+>Value is second
---
-2.36.0.rc2
-
diff --git a/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch b/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch
deleted file mode 100644
index 14a3f38eb96d..000000000000
--- a/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From cbe8d2bcdc20682464217856aa48628804637f28 Mon Sep 17 00:00:00 2001
-From: Bart Schaefer <schaefer@zsh.org>
-Date: Thu, 28 Apr 2022 21:06:51 -0700
-Subject: [PATCH] 50133: use read-ahead and lseek-rewind for efficient
- line-buffered input
-
----
- ChangeLog | 6 ++++++
- Src/input.c | 24 ++++++++++++++++++++-
- configure.ac | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 88 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index cae2fc4e3..79c77741b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,9 @@
-+2022-04-28 Bart Schaefer <schaefer@zsh.org>
-+
-+ * 50133 (Bart, PWS, Jun-ichi): Src/input.c, configure.ac: when
-+ lseek(2) is available, use it to check for and rewind read-ahead
-+ for more efficient line-buffered input.
-+
- 2022-03-03 Peter Stephenson <p.w.stephenson@ntlworld.com>
-
- * 49792: Src/input.c, Test/A01grammar.ztst: Use line buffering
-diff --git a/Src/input.c b/Src/input.c
-index caa8e23b0..6cc1b8a51 100644
---- a/Src/input.c
-+++ b/Src/input.c
-@@ -217,12 +217,34 @@ shinbufrestore(void)
- static int
- shingetchar(void)
- {
-- int nread;
-+ int nread, rsize = isset(SHINSTDIN) ? 1 : SHINBUFSIZE;
-
- if (shinbufptr < shinbufendptr)
- return STOUC(*shinbufptr++);
-
- shinbufreset();
-+#ifdef USE_LSEEK
-+ if (rsize == 1 && lseek(SHIN, 0, SEEK_CUR) != (off_t)-1)
-+ rsize = SHINBUFSIZE;
-+ if (rsize > 1) {
-+ do {
-+ errno = 0;
-+ nread = read(SHIN, shinbuffer, rsize);
-+ } while (nread < 0 && errno == EINTR);
-+ if (nread <= 0)
-+ return -1;
-+ if (isset(SHINSTDIN) &&
-+ (shinbufendptr = memchr(shinbuffer, '\n', nread))) {
-+ shinbufendptr++;
-+ rsize = (shinbufendptr - shinbuffer);
-+ if (nread > rsize &&
-+ lseek(SHIN, -(nread - rsize), SEEK_CUR) < 0)
-+ zerr("lseek(%d, %d): %e", SHIN, -(nread - rsize), errno);
-+ } else
-+ shinbufendptr = shinbuffer + nread;
-+ return STOUC(*shinbufptr++);
-+ }
-+#endif
- for (;;) {
- errno = 0;
- nread = read(SHIN, shinbufendptr, 1);
-diff --git a/configure.ac b/configure.ac
-index af8c5bba8..42f2837cd 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2304,6 +2304,65 @@ if test x$zsh_cv_sys_fifo = xyes; then
- AC_DEFINE(HAVE_FIFOS)
- fi
-
-+dnl -----------
-+dnl check that lseek() correctly reports seekability.
-+dnl -----------
-+AC_CACHE_CHECK(if lseek() correctly reports seekability,
-+zsh_cv_sys_lseek,
-+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
-+#include <stdio.h>
-+#include <sys/types.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <sys/socket.h>
-+#include <sys/stat.h>
-+int main() {
-+ int pipefd[2], fd;
-+ off_t ret;
-+ char* tmpfile = "seekfiletest.tmp";
-+ if ((fd = open(tmpfile, O_CREAT, S_IRUSR)) < 0) {
-+ fprintf(stderr, "creating file failed\n");
-+ return 1;
-+ }
-+ ret = lseek(fd, 0, SEEK_CUR);
-+ close(fd);
-+ unlink(tmpfile);
-+ if (ret == (off_t)-1) {
-+ fprintf(stderr, "lseek on regular file failed\n");
-+ return 1;
-+ }
-+ if (pipe(pipefd) < 0) {
-+ fprintf(stderr, "creating pipe failed\n");
-+ return 1;
-+ }
-+ write(pipefd[1], "abcdefgh", 8);
-+ ret = lseek(pipefd[0], 0, SEEK_CUR);
-+ close(pipefd[0]);
-+ close(pipefd[1]);
-+ if (ret != (off_t)-1) {
-+ fprintf(stderr, "lseek on pipe succeeded\n");
-+ return 1;
-+ }
-+ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
-+ fprintf(stderr, "creating UNIX domain socket failed\n");
-+ return 1;
-+ }
-+ ret = lseek(fd, 0, SEEK_CUR);
-+ close(fd);
-+ if (ret != (off_t)-1) {
-+ fprintf(stderr, "lseek on UNIX domain socket succeeded\n");
-+ return 1;
-+ }
-+ return 0;
-+}
-+]])],[zsh_cv_sys_lseek=yes],[zsh_cv_sys_lseek=no],[zsh_cv_sys_lseek=yes])
-+])
-+AH_TEMPLATE([USE_LSEEK],
-+[Define to 1 if lseek() can be used for SHIN.])
-+if test x$zsh_cv_sys_lseek = xyes; then
-+ AC_DEFINE(USE_LSEEK)
-+fi
-+
- dnl -----------
- dnl test for whether link() works
- dnl for instance, BeOS R4.51 doesn't support hard links yet
---
-2.36.0
-