From 46a3c6c0091d979f0cf3e074d32b9d80590bd595 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 24 Sep 2014 11:30:41 -0700 Subject: [PATCH] app-shells/bash: sync ebuild and patches --- ...-4.2_p48.ebuild => bash-4.2_p48-r1.ebuild} | 90 +++++++++----- .../bash/files/bash-4.2-no-readline.patch | 19 +++ .../bash/files/bash-4.2-read-retry.patch | 41 +++++++ .../bash/files/bash-4.2-speed-up-read-N.patch | 112 ++++++++++++++++++ 4 files changed, 230 insertions(+), 32 deletions(-) rename sdk_container/src/third_party/coreos-overlay/app-shells/bash/{bash-4.2_p48.ebuild => bash-4.2_p48-r1.ebuild} (72%) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-no-readline.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-read-retry.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-speed-up-read-N.patch diff --git a/sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48.ebuild b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48-r1.ebuild similarity index 72% rename from sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48-r1.ebuild index dd4d1d0a91..06638f6889 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/bash-4.2_p48-r1.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p20.ebuild,v 1.10 2012/03/25 16:31:53 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p48.ebuild,v 1.1 2014/09/24 17:23:53 polynomial-c Exp $ -EAPI="1" +EAPI="4" inherit eutils flag-o-matic toolchain-funcs multilib @@ -34,15 +34,15 @@ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" LICENSE="GPL-3" SLOT="0" -KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla" +KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla" DEPEND=">=sys-libs/ncurses-5.2-r2 - >=sys-libs/readline-6.2 + readline? ( >=sys-libs/readline-6.2 ) nls? ( virtual/libintl )" RDEPEND="${DEPEND} - ! + ++#ifdef READLINE ++ + #include + + #include "../bashtypes.h" +@@ -867,3 +869,5 @@ compopt_builtin (list) + + return (ret); + } ++ ++#endif diff --git a/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-read-retry.patch b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-read-retry.patch new file mode 100644 index 0000000000..44903c68af --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-read-retry.patch @@ -0,0 +1,41 @@ +https://bugs.gentoo.org/447810 + +fix from upstream to workaround broken BSD kernels + +commit 208fdb509e072977ae7a621e916dfcd32c76047d +Author: Chet Ramey +Date: Mon Mar 4 08:09:29 2013 -0500 + + commit bash-20130201 snapshot + +diff --git a/redir.c b/redir.c +index d7da2f3..aa3d16d 100644 +--- a/redir.c ++++ b/redir.c +@@ -650,7 +650,7 @@ redir_open (filename, flags, mode, ri) + int flags, mode; + enum r_instruction ri; + { +- int fd, r; ++ int fd, r, e; + + r = find_string_in_alist (filename, _redir_special_filenames, 1); + if (r >= 0) +@@ -666,7 +666,16 @@ redir_open (filename, flags, mode, ri) + } + else + { +- fd = open (filename, flags, mode); ++ do ++ { ++ fd = open (filename, flags, mode); ++ e = errno; ++ if (fd < 0 && e == EINTR) ++ QUIT; ++ errno = e; ++ } ++ while (fd < 0 && errno == EINTR); ++ + #if defined (AFS) + if ((fd < 0) && (errno == EACCES)) + { diff --git a/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-speed-up-read-N.patch b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-speed-up-read-N.patch new file mode 100644 index 0000000000..b96ad0c887 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-shells/bash/files/bash-4.2-speed-up-read-N.patch @@ -0,0 +1,112 @@ +http://lists.gnu.org/archive/html/bug-bash/2012-11/msg00034.html + +From 530d4988afd68ea9d2cf1b0267d4dc821d0d204f Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Mon, 19 Nov 2012 17:58:51 -0500 +Subject: [PATCH] bash: speed up `read -N` + +Rather than using 1 byte reads, use the existing cache read logic. +This could be sped up more, but this change is not as invasive and +should (hopefully) be fairly safe. + +Signed-off-by: Mike Frysinger +--- + builtins/read.def | 21 ++++++++++++++++----- + externs.h | 1 + + lib/sh/zread.c | 15 +++++++++++++-- + 3 files changed, 30 insertions(+), 7 deletions(-) + +diff --git a/builtins/read.def b/builtins/read.def +index e32dec7..81a1b3f 100644 +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -457,7 +457,10 @@ read_builtin (list) + interrupt_immediately++; + terminate_immediately++; + +- unbuffered_read = (nchars > 0) || (delim != '\n') || input_is_pipe; ++ if ((nchars > 0) && !input_is_tty && ignore_delim) ++ unbuffered_read = 2; ++ else if ((nchars > 0) || (delim != '\n') || input_is_pipe) ++ unbuffered_read = 1; + + if (prompt && edit == 0) + { +@@ -505,10 +508,18 @@ read_builtin (list) + print_ps2 = 0; + } + +- if (unbuffered_read) +- retval = zread (fd, &c, 1); +- else +- retval = zreadc (fd, &c); ++ switch (unbuffered_read) ++ { ++ case 2: ++ retval = zreadcn (fd, &c, nchars - nr); ++ break; ++ case 1: ++ retval = zread (fd, &c, 1); ++ break; ++ default: ++ retval = zreadc (fd, &c); ++ break; ++ } + + if (retval <= 0) + { +diff --git a/externs.h b/externs.h +index 09244fa..a5ad645 100644 +--- a/externs.h ++++ b/externs.h +@@ -479,6 +479,7 @@ extern ssize_t zread __P((int, char *, size_t)); + extern ssize_t zreadretry __P((int, char *, size_t)); + extern ssize_t zreadintr __P((int, char *, size_t)); + extern ssize_t zreadc __P((int, char *)); ++extern ssize_t zreadcn __P((int, char *, int)); + extern ssize_t zreadcintr __P((int, char *)); + extern void zreset __P((void)); + extern void zsyncfd __P((int)); +diff --git a/lib/sh/zread.c b/lib/sh/zread.c +index 5db21a9..af7d02b 100644 +--- a/lib/sh/zread.c ++++ b/lib/sh/zread.c +@@ -101,15 +101,18 @@ static char lbuf[128]; + static size_t lind, lused; + + ssize_t +-zreadc (fd, cp) ++zreadcn (fd, cp, len) + int fd; + char *cp; ++ int len; + { + ssize_t nr; + + if (lind == lused || lused == 0) + { +- nr = zread (fd, lbuf, sizeof (lbuf)); ++ if (len > sizeof (lbuf)) ++ len = sizeof (lbuf); ++ nr = zread (fd, lbuf, len); + lind = 0; + if (nr <= 0) + { +@@ -123,6 +126,14 @@ zreadc (fd, cp) + return 1; + } + ++ssize_t ++zreadc (fd, cp) ++ int fd; ++ char *cp; ++{ ++ return zreadcn (fd, cp, sizeof (lbuf)); ++} ++ + /* Don't mix calls to zreadc and zreadcintr in the same function, since they + use the same local buffer. */ + ssize_t +-- +1.7.12.4 +