public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2015-10-15 16:22 Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2015-10-15 16:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ddaf81a7290379428e088226b8bd58c569b0244c
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 15 16:20:28 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Oct 15 16:20:40 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddaf81a7

app-shells/bash: version bump to 4.4_beta

 app-shells/bash/Manifest                                 |  2 +-
 .../{bash-4.4_alpha-r1.ebuild => bash-4.4_beta.ebuild}   | 10 ++++------
 app-shells/bash/files/bash-4.4-optimize-fork.patch       | 16 ----------------
 3 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index b5e0f93..c9f8bfd 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -6,7 +6,7 @@ DIST bash-4.0.tar.gz 6230779 SHA256 9793d394f640a95030c77d5ac989724afe196921956d
 DIST bash-4.1.tar.gz 6598300 SHA256 3f627124a83c6d34db503a923e20710d370573a29dd5d11d6f116d1aee7be1da SHA512 2f2a053d98be9a31cd089e1293e3369ad05406f6543d1d1662d8b5807fdcfebc1dda79db9bf2c596a6351ea463fb9bd9c8943c1d45da9b82f2fd3bab0b8a581a WHIRLPOOL 0259149d6f0d8f8a19e4b5a88e127c55efae0df4459063295aa6a9de69450b5f4b4b579894e4410ddfc0119eeb0356865b7cc4dbc7e4a75ad98acce0dfe2d46f
 DIST bash-4.2.tar.gz 7009201 SHA256 a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8 SHA512 fdd3c230f4f7a687d36db1b8f7baab5e553cf55756e2d49a88ffaa4260c8cb949897dec9f48655e96608ef0093ac101b60c132060f06c711c0ab81aa3f148b5c WHIRLPOOL fd5f321a8a89381904b1dd1f5acb5100186ce48cccc9b248cf68b35a1c1932177df1fc2b0215131999ee6018decf3264c45e54d407bf4b74ff8e4cc8215c630a
 DIST bash-4.3.tar.gz 7955839 SHA256 afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4 SHA512 a852b8e46ee55568dce9d23a30a9dbd1c770c2d2a4bc91e1c3177d723b31b32c5d69d19704a93f165891b409b9dd2cc65723372044e2bd0ee49ed59a11512651 WHIRLPOOL d82eb296b1bdee517b20e40d2231697dc41e2040d34e2da24c4fa40755c723d732929805ebef6f6923cd8ffecfb0db7063ec1dc3ab4e695a93916f2d872e236f
-DIST bash-4.4-alpha.tar.gz 8388940 SHA256 a074952a3f9dc2237d073c33f809c87b735795dd4eec4dcfb0debec3624eb776 SHA512 cc3b79af35c8bb32e95241234145a258a87a8b99664c372a60fd78f188f7a468fd39da5f3e4a682a046c0a8bb00e979b1b1634f368157b1077832af4ba693e40 WHIRLPOOL 9c02bbddcfb0e55b0f5ce62ad9da8e82cfe1b4bdc7c1adb82b8e37fc902fdf5b6eda05194023ed7e48f57647e280e3f74c88702fb1abad5fa459d6c9668c9b87
+DIST bash-4.4-beta.tar.gz 8568112 SHA256 8273c415b70260baaf7a9fdc9632451cd3987718fd054ee7ee13d7613808d231 SHA512 b08f56cae711490fa306edeae1043c168a09bf7ff53b7f86c22b426d4dd4498599e8739a999efb5782dccf2fa7d0d38030707e0b67f7cb6135893d77c54a2c87 WHIRLPOOL 23de236064b3691d94370ad8ff70a80b2648ba16d89a79cf224291425b83246fd0edd122e51ccf158ffa7e78738fe0df0894a906106dd59137bdfa28a79d4816
 DIST bash205b-001 1132 SHA256 bf7a055e0916b7899e7429e36e35d009db445b942b34520a601ea5a8fa634fdd SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071 WHIRLPOOL 90ba36843bbf2e0b7279d3bd197ddaa04e03e113be32051e5a77280cda6d43dcbf339780c57322fc0835a54c82e0095f0d3f2a13f13fec8c0b8da38e7e9b253a
 DIST bash205b-002 755 SHA256 affdd1808a6262fbfe291ebffa2133b05e4bb46067a90e3329d5741e10f0587b SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883 WHIRLPOOL 7333910e98e517306077937881d4c5569ddd85552203b3ec833f0fda13822e388ce85f007d60e4ab4b1ef15abb66fa40dc4356ca01367463d179a6a23bcff8e7
 DIST bash205b-003 2356 SHA256 604972eaafe69f44413d429e0a826b0eae209ca74b14eeeccdf0d502bbabb340 SHA512 74528ca5d165b812d299f1c69b47757bd677c0b22ce4217e155cd641708b02364a93c6709fb57b546b376b36da74429a61493921c7c199563da40ddcf1c1f399 WHIRLPOOL 7ce09fb66d32f3aebda7fb2be66179daab033b4c08ea51c744148051b47e7effc2451971efeb14d6a403c48c5c46c2ac0a4585159f8115ec40b2bfa89f98317f

diff --git a/app-shells/bash/bash-4.4_alpha-r1.ebuild b/app-shells/bash/bash-4.4_beta.ebuild
similarity index 96%
rename from app-shells/bash/bash-4.4_alpha-r1.ebuild
rename to app-shells/bash/bash-4.4_beta.ebuild
index ffd1aec..fb37c20 100644
--- a/app-shells/bash/bash-4.4_alpha-r1.ebuild
+++ b/app-shells/bash/bash-4.4_beta.ebuild
@@ -29,12 +29,12 @@ patches() {
 }
 
 # The version of readline this bash normally ships with.
-READLINE_VER="7.0"
+READLINE_VER="7.0_beta"
 
 DESCRIPTION="The standard GNU Bourne again shell"
 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
 case ${PV} in
-*_alpha*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
+*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
 *) SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" ;;
 esac
 
@@ -44,7 +44,7 @@ SLOT="0"
 IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
 
 DEPEND=">=sys-libs/ncurses-5.2-r2:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}_alpha:0= )
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
 	nls? ( virtual/libintl )"
 RDEPEND="${DEPEND}
 	!<sys-apps/portage-2.1.6.7_p1
@@ -85,8 +85,6 @@ src_prepare() {
 	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
 	touch -r . doc/*
 
-	epatch "${FILESDIR}"/${PN}-4.4-optimize-fork.patch
-
 	epatch_user
 }
 
@@ -117,7 +115,7 @@ src_configure() {
 	# be safe.
 	# Exact cached version here doesn't really matter as long as it
 	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
+	export ac_cv_rl_version=${READLINE_VER%%_*}
 
 	# Force linking with system curses ... the bundled termcap lib
 	# sucks bad compared to ncurses.  For the most part, ncurses

diff --git a/app-shells/bash/files/bash-4.4-optimize-fork.patch b/app-shells/bash/files/bash-4.4-optimize-fork.patch
deleted file mode 100644
index 98e83be..0000000
--- a/app-shells/bash/files/bash-4.4-optimize-fork.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-https://lists.gnu.org/archive/html/bug-bash/2015-07/msg00060.html
-
-*** ../bash-4.4-alpha/execute_cmd.c	2015-06-12 17:29:18.000000000 -0400
---- execute_cmd.c	2015-07-14 08:59:22.000000000 -0400
-***************
-*** 2630,2638 ****
-  	  if (ignore_return && second)
-  	    second->flags |= CMD_IGNORE_RETURN;
-- 	  if (should_suppress_fork (second))
-- 	    {
-- 	      second->flags |= CMD_NO_FORK;
-- 	      second->value.Simple->flags |= CMD_NO_FORK;
-- 	    }
-  
-  	  exec_result = execute_command (second);
---- 2630,2633 ----


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-01-26  7:23 Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2016-01-26  7:23 UTC (permalink / raw
  To: gentoo-commits

commit:     d70680449dd7e3eae1baab9c6af38cba586cd7cc
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 25 00:55:05 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 26 07:12:10 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7068044

app-shells/bash: drop old versions

 app-shells/bash/bash-4.3_p33-r1.ebuild             | 249 --------------------
 app-shells/bash/bash-4.3_p33-r2.ebuild             | 250 ---------------------
 app-shells/bash/bash-4.3_p33.ebuild                | 247 --------------------
 app-shells/bash/bash-4.3_p39.ebuild                | 248 --------------------
 .../bash/files/bash-4.3-declare-visibility.patch   |  60 -----
 .../bash/files/bash-4.3-parse-time-keyword.patch   |  30 ---
 6 files changed, 1084 deletions(-)

diff --git a/app-shells/bash/bash-4.3_p33-r1.ebuild b/app-shells/bash/bash-4.3_p33-r1.ebuild
deleted file mode 100644
index da7f827..0000000
--- a/app-shells/bash/bash-4.3_p33-r1.ebuild
+++ /dev/null
@@ -1,249 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="6.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-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
-	readline? ( >=sys-libs/readline-${READLINE_VER} )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
-	epatch "${FILESDIR}"/${PN}-4.3-parse-time-keyword.patch
-	epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
-	epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
-	epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	newins "${FILESDIR}"/bashrc-r1 bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/bash-4.3_p33-r2.ebuild b/app-shells/bash/bash-4.3_p33-r2.ebuild
deleted file mode 100644
index 7b89f44..0000000
--- a/app-shells/bash/bash-4.3_p33-r2.ebuild
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="6.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-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
-	readline? ( >=sys-libs/readline-${READLINE_VER} )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
-	epatch "${FILESDIR}"/${PN}-4.3-parse-time-keyword.patch
-	epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
-	epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
-	epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
-	epatch "${FILESDIR}"/${PN}-4.3-declare-visibility.patch
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	newins "${FILESDIR}"/bashrc-r2 bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/bash-4.3_p33.ebuild b/app-shells/bash/bash-4.3_p33.ebuild
deleted file mode 100644
index aa47a6a..0000000
--- a/app-shells/bash/bash-4.3_p33.ebuild
+++ /dev/null
@@ -1,247 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="6.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-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
-	readline? ( >=sys-libs/readline-${READLINE_VER} )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
-	epatch "${FILESDIR}"/${PN}-4.3-parse-time-keyword.patch
-	epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	newins "${FILESDIR}"/bashrc-r1 bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/bash-4.3_p39.ebuild b/app-shells/bash/bash-4.3_p39.ebuild
deleted file mode 100644
index 2ffc014..0000000
--- a/app-shells/bash/bash-4.3_p39.ebuild
+++ /dev/null
@@ -1,248 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="6.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-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
-	readline? ( >=sys-libs/readline-${READLINE_VER} )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
-	epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
-	epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
-	epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	newins "${FILESDIR}"/bashrc-r2 bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-4.3-declare-visibility.patch b/app-shells/bash/files/bash-4.3-declare-visibility.patch
deleted file mode 100644
index 0343155..0000000
--- a/app-shells/bash/files/bash-4.3-declare-visibility.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00075.html
-
-assign_array_var_from_word_list: after assignment, mark variable as no
-longer invisible
-
-assign_array_var_from_string: after assignment, mark variable as no
-longer invisible
-
-diff --git a/arrayfunc.c b/arrayfunc.c
-index c2ea0e5..6dab71c 100644
---- a/arrayfunc.c
-+++ b/arrayfunc.c
-@@ -407,6 +407,9 @@ assign_array_var_from_word_list (var, list, flags)
-       (*var->assign_func) (var, l->word->word, i, 0);
-     else
-       array_insert (a, i, l->word->word);
-+
-+  VUNSETATTR (var, att_invisible);	/* no longer invisible */
-+
-   return var;
- }
- 
-@@ -639,6 +642,10 @@ assign_array_var_from_string (var, value, flags)
- 
-   if (nlist)
-     dispose_words (nlist);
-+
-+  if (var)
-+    VUNSETATTR (var, att_invisible);	/* no longer invisible */
-+
-   return (var);
- }
- 
-
-bind_int_variable: make sure `v' is non-null before making it visible
-
-diff --git a/variables.c b/variables.c
-index 2f07ebb..cbe7806 100644
---- a/variables.c
-+++ b/variables.c
-@@ -2872,10 +2872,12 @@ bind_int_variable (lhs, rhs)
- #endif
-     v = bind_variable (lhs, rhs, 0);
- 
--  if (v && isint)
--    VSETATTR (v, att_integer);
--
--  VUNSETATTR (v, att_invisible);
-+  if (v)
-+    {
-+      if (isint)
-+	VSETATTR (v, att_integer);
-+      VUNSETATTR (v, att_invisible);
-+    }
- 
-   return (v);
- }
--- 
-2.3.0
-

diff --git a/app-shells/bash/files/bash-4.3-parse-time-keyword.patch b/app-shells/bash/files/bash-4.3-parse-time-keyword.patch
deleted file mode 100644
index cd516e5..0000000
--- a/app-shells/bash/files/bash-4.3-parse-time-keyword.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-https://lists.gnu.org/archive/html/bug-bash/2014-06/msg00034.html
-
-*** ../bash-4.3-patched/parse.y	2014-04-07 11:56:12.000000000 -0400
---- parse.y	2014-06-11 10:25:53.000000000 -0400
-***************
-*** 2789,2797 ****
-      case OR_OR:
-      case '&':
-      case DO:
-      case THEN:
-      case ELSE:
-      case '{':		/* } */
-!     case '(':		/* ) */
-      case BANG:		/* ! time pipeline */
-      case TIME:		/* time time pipeline */
---- 2789,2802 ----
-      case OR_OR:
-      case '&':
-+     case WHILE:
-      case DO:
-+     case UNTIL:
-+     case IF:
-      case THEN:
-+     case ELIF:
-      case ELSE:
-      case '{':		/* } */
-!     case '(':		/* )( */
-!     case ')':		/* only valid in case statement */
-      case BANG:		/* ! time pipeline */
-      case TIME:		/* time time pipeline */


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-06-23  5:44 Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2016-06-23  5:44 UTC (permalink / raw
  To: gentoo-commits

commit:     8da4a0c2cd84f57cc191814b88189858f3d9f8be
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 05:31:04 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 05:43:30 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8da4a0c2

app-shells/bash: version bump to 4.3_p46

 app-shells/bash/Manifest                    |   4 +
 app-shells/bash/bash-4.3_p46.ebuild         | 248 ++++++++++++++++++++++++++++
 app-shells/bash/files/bash-4.3-protos.patch |  10 ++
 3 files changed, 262 insertions(+)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 87ebc09..c283bd1 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -278,3 +278,7 @@ DIST bash43-039 1531 SHA256 ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334b
 DIST bash43-040 1532 SHA256 84bb396b9262992ca5424feab6ed3ec39f193ef5c76dfe4a62b551bd8dd9d76b SHA512 25a0696f1f0e78cb971afa404e0b7fe634b70d49d6a5a9d6ff5506c42063968e8ede83ad80bd0b79601363676fe3abfedc3b76984f6f9ad2e7798790682e21d0 WHIRLPOOL a435f25ae432161f676b4965cc20cc096fa18af8a191dca7cb311a41e3504e5d27c668fb3430fece1de45e0eed9cb34357dc887e83ace9819f24d585eddf6720
 DIST bash43-041 2362 SHA256 4ec432966e4198524a7e0cd685fe222e96043769c9613e66742ac475db132c1a SHA512 d75cdd6a1fb8aeb1a4e88f046cfea3ec493b994b96f60f27d5577b59408422bb7c51cc4525cadab821fd8c57f44fb07f811b087d077359242caff3b54cfc6819 WHIRLPOOL c88e754d694b69bcb3ce390ab3e29932b30a74f8f15b75b570cc46699c072b0f872824766c45bc2a98627529896bdf5aaf6493a493ffd33932d9ed6a362defb3
 DIST bash43-042 1535 SHA256 ac219322db2791da87a496ee6e8e5544846494bdaaea2626270c2f73c1044919 SHA512 01a6601029c0a55c9bf1a4ace3f387f9d094a9b9ee3511e2113c000123d85b1d5813c369e62d5a6dd329f515ef0d67d11394a6c0e4516956387556c13d13009a WHIRLPOOL 790b15282a81f5717fb675ea4ae752382ddb1b101766e32c68deb1ec1d64fcf8841b3da556b87ac685e18b528a1de31bc4b94900369f6386f8e3991ed76232c1
+DIST bash43-043 1942 SHA256 47a8a3c005b46e25821f4d8f5ccb04c1d653b1c829cb40568d553dc44f7a6180 SHA512 eb05e537fac08587d0755ad59218bb5a51685aefc1476d6e3feaf72acd1e08cbda512988d8c157425e7939863b313d1e36f51b32f8a8497655c6b0710a24b738 WHIRLPOOL 3c9a466b68ea5d94b5ad9d1868ad1ace80df6608a9bd1b77c1cd06f7edb588090061f7f4e2639dd7190763864511d573dec33aad77be722516a1300e8a45ce31
+DIST bash43-044 1658 SHA256 9338820630bf67373b44d8ea68409f65162ea7a47b9b29ace06a0aed12567f99 SHA512 2937ef80c99e93094e4aaa6a93d077efc3e433a4712c17e30590a0abeb5488293365cb8aa19e37d25b7d5c38d3ad26cdea12b904e5ffb2cdb16f18ab12f422fd WHIRLPOOL 488f567b900e49a9de9b92e9a8e29a92a087d390e9f24c3986bf1d89524878c88c7a3c2cae959844427fb20e6858a7b8eae112aac640f3d97ba1f79888f9f25d
+DIST bash43-045 1312 SHA256 ba6ec3978e9eaa1eb3fabdaf3cc6fdf8c4606ac1c599faaeb4e2d69864150023 SHA512 7b79dacff44e5358da736334d2277a2879ca1389e22e9dac50e139f30dab623bc89a56930d89e74efc468a00d051f6747ccaffcd1a30d7c737d49780b9830e3d WHIRLPOOL f361e523879ff1898574ac5eca480661bd787dc278fff204e7f27da89e85439b4e9d36a5f556046b760f3beb115302e745b5196bfa081b402d3f76fb44463558
+DIST bash43-046 1494 SHA256 b3b456a6b690cd293353f17e22d92a202b3c8bce587ae5f2667c20c9ab6f688f SHA512 c036b659fa681f8129110356bec33fad00fb8e469f3b4bcefd0b7ddf5e20030977716adf5c65f58f3ff68cd7af0bdd42392ee077100bc7f45ee123749d082f7d WHIRLPOOL d58384a2ca77f9a80a69a117221da51a701539cf5497d8e0fc634cd1cc0cb0024e02675bea810a0f42b873b557d479ba1b7aee6e6f73bd1422df2dbb29396477

diff --git a/app-shells/bash/bash-4.3_p46.ebuild b/app-shells/bash/bash-4.3_p46.ebuild
new file mode 100644
index 0000000..dd22287
--- /dev/null
+++ b/app-shells/bash/bash-4.3_p46.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	[[ ${plevel} -eq 0 ]] && return 1
+	eval set -- {1..${plevel}}
+	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+	if [[ ${opt} == -s ]] ; then
+		echo "${@/#/${DISTDIR}/}"
+	else
+		local u
+		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+			printf "${u}/${pn}-${pv}-patches/%s " "$@"
+		done
+	fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="6.3"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
+[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+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
+	readline? ( >=sys-libs/readline-${READLINE_VER} )
+	nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+	!<sys-apps/portage-2.1.6.7_p1
+	!<sys-apps/paludis-0.26.0_alpha5"
+# we only need yacc when the .y files get patched (bash42-005)
+DEPEND+=" virtual/yacc"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	if is-flag -malign-double ; then #7332
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if [[ ${PV} != *_rc* ]] ; then
+		rm -rf lib/{readline,termcap}/*
+		touch lib/{readline,termcap}/Makefile.in # for config.status
+		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+	fi
+
+	# Avoid regenerating docs after patches #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/*
+
+	epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
+	epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
+	epatch "${FILESDIR}"/${PN}-4.3-protos.patch
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf=()
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		-DUSE_MKTEMP -DUSE_MKSTEMP \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading Bug 7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER}
+
+	# Force linking with system curses ... the bundled termcap lib
+	# sucks bad compared to ncurses.  For the most part, ncurses
+	# is here because readline needs it.  But bash itself calls
+	# ncurses in one or two small places :(.
+
+	if [[ ${PV} != *_rc* ]] ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+	tc-export AR #444070
+	econf \
+		--docdir='$(datarootdir)'/doc/${PF} \
+		--htmldir='$(docdir)/html' \
+		--with-curses \
+		$(use_with afs) \
+		$(use_enable net net-redirections) \
+		--disable-profiling \
+		$(use_enable mem-scramble) \
+		$(use_with mem-scramble bash-malloc) \
+		$(use_enable readline) \
+		$(use_enable readline history) \
+		$(use_enable readline bang-history) \
+		"${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "${FILESDIR}"/bashrc
+	keepdir /etc/bash/bashrc.d
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+	if ! use readline ; then
+		sed_args+=( #432338
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			insinto /usr/share/doc/${PF}/${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					doins ${f}
+				fi
+			done
+		done
+	fi
+
+	doman doc/*.1
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+
+	if [[ -L ${EROOT}/bin/sh ]] ; then
+		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
+		# missing even temporarily causes a fatal error with paludis.
+		local target=$(readlink "${EROOT}"/bin/sh)
+		local tmp=$(emktemp "${EROOT}"/bin)
+		ln -sf "${target}" "${tmp}"
+		mv -f "${tmp}" "${EROOT}"/bin/sh
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-4.3-protos.patch b/app-shells/bash/files/bash-4.3-protos.patch
new file mode 100644
index 0000000..7af84ff
--- /dev/null
+++ b/app-shells/bash/files/bash-4.3-protos.patch
@@ -0,0 +1,10 @@
+--- a/redir.c
++++ b/redir.c
+@@ -31,6 +31,7 @@
+ #endif
+ #include "filecntl.h"
+ #include "posixstat.h"
++#include "trap.h"
+ 
+ #if defined (HAVE_UNISTD_H)
+ #  include <unistd.h>


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-08-11 13:28 Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2016-08-11 13:28 UTC (permalink / raw
  To: gentoo-commits

commit:     37cbe6bce25c5643614742fb20b964f32d934b4b
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 11 10:28:29 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Aug 11 12:58:42 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37cbe6bc

app-shells/bash: version bump to 4.4_beta2

 app-shells/bash/Manifest                           |  2 +-
 .../{bash-4.4_rc1.ebuild => bash-4.4_beta2.ebuild} |  3 +-
 app-shells/bash/files/bash-4.4-assign-crash.patch  | 36 ++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index c283bd1..c1fbf50 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -6,7 +6,7 @@ DIST bash-4.0.tar.gz 6230779 SHA256 9793d394f640a95030c77d5ac989724afe196921956d
 DIST bash-4.1.tar.gz 6598300 SHA256 3f627124a83c6d34db503a923e20710d370573a29dd5d11d6f116d1aee7be1da SHA512 2f2a053d98be9a31cd089e1293e3369ad05406f6543d1d1662d8b5807fdcfebc1dda79db9bf2c596a6351ea463fb9bd9c8943c1d45da9b82f2fd3bab0b8a581a WHIRLPOOL 0259149d6f0d8f8a19e4b5a88e127c55efae0df4459063295aa6a9de69450b5f4b4b579894e4410ddfc0119eeb0356865b7cc4dbc7e4a75ad98acce0dfe2d46f
 DIST bash-4.2.tar.gz 7009201 SHA256 a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8 SHA512 fdd3c230f4f7a687d36db1b8f7baab5e553cf55756e2d49a88ffaa4260c8cb949897dec9f48655e96608ef0093ac101b60c132060f06c711c0ab81aa3f148b5c WHIRLPOOL fd5f321a8a89381904b1dd1f5acb5100186ce48cccc9b248cf68b35a1c1932177df1fc2b0215131999ee6018decf3264c45e54d407bf4b74ff8e4cc8215c630a
 DIST bash-4.3.tar.gz 7955839 SHA256 afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4 SHA512 a852b8e46ee55568dce9d23a30a9dbd1c770c2d2a4bc91e1c3177d723b31b32c5d69d19704a93f165891b409b9dd2cc65723372044e2bd0ee49ed59a11512651 WHIRLPOOL d82eb296b1bdee517b20e40d2231697dc41e2040d34e2da24c4fa40755c723d732929805ebef6f6923cd8ffecfb0db7063ec1dc3ab4e695a93916f2d872e236f
-DIST bash-4.4-rc1.tar.gz 8856234 SHA256 54838ce0e9db6a8920d4c9f6563fd74dac45d3d3c14c8df4cf7ceb68a91e244b SHA512 14862599fc5cdfae00ba9e5a047bf9321e89276a1879a6334fd9c9bd43597ecb48b568f1bd17f3be8bef0a0f572fc63edddec31b106e81c0552127970a069a7b WHIRLPOOL 3623014c39333d12a61e0d32e42ef246b4869b72ad3d6bfb9dd523832a3578056376ce37c795a71bb5bb8e9999aab59773b74a109163f0e1876daf61e3d15363
+DIST bash-4.4-beta2.tar.gz 8932859 SHA256 3a8c4aa40f9ba6c311f4f6a637ae290c0148b828617b0a263a416ba923111f51 SHA512 77fbb9fbc184f178a65600532699cd61d34c923d80f4630a774ad13e1a6648a492644a3b92021722b69b42e9686580586194be7572d162bfc3f336ef4b8f8294 WHIRLPOOL 01782617960e8848c1c0486a748268a197fdf9ce9e9a431d937499b819b145e706ae34d0f2f112096353f4c0bdff3838b38f82bd2a4e8da194270cbee0bfe4b8
 DIST bash205b-001 1132 SHA256 bf7a055e0916b7899e7429e36e35d009db445b942b34520a601ea5a8fa634fdd SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071 WHIRLPOOL 90ba36843bbf2e0b7279d3bd197ddaa04e03e113be32051e5a77280cda6d43dcbf339780c57322fc0835a54c82e0095f0d3f2a13f13fec8c0b8da38e7e9b253a
 DIST bash205b-002 755 SHA256 affdd1808a6262fbfe291ebffa2133b05e4bb46067a90e3329d5741e10f0587b SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883 WHIRLPOOL 7333910e98e517306077937881d4c5569ddd85552203b3ec833f0fda13822e388ce85f007d60e4ab4b1ef15abb66fa40dc4356ca01367463d179a6a23bcff8e7
 DIST bash205b-003 2356 SHA256 604972eaafe69f44413d429e0a826b0eae209ca74b14eeeccdf0d502bbabb340 SHA512 74528ca5d165b812d299f1c69b47757bd677c0b22ce4217e155cd641708b02364a93c6709fb57b546b376b36da74429a61493921c7c199563da40ddcf1c1f399 WHIRLPOOL 7ce09fb66d32f3aebda7fb2be66179daab033b4c08ea51c744148051b47e7effc2451971efeb14d6a403c48c5c46c2ac0a4585159f8115ec40b2bfa89f98317f

diff --git a/app-shells/bash/bash-4.4_rc1.ebuild b/app-shells/bash/bash-4.4_beta2.ebuild
similarity index 99%
rename from app-shells/bash/bash-4.4_rc1.ebuild
rename to app-shells/bash/bash-4.4_beta2.ebuild
index 5650c46..8577651 100644
--- a/app-shells/bash/bash-4.4_rc1.ebuild
+++ b/app-shells/bash/bash-4.4_beta2.ebuild
@@ -74,6 +74,8 @@ src_prepare() {
 	# Include official patches
 	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
 
+	epatch "${FILESDIR}"/${PN}-4.4-assign-crash.patch
+
 	# Clean out local libs so we know we use system ones w/releases.
 	if [[ ${PV} != *_rc* ]] ; then
 		rm -rf lib/{readline,termcap}/*
@@ -100,7 +102,6 @@ src_configure() {
 		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
 		-DNON_INTERACTIVE_LOGIN_SHELLS \
 		-DSSH_SOURCE_BASHRC \
-		-DUSE_MKTEMP -DUSE_MKSTEMP \
 		$(use bashlogger && echo -DSYSLOG_HISTORY)
 
 	# Don't even think about building this statically without

diff --git a/app-shells/bash/files/bash-4.4-assign-crash.patch b/app-shells/bash/files/bash-4.4-assign-crash.patch
new file mode 100644
index 0000000..17089e9
--- /dev/null
+++ b/app-shells/bash/files/bash-4.4-assign-crash.patch
@@ -0,0 +1,36 @@
+http://lists.gnu.org/archive/html/bug-bash/2016-07/msg00066.html
+
+From: Andreas Schwab <schwab@suse.de>
+To: bug-bash@gnu.org
+Subject: a=$* -> crash
+Date: Wed, 27 Jul 2016 13:59:22 +0200
+Message-ID: <mvmbn1j2sx1.fsf@hawking.suse.de>
+
+(gdb) r
+Starting program: /bin/bash -c a=\$\*
+
+Program received signal SIGSEGV, Segmentation fault.
+quote_string (string=string@entry=0x0) at subst.c:3940
+3940      if (*string == 0)
+
+diff --git a/subst.c b/subst.c
+index 37d96f9..16ae3f0 100644
+--- a/subst.c
++++ b/subst.c
+@@ -8575,7 +8575,7 @@ param_expand (string, sindex, quoted, expanded_something,
+ 	      /* If we're not quoted but we still don't want word splitting, make
+ 		 we quote the IFS characters to protect them from splitting (e.g.,
+ 		 when $@ is in the string as well). */
+-	      else if (quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
++	      else if (temp != 0 && quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
+ 		{
+ 		  temp1 = quote_string (temp);
+ 		  free (temp);
+
+Andreas.
+
+-- 
+Andreas Schwab, SUSE Labs, schwab@suse.de
+GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
+"And now for something completely different."
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-10-07  9:06 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2016-10-07  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     902a9997cdea0855955d3323d461d8c3d3575153
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 09:04:56 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 09:05:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=902a9997

app-shells/bash: Removed rc version.

Package-Manager: portage-2.3.1
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/Manifest                          |   1 -
 app-shells/bash/bash-4.4_rc2.ebuild               | 245 ----------------------
 app-shells/bash/files/bash-4.4-assign-crash.patch |  36 ----
 3 files changed, 282 deletions(-)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 1bbb754..5b7a936 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -6,7 +6,6 @@ DIST bash-4.0.tar.gz 6230779 SHA256 9793d394f640a95030c77d5ac989724afe196921956d
 DIST bash-4.1.tar.gz 6598300 SHA256 3f627124a83c6d34db503a923e20710d370573a29dd5d11d6f116d1aee7be1da SHA512 2f2a053d98be9a31cd089e1293e3369ad05406f6543d1d1662d8b5807fdcfebc1dda79db9bf2c596a6351ea463fb9bd9c8943c1d45da9b82f2fd3bab0b8a581a WHIRLPOOL 0259149d6f0d8f8a19e4b5a88e127c55efae0df4459063295aa6a9de69450b5f4b4b579894e4410ddfc0119eeb0356865b7cc4dbc7e4a75ad98acce0dfe2d46f
 DIST bash-4.2.tar.gz 7009201 SHA256 a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8 SHA512 fdd3c230f4f7a687d36db1b8f7baab5e553cf55756e2d49a88ffaa4260c8cb949897dec9f48655e96608ef0093ac101b60c132060f06c711c0ab81aa3f148b5c WHIRLPOOL fd5f321a8a89381904b1dd1f5acb5100186ce48cccc9b248cf68b35a1c1932177df1fc2b0215131999ee6018decf3264c45e54d407bf4b74ff8e4cc8215c630a
 DIST bash-4.3.tar.gz 7955839 SHA256 afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4 SHA512 a852b8e46ee55568dce9d23a30a9dbd1c770c2d2a4bc91e1c3177d723b31b32c5d69d19704a93f165891b409b9dd2cc65723372044e2bd0ee49ed59a11512651 WHIRLPOOL d82eb296b1bdee517b20e40d2231697dc41e2040d34e2da24c4fa40755c723d732929805ebef6f6923cd8ffecfb0db7063ec1dc3ab4e695a93916f2d872e236f
-DIST bash-4.4-rc2.tar.gz 8937485 SHA256 199ec0166d50a765eec74dc258b006b06cf6b59901d7ff40510c82aae37ad994 SHA512 e47cf16c98d2a22373d61ed4e8bae9951c10e04d9aefbcf3b2b8189db6f71314025ad73b6a93a1135a9714011f0e3517911c8e68a39e4a92bda4811441062b2f WHIRLPOOL ead4840dc6313be760f51be7fe611673c9a0e5ddcd76c3817fd173bfe41e213a4d73f4a41f2556023974a7880738f98c30f8f7bb4fd520f10d62a838aef6b650
 DIST bash-4.4.tar.gz 9377313 SHA256 d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb SHA512 73de3b425faaac55e45456b0f6f6d8077b5dfa7bb76e0d1894a19361b4a2b6bd4fbbe182117ddbfe9b07b4d898fba03537c261badc9533dd3c0da891764c7f29 WHIRLPOOL cb88bb6f565d66346f5eb358a179e52637a2ede2fda3358899730795f1ac6f9540d116202f2d0d1ebb9d983ad7054c5fbf9be8b06a1ca0b4fe1eb62bb30a15ce
 DIST bash205b-001 1132 SHA256 bf7a055e0916b7899e7429e36e35d009db445b942b34520a601ea5a8fa634fdd SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071 WHIRLPOOL 90ba36843bbf2e0b7279d3bd197ddaa04e03e113be32051e5a77280cda6d43dcbf339780c57322fc0835a54c82e0095f0d3f2a13f13fec8c0b8da38e7e9b253a
 DIST bash205b-002 755 SHA256 affdd1808a6262fbfe291ebffa2133b05e4bb46067a90e3329d5741e10f0587b SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883 WHIRLPOOL 7333910e98e517306077937881d4c5569ddd85552203b3ec833f0fda13822e388ce85f007d60e4ab4b1ef15abb66fa40dc4356ca01367463d179a6a23bcff8e7

diff --git a/app-shells/bash/bash-4.4_rc2.ebuild b/app-shells/bash/bash-4.4_rc2.ebuild
deleted file mode 100644
index 30a5023..00000000
--- a/app-shells/bash/bash-4.4_rc2.ebuild
+++ /dev/null
@@ -1,245 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="7.0_rc2"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-case ${PV} in
-*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
-*) SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" ;;
-esac
-
-LICENSE="GPL-3"
-SLOT="0"
-#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:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER%%_*}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "${FILESDIR}"/bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-4.4-assign-crash.patch b/app-shells/bash/files/bash-4.4-assign-crash.patch
deleted file mode 100644
index 17089e9..00000000
--- a/app-shells/bash/files/bash-4.4-assign-crash.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-http://lists.gnu.org/archive/html/bug-bash/2016-07/msg00066.html
-
-From: Andreas Schwab <schwab@suse.de>
-To: bug-bash@gnu.org
-Subject: a=$* -> crash
-Date: Wed, 27 Jul 2016 13:59:22 +0200
-Message-ID: <mvmbn1j2sx1.fsf@hawking.suse.de>
-
-(gdb) r
-Starting program: /bin/bash -c a=\$\*
-
-Program received signal SIGSEGV, Segmentation fault.
-quote_string (string=string@entry=0x0) at subst.c:3940
-3940      if (*string == 0)
-
-diff --git a/subst.c b/subst.c
-index 37d96f9..16ae3f0 100644
---- a/subst.c
-+++ b/subst.c
-@@ -8575,7 +8575,7 @@ param_expand (string, sindex, quoted, expanded_something,
- 	      /* If we're not quoted but we still don't want word splitting, make
- 		 we quote the IFS characters to protect them from splitting (e.g.,
- 		 when $@ is in the string as well). */
--	      else if (quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
-+	      else if (temp != 0 && quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
- 		{
- 		  temp1 = quote_string (temp);
- 		  free (temp);
-
-Andreas.
-
--- 
-Andreas Schwab, SUSE Labs, schwab@suse.de
-GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
-"And now for something completely different."
-


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-10-13  8:32 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2016-10-13  8:32 UTC (permalink / raw
  To: gentoo-commits

commit:     eb4d79382613c3fa33a2375ba75f3b4f8b67eae4
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 08:29:59 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 08:31:53 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb4d7938

app-shells/bash: Revbump to fix bug #597006

Package-Manager: portage-2.3.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-4.4-r1.ebuild                 | 248 +++++++++++++++++++++
 .../bash/files/bash-4.4-history-alloclist.patch    |  26 +++
 2 files changed, 274 insertions(+)

diff --git a/app-shells/bash/bash-4.4-r1.ebuild b/app-shells/bash/bash-4.4-r1.ebuild
new file mode 100644
index 00000000..3a1e9b0
--- /dev/null
+++ b/app-shells/bash/bash-4.4-r1.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	[[ ${plevel} -eq 0 ]] && return 1
+	eval set -- {1..${plevel}}
+	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+	if [[ ${opt} == -s ]] ; then
+		echo "${@/#/${DISTDIR}/}"
+	else
+		local u
+		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+			printf "${u}/${pn}-${pv}-patches/%s " "$@"
+		done
+	fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="7.0"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+case ${PV} in
+*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
+*) SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" ;;
+esac
+
+LICENSE="GPL-3"
+SLOT="0"
+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:0=
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+	nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+	!<sys-apps/portage-2.1.6.7_p1
+	!<sys-apps/paludis-0.26.0_alpha5"
+# we only need yacc when the .y files get patched (bash42-005)
+#DEPEND+=" virtual/yacc"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	if is-flag -malign-double ; then #7332
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+
+	# bug 597006: large HISTFILESIZE value may result in upfront memory exhaustion
+	epatch "${FILESDIR}"/${PN}-4.4-history-alloclist.patch
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if [[ ${PV} != *_rc* ]] ; then
+		rm -rf lib/{readline,termcap}/*
+		touch lib/{readline,termcap}/Makefile.in # for config.status
+		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+	fi
+
+	# Avoid regenerating docs after patches #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/*
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf=()
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading Bug 7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER%%_*}
+
+	# Force linking with system curses ... the bundled termcap lib
+	# sucks bad compared to ncurses.  For the most part, ncurses
+	# is here because readline needs it.  But bash itself calls
+	# ncurses in one or two small places :(.
+
+	if [[ ${PV} != *_rc* ]] ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+	tc-export AR #444070
+	econf \
+		--docdir='$(datarootdir)'/doc/${PF} \
+		--htmldir='$(docdir)/html' \
+		--with-curses \
+		$(use_with afs) \
+		$(use_enable net net-redirections) \
+		--disable-profiling \
+		$(use_enable mem-scramble) \
+		$(use_with mem-scramble bash-malloc) \
+		$(use_enable readline) \
+		$(use_enable readline history) \
+		$(use_enable readline bang-history) \
+		"${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "${FILESDIR}"/bashrc
+	keepdir /etc/bash/bashrc.d
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+	if ! use readline ; then
+		sed_args+=( #432338
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			insinto /usr/share/doc/${PF}/${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					doins ${f}
+				fi
+			done
+		done
+	fi
+
+	doman doc/*.1
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+
+	if [[ -L ${EROOT}/bin/sh ]] ; then
+		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
+		# missing even temporarily causes a fatal error with paludis.
+		local target=$(readlink "${EROOT}"/bin/sh)
+		local tmp=$(emktemp "${EROOT}"/bin)
+		ln -sf "${target}" "${tmp}"
+		mv -f "${tmp}" "${EROOT}"/bin/sh
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-4.4-history-alloclist.patch b/app-shells/bash/files/bash-4.4-history-alloclist.patch
new file mode 100644
index 00000000..8072bde
--- /dev/null
+++ b/app-shells/bash/files/bash-4.4-history-alloclist.patch
@@ -0,0 +1,26 @@
+*** ../bash-4.4/lib/readline/history.c	2015-12-28 13:50:31.000000000 -0500
+--- lib/readline/history.c	2016-09-30 14:28:40.000000000 -0400
+***************
+*** 58,61 ****
+--- 58,63 ----
+  #define DEFAULT_HISTORY_INITIAL_SIZE	502
+  
++ #define MAX_HISTORY_INITIAL_SIZE	8192
++ 
+  /* The number of slots to increase the_history by. */
+  #define DEFAULT_HISTORY_GROW_SIZE 50
+***************
+*** 308,312 ****
+  	{
+  	  if (history_stifled && history_max_entries > 0)
+! 	    history_size = history_max_entries + 2;
+  	  else
+  	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+--- 310,316 ----
+  	{
+  	  if (history_stifled && history_max_entries > 0)
+! 	    history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
+! 				? MAX_HISTORY_INITIAL_SIZE
+! 				: history_max_entries + 2;
+  	  else
+  	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2016-12-04 16:09 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2016-12-04 16:09 UTC (permalink / raw
  To: gentoo-commits

commit:     6a35e4b98136e1aee0565435a9a039ffcbb7b8ef
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 16:09:29 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 16:09:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a35e4b9

app-shells/bash: Removed old.

Package-Manager: portage-2.3.2

 app-shells/bash/bash-4.3_p46-r1.ebuild             | 254 ---------------------
 .../bash/files/bash-4.3-prompt-string-comsub.patch | 118 ----------
 2 files changed, 372 deletions(-)

diff --git a/app-shells/bash/bash-4.3_p46-r1.ebuild b/app-shells/bash/bash-4.3_p46-r1.ebuild
deleted file mode 100644
index 5234083..00000000
--- a/app-shells/bash/bash-4.3_p46-r1.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="6.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-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"
-
-DEPEND=">=sys-libs/ncurses-5.2-r2:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-	!<sys-apps/paludis-0.26.0_alpha5"
-# we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
-	"${FILESDIR}"/${PN}-4.3-arrayfunc.patch
-	"${FILESDIR}"/${PN}-4.3-protos.patch
-	# CVE-2016-0634 / bug #594496
-	"${FILESDIR}"/${PN}-4.3-prompt-string-comsub.patch
-)
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${PATCHES[@]}"
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		-DUSE_MKTEMP -DUSE_MKSTEMP \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if [[ ${PV} != *_rc* ]] ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "${FILESDIR}"/bashrc
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch b/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch
deleted file mode 100644
index 175bc53..00000000
--- a/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-http://seclists.org/oss-sec/2016/q3/538
-https://bugs.gentoo.org/594496
-
-*** ../bash-4.3-patched/parse.y	2015-08-13 15:11:54.000000000 -0400
---- parse.y	2016-03-07 15:44:14.000000000 -0500
-***************
-*** 5259,5263 ****
-    int result_size, result_index;
-    int c, n, i;
-!   char *temp, octal_string[4];
-    struct tm *tm;  
-    time_t the_time;
---- 5259,5263 ----
-    int result_size, result_index;
-    int c, n, i;
-!   char *temp, *t_host, octal_string[4];
-    struct tm *tm;  
-    time_t the_time;
-***************
-*** 5407,5411 ****
-  	    case 's':
-  	      temp = base_pathname (shell_name);
-! 	      temp = savestring (temp);
-  	      goto add_string;
-  
---- 5407,5415 ----
-  	    case 's':
-  	      temp = base_pathname (shell_name);
-! 	      /* Try to quote anything the user can set in the file system */
-! 	      if (promptvars || posixly_correct)
-! 		temp = sh_backslash_quote_for_double_quotes (temp);
-! 	      else
-! 		temp = savestring (temp);
-  	      goto add_string;
-  
-***************
-*** 5497,5503 ****
-  	    case 'h':
-  	    case 'H':
-! 	      temp = savestring (current_host_name);
-! 	      if (c == 'h' && (t = (char *)strchr (temp, '.')))
-  		*t = '\0';
-  	      goto add_string;
-  
---- 5501,5515 ----
-  	    case 'h':
-  	    case 'H':
-! 	      t_host = savestring (current_host_name);
-! 	      if (c == 'h' && (t = (char *)strchr (t_host, '.')))
-  		*t = '\0';
-+ 	      if (promptvars || posixly_correct)
-+ 		/* Make sure that expand_prompt_string is called with a
-+ 		   second argument of Q_DOUBLE_QUOTES if we use this
-+ 		   function here. */
-+ 		temp = sh_backslash_quote_for_double_quotes (t_host);
-+ 	      else
-+ 		temp = savestring (t_host);
-+ 	      free (t_host);
-  	      goto add_string;
-  
-*** ../bash-4.3-patched/y.tab.c	2015-08-13 15:11:54.000000000 -0400
---- y.tab.c	2016-03-07 15:44:14.000000000 -0500
-***************
-*** 7571,7575 ****
-    int result_size, result_index;
-    int c, n, i;
-!   char *temp, octal_string[4];
-    struct tm *tm;  
-    time_t the_time;
---- 7571,7575 ----
-    int result_size, result_index;
-    int c, n, i;
-!   char *temp, *t_host, octal_string[4];
-    struct tm *tm;  
-    time_t the_time;
-***************
-*** 7719,7723 ****
-  	    case 's':
-  	      temp = base_pathname (shell_name);
-! 	      temp = savestring (temp);
-  	      goto add_string;
-  
---- 7719,7727 ----
-  	    case 's':
-  	      temp = base_pathname (shell_name);
-! 	      /* Try to quote anything the user can set in the file system */
-! 	      if (promptvars || posixly_correct)
-! 		temp = sh_backslash_quote_for_double_quotes (temp);
-! 	      else
-! 		temp = savestring (temp);
-  	      goto add_string;
-  
-***************
-*** 7809,7815 ****
-  	    case 'h':
-  	    case 'H':
-! 	      temp = savestring (current_host_name);
-! 	      if (c == 'h' && (t = (char *)strchr (temp, '.')))
-  		*t = '\0';
-  	      goto add_string;
-  
---- 7813,7827 ----
-  	    case 'h':
-  	    case 'H':
-! 	      t_host = savestring (current_host_name);
-! 	      if (c == 'h' && (t = (char *)strchr (t_host, '.')))
-  		*t = '\0';
-+ 	      if (promptvars || posixly_correct)
-+ 		/* Make sure that expand_prompt_string is called with a
-+ 		   second argument of Q_DOUBLE_QUOTES if we use this
-+ 		   function here. */
-+ 		temp = sh_backslash_quote_for_double_quotes (t_host);
-+ 	      else
-+ 		temp = savestring (t_host);
-+ 	      free (t_host);
-  	      goto add_string;
-  
-


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2018-01-16  9:50 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2018-01-16  9:50 UTC (permalink / raw
  To: gentoo-commits

commit:     02eb874239be2e638b5782f3de76b338fbda0109
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 16 09:49:55 2018 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Jan 16 09:50:10 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02eb8742

app-shells/bash: Revbump to fix jobs overflow.

Closes: https://bugs.gentoo.org/644720
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-shells/bash/bash-4.4_p12-r1.ebuild             | 260 +++++++++++++++++++++
 app-shells/bash/files/bash-4.4-jobs_overflow.patch |  14 ++
 2 files changed, 274 insertions(+)

diff --git a/app-shells/bash/bash-4.4_p12-r1.ebuild b/app-shells/bash/bash-4.4_p12-r1.ebuild
new file mode 100644
index 00000000000..5e54bf0070b
--- /dev/null
+++ b/app-shells/bash/bash-4.4_p12-r1.ebuild
@@ -0,0 +1,260 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs multilib prefix
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+is_release() {
+	case ${PV} in
+	*_alpha*|*_beta*|*_rc*) return 1 ;;
+	*) return 0 ;;
+	esac
+}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	[[ ${plevel} -eq 0 ]] && return 1
+	eval set -- {1..${plevel}}
+	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+	if [[ ${opt} == -s ]] ; then
+		echo "${@/#/${DISTDIR}/}"
+	else
+		local u
+		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+			printf "${u}/${pn}-${pv}-patches/%s " "$@"
+		done
+	fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="7.0"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+if is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
+else
+	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+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"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:0=
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+	nls? ( virtual/libintl )
+"
+RDEPEND="
+	${DEPEND}
+	!<sys-apps/portage-2.1.6.7_p1
+	!<sys-apps/paludis-0.26.0_alpha5
+"
+# we only need yacc when the .y files get patched (bash42-005)
+#DEPEND+=" virtual/yacc"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+	if is-flag -malign-double ; then #7332
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
+
+	eapply "${FILESDIR}/${PN}-4.4-jobs_overflow.patch" #644720
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/*
+		touch lib/{readline,termcap}/Makefile.in # for config.status
+		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/*
+
+	eapply_user
+}
+
+src_configure() {
+	local myconf=(
+		--disable-profiling
+		--docdir='$(datarootdir)'/doc/${PF}
+		--htmldir='$(docdir)/html'
+		--with-curses
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading Bug 7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER%%_*}
+
+	# Force linking with system curses ... the bundled termcap lib
+	# sucks bad compared to ncurses.  For the most part, ncurses
+	# is here because readline needs it.  But bash itself calls
+	# ncurses in one or two small places :(.
+
+	if is_release ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+	tc-export AR #444070
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+	keepdir /etc/bash/bashrc.d
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+	if ! use readline ; then
+		sed_args+=( #432338
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED%/}"/etc/skel/.bashrc \
+		"${ED%/}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			insinto /usr/share/doc/${PF}/${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					doins ${f}
+				fi
+			done
+		done
+	fi
+
+	doman doc/*.1
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+
+	if [[ -L ${EROOT}/bin/sh ]] ; then
+		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
+		# missing even temporarily causes a fatal error with paludis.
+		local target=$(readlink "${EROOT}"/bin/sh)
+		local tmp=$(emktemp "${EROOT}"/bin)
+		ln -sf "${target}" "${tmp}"
+		mv -f "${tmp}" "${EROOT}"/bin/sh
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-4.4-jobs_overflow.patch b/app-shells/bash/files/bash-4.4-jobs_overflow.patch
new file mode 100644
index 00000000000..8753d62ec6c
--- /dev/null
+++ b/app-shells/bash/files/bash-4.4-jobs_overflow.patch
@@ -0,0 +1,14 @@
+https://lists.gnu.org/archive/html/bug-bash/2017-12/msg00025.html
+https://bugs.gentoo.org/644720
+
+--- bash-4.4/jobs.c
++++ bash-4.4/jobs.c
+@@ -750,7 +750,7 @@
+   else
+     nsize = bgpids.nalloc;
+ 
+-  while (nsize < js.c_childmax)
++  while (nsize < (ps_index_t)js.c_childmax)
+     nsize *= 2;
+ 
+   if (bgpids.nalloc < js.c_childmax)


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2019-03-07 22:19 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-03-07 22:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f5a7b1f7ec507d2646b230f1c238d8cad3244459
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  7 22:18:46 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Mar  7 22:19:43 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5a7b1f7

app-shells/bash: Removed old.

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-4.4_p12.ebuild                | 253 --------------------
 app-shells/bash/bash-5.0.ebuild                    | 259 ---------------------
 .../files/bash-5.0-glob-pattern-backslash.patch    | 133 -----------
 3 files changed, 645 deletions(-)

diff --git a/app-shells/bash/bash-4.4_p12.ebuild b/app-shells/bash/bash-4.4_p12.ebuild
deleted file mode 100644
index 2ebe6c54d4b..00000000000
--- a/app-shells/bash/bash-4.4_p12.ebuild
+++ /dev/null
@@ -1,253 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs multilib prefix
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-is_release() {
-	case ${PV} in
-	*_alpha*|*_beta*|*_rc*) return 1 ;;
-	*) return 0 ;;
-	esac
-}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="7.0"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-if is_release ; then
-	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-else
-	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-fi
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
-
-DEPEND=">=sys-libs/ncurses-5.2-r2:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
-	nls? ( virtual/libintl )"
-RDEPEND="${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1"
-# we only need yacc when the .y files get patched (bash42-005)
-#DEPEND+=" virtual/yacc"
-
-S=${WORKDIR}/${MY_P}
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if is_release ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Prefixify hardcoded path names. No-op for non-prefix.
-	hprefixify pathnames.h.in
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER%%_*}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if is_release ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/bash-5.0.ebuild b/app-shells/bash/bash-5.0.ebuild
deleted file mode 100644
index cace89b9690..00000000000
--- a/app-shells/bash/bash-5.0.ebuild
+++ /dev/null
@@ -1,259 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs multilib prefix
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-is_release() {
-	case ${PV} in
-	*_alpha*|*_beta*|*_rc*) return 1 ;;
-	*) return 0 ;;
-	esac
-}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="8.0"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-if is_release ; then
-	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-else
-	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-fi
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
-
-DEPEND="
-	>=sys-libs/ncurses-5.2-r2:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
-	nls? ( virtual/libintl )
-"
-RDEPEND="
-	${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-"
-# we only need yacc when the .y files get patched (bash42-005)
-#DEPEND+=" virtual/yacc"
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if is_release ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Prefixify hardcoded path names. No-op for non-prefix.
-	hprefixify pathnames.h.in
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	eapply -p0 "${FILESDIR}"/${P}-glob-pattern-backslash.patch
-
-	eapply_user
-}
-
-src_configure() {
-	local myconf=(
-		--disable-profiling
-		--docdir='$(datarootdir)'/doc/${PF}
-		--htmldir='$(docdir)/html'
-		--with-curses
-		$(use_enable mem-scramble)
-		$(use_enable net net-redirections)
-		$(use_enable readline)
-		$(use_enable readline bang-history)
-		$(use_enable readline history)
-		$(use_with afs)
-		$(use_with mem-scramble bash-malloc)
-	)
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER%%_*}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if is_release ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf "${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED%/}"/etc/skel/.bashrc \
-		"${ED%/}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch b/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch
deleted file mode 100644
index 40379b3d4cc..00000000000
--- a/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-*** ../bash-5.0/bashline.c	2018-11-27 13:20:16.000000000 -0500
---- bashline.c	2019-01-09 09:44:26.000000000 -0500
-***************
-*** 232,235 ****
---- 232,236 ----
-  static int bash_possible_command_completions __P((int, int));
-  
-+ static int completion_glob_pattern __P((const char *));
-  static char *glob_complete_word __P((const char *, int));
-  static int bash_glob_completion_internal __P((int));
-***************
-*** 1742,1746 ****
-    /* This could be a globbing pattern, so try to expand it using pathname
-       expansion. */
-!   if (!matches && glob_pattern_p (text))
-      {
-        matches = rl_completion_matches (text, glob_complete_word);
---- 1743,1747 ----
-    /* This could be a globbing pattern, so try to expand it using pathname
-       expansion. */
-!   if (!matches && completion_glob_pattern (text))
-      {
-        matches = rl_completion_matches (text, glob_complete_word);
-***************
-*** 1851,1855 ****
-  	}
-  
-!       globpat = glob_pattern_p (hint_text);
-  
-        /* If this is an absolute program name, do not check it against
---- 1852,1856 ----
-  	}
-  
-!       globpat = completion_glob_pattern (hint_text);
-  
-        /* If this is an absolute program name, do not check it against
-***************
-*** 3714,3717 ****
---- 3715,3773 ----
-  }
-  
-+ static int
-+ completion_glob_pattern (string)
-+      const char *string;
-+ {
-+   register int c;
-+   char *send;
-+   int open;
-+ 
-+   DECLARE_MBSTATE;
-+ 
-+   open = 0;
-+   send = string + strlen (string);
-+ 
-+   while (c = *string++)
-+     {
-+       switch (c)
-+ 	{
-+ 	case '?':
-+ 	case '*':
-+ 	  return (1);
-+ 
-+ 	case '[':
-+ 	  open++;
-+ 	  continue;
-+ 
-+ 	case ']':
-+ 	  if (open)
-+ 	    return (1);
-+ 	  continue;
-+ 
-+ 	case '+':
-+ 	case '@':
-+ 	case '!':
-+ 	  if (*string == '(')	/*)*/
-+ 	    return (1);
-+ 	  continue;
-+ 
-+ 	case '\\':
-+ 	  if (*string == 0)
-+ 	    return (0);	 	  
-+ 	}
-+ 
-+       /* Advance one fewer byte than an entire multibyte character to
-+ 	 account for the auto-increment in the loop above. */
-+ #ifdef HANDLE_MULTIBYTE
-+       string--;
-+       ADVANCE_CHAR_P (string, send - string);
-+       string++;
-+ #else
-+       ADVANCE_CHAR_P (string, send - string);
-+ #endif
-+     }
-+   return (0);
-+ }
-+ 
-  static char *globtext;
-  static char *globorig;
-***************
-*** 3878,3882 ****
-      }      
-  
-!   if (t && glob_pattern_p (t) == 0)
-      rl_explicit_arg = 1;	/* XXX - force glob_complete_word to append `*' */
-    FREE (t);
---- 3934,3938 ----
-      }      
-  
-!   if (t && completion_glob_pattern (t) == 0)
-      rl_explicit_arg = 1;	/* XXX - force glob_complete_word to append `*' */
-    FREE (t);
-*** ../bash-5.0/lib/glob/glob_loop.c	2018-12-31 13:35:15.000000000 -0500
---- lib/glob/glob_loop.c	2019-01-09 09:44:36.000000000 -0500
-***************
-*** 55,59 ****
-  
-        case L('\\'):
-- #if 0
-  	/* Don't let the pattern end in a backslash (GMATCH returns no match
-  	   if the pattern ends in a backslash anyway), but otherwise return 1,
---- 55,58 ----
-***************
-*** 61,69 ****
-  	   and it can be removed. */
-  	return (*p != L('\0'));
-- #else
-- 	/* The pattern may not end with a backslash. */
-- 	if (*p++ == L('\0'))
-- 	  return 0;
-- #endif
-        }
-  
---- 60,63 ----


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2019-03-07 22:19 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-03-07 22:19 UTC (permalink / raw
  To: gentoo-commits

commit:     65328e8c4b7793f4fa9522d35cfb13e1767c18ce
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  7 22:08:38 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Mar  7 22:19:41 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65328e8c

app-shells/bash: Revbump to add a couple of fixes

Closes: https://bugs.gentoo.org/676114
Closes: https://github.com/gentoo/gentoo/pull/10949
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-5.0_p2-r1.ebuild              | 267 +++++++++++++++++++++
 .../bash/files/bash-5.0-globpat-backslashes.patch  | 174 ++++++++++++++
 .../bash/files/bash-5.0-history-append.patch       |  34 +++
 .../bash/files/bash-5.0-history-zero-length.patch  |  34 +++
 .../files/bash-5.0-optimize-connection-fork.patch  |  79 ++++++
 .../files/bash-5.0-syslog-history-extern.patch     |  15 ++
 6 files changed, 603 insertions(+)

diff --git a/app-shells/bash/bash-5.0_p2-r1.ebuild b/app-shells/bash/bash-5.0_p2-r1.ebuild
new file mode 100644
index 00000000000..fc03471826e
--- /dev/null
+++ b/app-shells/bash/bash-5.0_p2-r1.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs multilib prefix
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+is_release() {
+	case ${PV} in
+	*_alpha*|*_beta*|*_rc*) return 1 ;;
+	*) return 0 ;;
+	esac
+}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	[[ ${plevel} -eq 0 ]] && return 1
+	eval set -- {1..${plevel}}
+	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+	if [[ ${opt} == -s ]] ; then
+		echo "${@/#/${DISTDIR}/}"
+	else
+		local u
+		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+			printf "${u}/${pn}-${pv}-patches/%s " "$@"
+		done
+	fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="8.0"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+if is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
+else
+	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:0=
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+	nls? ( virtual/libintl )
+"
+RDEPEND="
+	${DEPEND}
+	!<sys-apps/portage-2.1.6.7_p1
+"
+# we only need yacc when the .y files get patched (bash42-005)
+#DEPEND+=" virtual/yacc"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	# Patches from Chet sent to bashbug ml
+	"${FILESDIR}"/${PN}-5.0-history-zero-length.patch
+	"${FILESDIR}"/${PN}-5.0-history-append.patch
+	"${FILESDIR}"/${PN}-5.0-optimize-connection-fork.patch
+	"${FILESDIR}"/${PN}-5.0-globpat-backslashes.patch
+	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+)
+
+pkg_setup() {
+	if is-flag -malign-double ; then #7332
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/*
+		touch lib/{readline,termcap}/Makefile.in # for config.status
+		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/*
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local myconf=(
+		--disable-profiling
+		--docdir='$(datarootdir)'/doc/${PF}
+		--htmldir='$(docdir)/html'
+		--with-curses
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading Bug 7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER%%_*}
+
+	# Force linking with system curses ... the bundled termcap lib
+	# sucks bad compared to ncurses.  For the most part, ncurses
+	# is here because readline needs it.  But bash itself calls
+	# ncurses in one or two small places :(.
+
+	if is_release ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+	tc-export AR #444070
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+	keepdir /etc/bash/bashrc.d
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+	if ! use readline ; then
+		sed_args+=( #432338
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED%/}"/etc/skel/.bashrc \
+		"${ED%/}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			insinto /usr/share/doc/${PF}/${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					doins ${f}
+				fi
+			done
+		done
+	fi
+
+	doman doc/*.1
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+
+	if [[ -L ${EROOT}/bin/sh ]] ; then
+		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
+		# missing even temporarily causes a fatal error with paludis.
+		local target=$(readlink "${EROOT}"/bin/sh)
+		local tmp=$(emktemp "${EROOT}"/bin)
+		ln -sf "${target}" "${tmp}"
+		mv -f "${tmp}" "${EROOT}"/bin/sh
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.0-globpat-backslashes.patch b/app-shells/bash/files/bash-5.0-globpat-backslashes.patch
new file mode 100644
index 00000000000..b3f6d680ea4
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-globpat-backslashes.patch
@@ -0,0 +1,174 @@
+*** ../bash-5.0-patched/lib/glob/glob_loop.c	2019-01-16 16:13:21.000000000 -0500
+--- lib/glob/glob_loop.c	2019-02-01 09:45:11.000000000 -0500
+***************
+*** 27,34 ****
+    register const GCHAR *p;
+    register GCHAR c;
+!   int bopen;
+  
+    p = pattern;
+!   bopen = 0;
+  
+    while ((c = *p++) != L('\0'))
+--- 27,34 ----
+    register const GCHAR *p;
+    register GCHAR c;
+!   int bopen, bsquote;
+  
+    p = pattern;
+!   bopen = bsquote = 0;
+  
+    while ((c = *p++) != L('\0'))
+***************
+*** 56,66 ****
+        case L('\\'):
+  	/* Don't let the pattern end in a backslash (GMATCH returns no match
+! 	   if the pattern ends in a backslash anyway), but otherwise return 1,
+! 	   since the matching engine uses backslash as an escape character
+! 	   and it can be removed. */
+! 	return (*p != L('\0'));
+        }
+  
+!   return 0;
+  }
+  
+--- 56,75 ----
+        case L('\\'):
+  	/* Don't let the pattern end in a backslash (GMATCH returns no match
+! 	   if the pattern ends in a backslash anyway), but otherwise note that 
+! 	   we have seen this, since the matching engine uses backslash as an
+! 	   escape character and it can be removed. We return 2 later if we
+! 	   have seen only backslash-escaped characters, so interested callers
+! 	   know they can shortcut and just dequote the pathname. */
+! 	if (*p != L('\0'))
+! 	  {
+! 	    p++;
+! 	    bsquote = 1;
+! 	    continue;
+! 	  }
+! 	else 	/* (*p == L('\0')) */
+! 	  return 0;
+        }
+  
+!   return bsquote ? 2 : 0;
+  }
+  
+*** ../bash-5.0-patched/lib/glob/glob.c	2018-09-20 10:53:23.000000000 -0400
+--- lib/glob/glob.c	2019-01-31 19:14:13.000000000 -0500
+***************
+*** 1062,1066 ****
+    unsigned int directory_len;
+    int free_dirname;			/* flag */
+!   int dflags;
+  
+    result = (char **) malloc (sizeof (char *));
+--- 1078,1082 ----
+    unsigned int directory_len;
+    int free_dirname;			/* flag */
+!   int dflags, hasglob;
+  
+    result = (char **) malloc (sizeof (char *));
+***************
+*** 1111,1117 ****
+      }
+  
+    /* If directory_name contains globbing characters, then we
+!      have to expand the previous levels.  Just recurse. */
+!   if (directory_len > 0 && glob_pattern_p (directory_name))
+      {
+        char **directories, *d, *p;
+--- 1127,1136 ----
+      }
+  
++   hasglob = 0;
+    /* If directory_name contains globbing characters, then we
+!      have to expand the previous levels.  Just recurse.
+!      If glob_pattern_p returns != [0,1] we have a pattern that has backslash
+!      quotes but no unquoted glob pattern characters. We dequote it below. */
+!   if (directory_len > 0 && (hasglob = glob_pattern_p (directory_name)) == 1)
+      {
+        char **directories, *d, *p;
+***************
+*** 1333,1336 ****
+--- 1352,1360 ----
+  	  return (NULL);
+  	}
++       if (directory_len > 0 && hasglob == 2)		/* need to dequote */
++ 	{
++ 	  dequote_pathname (directory_name);
++ 	  directory_len = strlen (directory_name);
++ 	}
+        /* Handle GX_MARKDIRS here. */
+        result[0] = (char *) malloc (directory_len + 1);
+*** ../bash-5.0-patched/pathexp.c	2018-04-29 17:44:48.000000000 -0400
+--- pathexp.c	2019-01-31 20:19:41.000000000 -0500
+***************
+*** 66,74 ****
+    register int c;
+    char *send;
+!   int open;
+  
+    DECLARE_MBSTATE;
+  
+!   open = 0;
+    send = string + strlen (string);
+  
+--- 66,74 ----
+    register int c;
+    char *send;
+!   int open, bsquote;
+  
+    DECLARE_MBSTATE;
+  
+!   open = bsquote = 0;
+    send = string + strlen (string);
+  
+***************
+*** 101,105 ****
+  	   globbing. */
+  	case '\\':
+! 	  return (*string != 0);
+  	 	  
+  	case CTLESC:
+--- 101,112 ----
+  	   globbing. */
+  	case '\\':
+! 	  if (*string != '\0' && *string != '/')
+! 	    {
+! 	      bsquote = 1;
+! 	      string++;
+! 	      continue;
+! 	    }
+! 	  else if (*string == 0)
+! 	    return (0);
+  	 	  
+  	case CTLESC:
+***************
+*** 118,122 ****
+  #endif
+      }
+!   return (0);
+  }
+  
+--- 125,130 ----
+  #endif
+      }
+! 
+!   return (bsquote ? 2 : 0);
+  }
+  
+*** ../bash-5.0-patched/bashline.c	2019-01-16 16:13:21.000000000 -0500
+--- bashline.c	2019-02-22 09:29:08.000000000 -0500
+***************
+*** 3753,3757 ****
+  
+  	case '\\':
+! 	  if (*string == 0)
+  	    return (0);	 	  
+  	}
+--- 3766,3770 ----
+  
+  	case '\\':
+! 	  if (*string++ == 0)
+  	    return (0);	 	  
+  	}

diff --git a/app-shells/bash/files/bash-5.0-history-append.patch b/app-shells/bash/files/bash-5.0-history-append.patch
new file mode 100644
index 00000000000..20f78bfe9f0
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-history-append.patch
@@ -0,0 +1,34 @@
+*** ../bash-5.0-patched/bashhist.c	2018-07-05 22:41:14.000000000 -0400
+--- bashhist.c	2019-02-23 17:12:02.000000000 -0500
+***************
+*** 437,445 ****
+       char *filename;
+  {
+!   int fd, result;
+    struct stat buf;
+  
+    result = EXECUTION_SUCCESS;
+!   if (history_lines_this_session > 0 && (history_lines_this_session <= where_history ()))
+      {
+        /* If the filename was supplied, then create it if necessary. */
+--- 437,445 ----
+       char *filename;
+  {
+!   int fd, result, histlen;
+    struct stat buf;
+  
+    result = EXECUTION_SUCCESS;
+!   if (history_lines_this_session > 0)
+      {
+        /* If the filename was supplied, then create it if necessary. */
+***************
+*** 454,457 ****
+--- 454,461 ----
+  	  close (fd);
+  	}
++       /* cap the number of lines we write at the length of the history list */
++       histlen = where_history ();
++       if (histlen > 0 && history_lines_this_session > histlen)
++ 	history_lines_this_session = histlen;	/* reset below anyway */
+        result = append_history (history_lines_this_session, filename);
+        /* Pretend we already read these lines from the file because we just

diff --git a/app-shells/bash/files/bash-5.0-history-zero-length.patch b/app-shells/bash/files/bash-5.0-history-zero-length.patch
new file mode 100644
index 00000000000..981bbfb0625
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-history-zero-length.patch
@@ -0,0 +1,34 @@
+*** ../bash-5.0-patched/bashhist.c	2018-07-05 22:41:14.000000000 -0400
+--- bashhist.c	2019-02-20 16:20:04.000000000 -0500
+***************
+*** 561,573 ****
+    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
+      {
+        /* If we are expanding the second or later line of a multi-line
+  	 command, decrease history_length so references to history expansions
+  	 in these lines refer to the previous history entry and not the
+  	 current command. */
+        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
+          history_length--;
+        expanded = history_expand (line, &history_value);
+        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
+!         history_length++;
+  
+        if (expanded)
+--- 561,576 ----
+    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
+      {
++       int old_len;
++ 
+        /* If we are expanding the second or later line of a multi-line
+  	 command, decrease history_length so references to history expansions
+  	 in these lines refer to the previous history entry and not the
+  	 current command. */
++       old_len = history_length;
+        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
+          history_length--;
+        expanded = history_expand (line, &history_value);
+        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
+!         history_length = old_len;
+  
+        if (expanded)

diff --git a/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch b/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch
new file mode 100644
index 00000000000..3c6561bb126
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch
@@ -0,0 +1,79 @@
+*** ../bash-5.0-patched/command.h	2018-07-20 21:16:31.000000000 -0400
+--- command.h	2019-02-20 11:09:36.000000000 -0500
+***************
+*** 187,190 ****
+--- 188,192 ----
+  #define CMD_LASTPIPE	    0x2000
+  #define CMD_STDPATH	    0x4000	/* use standard path for command lookup */
++ #define CMD_TRY_OPTIMIZING  0x8000	/* try to optimize this simple command */
+  
+  /* What a command looks like. */
+*** ../bash-5.0-patched/builtins/evalstring.c	2018-12-26 11:19:21.000000000 -0500
+--- builtins/evalstring.c	2019-01-29 14:15:19.000000000 -0500
+***************
+*** 101,104 ****
+--- 101,113 ----
+  }
+  
++ int
++ can_optimize_connection (command)
++      COMMAND *command;
++ {
++   return (*bash_input.location.string == '\0' &&
++ 	  (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
++ 	  command->value.Connection->second->type == cm_simple);
++ }
++ 
+  void
+  optimize_fork (command)
+***************
+*** 106,110 ****
+  {
+    if (command->type == cm_connection &&
+!       (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR) &&
+        should_suppress_fork (command->value.Connection->second))
+      {
+--- 115,120 ----
+  {
+    if (command->type == cm_connection &&
+!       (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
+!       (command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
+        should_suppress_fork (command->value.Connection->second))
+      {
+***************
+*** 413,418 ****
+  		  command->value.Simple->flags |= CMD_NO_FORK;
+  		}
+! 	      else if (command->type == cm_connection)
+! 		optimize_fork (command);
+  #endif /* ONESHOT */
+  
+--- 423,438 ----
+  		  command->value.Simple->flags |= CMD_NO_FORK;
+  		}
+! 
+! 	      /* Can't optimize forks out here execept for simple commands.
+! 		 This knows that the parser sets up commands as left-side heavy
+! 		 (&& and || are left-associative) and after the single parse,
+! 		 if we are at the end of the command string, the last in a
+! 		 series of connection commands is
+! 		 command->value.Connection->second. */
+! 	      else if (command->type == cm_connection && can_optimize_connection (command))
+! 		{
+! 		  command->value.Connection->second->flags |= CMD_TRY_OPTIMIZING;
+! 		  command->value.Connection->second->value.Simple->flags |= CMD_TRY_OPTIMIZING;
+! 		}
+  #endif /* ONESHOT */
+  
+*** ../bash-5.0-patched/execute_cmd.c	2018-12-05 09:05:14.000000000 -0500
+--- execute_cmd.c	2019-01-25 15:59:00.000000000 -0500
+***************
+*** 2768,2771 ****
+--- 2768,2773 ----
+  	   (exec_result != EXECUTION_SUCCESS)))
+  	{
++ 	  optimize_fork (command);
++ 
+  	  second = command->value.Connection->second;
+  	  if (ignore_return && second)
+

diff --git a/app-shells/bash/files/bash-5.0-syslog-history-extern.patch b/app-shells/bash/files/bash-5.0-syslog-history-extern.patch
new file mode 100644
index 00000000000..79909a3d0c3
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-syslog-history-extern.patch
@@ -0,0 +1,15 @@
+*** ../bash-5.0-patched/builtins/shopt.def	2018-10-05 14:49:02.000000000 -0400
+--- builtins/shopt.def	2019-01-23 09:55:22.000000000 -0500
+***************
+*** 123,127 ****
+  #endif
+  
+! #if defined (SYSLOG_HISTORY) && defined (SYSLOG_SHOPT)
+  extern int syslog_history;
+  #endif
+--- 123,127 ----
+  #endif
+  
+! #if defined (SYSLOG_HISTORY)
+  extern int syslog_history;
+  #endif


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2019-03-20 18:25 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-03-20 18:25 UTC (permalink / raw
  To: gentoo-commits

commit:     94f68f9a36e6771e06bc39ad0286121e8956121c
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 18:24:48 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 18:25:08 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94f68f9a

app-shells/bash: Attempt to fix variable scoping in POSIX mode.

Bug: https://bugs.gentoo.org/676344
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-5.0_p3-r1.ebuild              | 267 +++++++++++++++++++++
 .../bash-5.0-assignment-preceding-builtin.patch    |  83 +++++++
 2 files changed, 350 insertions(+)

diff --git a/app-shells/bash/bash-5.0_p3-r1.ebuild b/app-shells/bash/bash-5.0_p3-r1.ebuild
new file mode 100644
index 00000000000..d13f22168a6
--- /dev/null
+++ b/app-shells/bash/bash-5.0_p3-r1.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs multilib prefix
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+is_release() {
+	case ${PV} in
+	*_alpha*|*_beta*|*_rc*) return 1 ;;
+	*) return 0 ;;
+	esac
+}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	[[ ${plevel} -eq 0 ]] && return 1
+	eval set -- {1..${plevel}}
+	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
+	if [[ ${opt} == -s ]] ; then
+		echo "${@/#/${DISTDIR}/}"
+	else
+		local u
+		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
+			printf "${u}/${pn}-${pv}-patches/%s " "$@"
+		done
+	fi
+}
+
+# The version of readline this bash normally ships with.
+READLINE_VER="8.0"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
+if is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
+else
+	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:0=
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+	nls? ( virtual/libintl )
+"
+RDEPEND="
+	${DEPEND}
+	!<sys-apps/portage-2.1.6.7_p1
+"
+# we only need yacc when the .y files get patched (bash42-005)
+#DEPEND+=" virtual/yacc"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	# Patches from Chet sent to bashbug ml
+	"${FILESDIR}"/${PN}-5.0-history-zero-length.patch
+	"${FILESDIR}"/${PN}-5.0-history-append.patch
+	"${FILESDIR}"/${PN}-5.0-optimize-connection-fork.patch
+	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+	"${FILESDIR}"/${PN}-5.0-assignment-preceding-builtin.patch
+)
+
+pkg_setup() {
+	if is-flag -malign-double ; then #7332
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/*
+		touch lib/{readline,termcap}/Makefile.in # for config.status
+		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/*
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local myconf=(
+		--disable-profiling
+		--docdir='$(datarootdir)'/doc/${PF}
+		--htmldir='$(docdir)/html'
+		--with-curses
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading Bug 7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER%%_*}
+
+	# Force linking with system curses ... the bundled termcap lib
+	# sucks bad compared to ncurses.  For the most part, ncurses
+	# is here because readline needs it.  But bash itself calls
+	# ncurses in one or two small places :(.
+
+	if is_release ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+	tc-export AR #444070
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+	keepdir /etc/bash/bashrc.d
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+	if ! use readline ; then
+		sed_args+=( #432338
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED%/}"/etc/skel/.bashrc \
+		"${ED%/}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			insinto /usr/share/doc/${PF}/${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					doins ${f}
+				fi
+			done
+		done
+	fi
+
+	doman doc/*.1
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+
+	if [[ -L ${EROOT}/bin/sh ]] ; then
+		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
+		# missing even temporarily causes a fatal error with paludis.
+		local target=$(readlink "${EROOT}"/bin/sh)
+		local tmp=$(emktemp "${EROOT}"/bin)
+		ln -sf "${target}" "${tmp}"
+		mv -f "${tmp}" "${EROOT}"/bin/sh
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.0-assignment-preceding-builtin.patch b/app-shells/bash/files/bash-5.0-assignment-preceding-builtin.patch
new file mode 100644
index 00000000000..84b7fbc8b2a
--- /dev/null
+++ b/app-shells/bash/files/bash-5.0-assignment-preceding-builtin.patch
@@ -0,0 +1,83 @@
+*** ../bash-5.0-patched/variables.c	2018-12-18 11:07:21.000000000 -0500
+--- variables.c	2019-03-20 10:30:56.000000000 -0400
+***************
+*** 4473,4476 ****
+--- 4473,4489 ----
+    var = (SHELL_VAR *)data;
+  
++ #if 1 /* TAG:bash-5.1 */
++   /* Just like do_assignment_internal(). This makes assignments preceding
++      special builtins act like standalone assignment statements when in
++      posix mode, satisfying the posix requirement that this affect the
++      "current execution environment." */
++   v = bind_variable (var->name, value_cell (var), ASS_FORCE|ASS_NOLONGJMP);
++ 
++   /* If this modifies an existing local variable, v->context will be non-zero.
++      If it comes back with v->context == 0, we bound at the global context.
++      Set binding_table appropriately. It doesn't matter whether it's correct
++      if the variable is local, only that it's not global_variables->table */
++   binding_table = v->context ? shell_variables->table : global_variables->table;
++ #else
+    binding_table = global_variables->table;
+    if (binding_table == 0)
+***************
+*** 4478,4486 ****
+  
+    v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, ASS_FORCE|ASS_NOLONGJMP);
+  
+    /* global variables are no longer temporary and don't need propagating. */
+!   var->attributes &= ~(att_tempvar|att_propagate);
+    if (v)
+!     v->attributes |= var->attributes;
+  
+    if (find_special_var (var->name) >= 0)
+--- 4491,4508 ----
+  
+    v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, ASS_FORCE|ASS_NOLONGJMP);
++ #endif
+  
+    /* global variables are no longer temporary and don't need propagating. */
+!   if (binding_table == global_variables->table)
+!     var->attributes &= ~(att_tempvar|att_propagate);
+! 
+    if (v)
+!     {
+!       v->attributes |= var->attributes;
+!       v->attributes &= ~att_tempvar;	/* not a temp var now */
+! #if 0	/* TAG:bash-5.1 code doesn't need this, disable for bash-5.1 */
+!       v->context = (binding_table == global_variables->table) ? 0 : shell_variables->scope;
+! #endif
+!     }
+  
+    if (find_special_var (var->name) >= 0)
+***************
+*** 4576,4587 ****
+  {
+    int i;
+  
+    tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1);
+    tempvar_list[tvlist_ind = 0] = 0;
+!     
+!   hash_flush (temporary_env, pushf);
+!   hash_dispose (temporary_env);
+    temporary_env = (HASH_TABLE *)NULL;
+  
+    tempvar_list[tvlist_ind] = 0;
+  
+--- 4598,4612 ----
+  {
+    int i;
++   HASH_TABLE *disposer;
+  
+    tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1);
+    tempvar_list[tvlist_ind = 0] = 0;
+! 
+!   disposer = temporary_env;
+    temporary_env = (HASH_TABLE *)NULL;
+  
++   hash_flush (disposer, pushf);
++   hash_dispose (disposer);
++ 
+    tempvar_list[tvlist_ind] = 0;
+  
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2019-09-02  7:54 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-09-02  7:54 UTC (permalink / raw
  To: gentoo-commits

commit:     2b69ac2f35d40618e587296b7bf379c03be6d06b
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 07:54:22 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 07:54:22 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b69ac2f

app-shells/bash: Removed old

Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-5.0_p7.ebuild                 | 266 ---------------------
 .../bash/files/bash-5.0-history-zero-length.patch  |  34 ---
 2 files changed, 300 deletions(-)

diff --git a/app-shells/bash/bash-5.0_p7.ebuild b/app-shells/bash/bash-5.0_p7.ebuild
deleted file mode 100644
index 1d9060d2561..00000000000
--- a/app-shells/bash/bash-5.0_p7.ebuild
+++ /dev/null
@@ -1,266 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs multilib prefix
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-is_release() {
-	case ${PV} in
-	*_alpha*|*_beta*|*_rc*) return 1 ;;
-	*) return 0 ;;
-	esac
-}
-[[ ${PV} != *_p* ]] && PLEVEL=0
-patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
-	[[ ${plevel} -eq 0 ]] && return 1
-	eval set -- {1..${plevel}}
-	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
-	if [[ ${opt} == -s ]] ; then
-		echo "${@/#/${DISTDIR}/}"
-	else
-		local u
-		for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
-			printf "${u}/${pn}-${pv}-patches/%s " "$@"
-		done
-	fi
-}
-
-# The version of readline this bash normally ships with.
-READLINE_VER="8.0"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
-if is_release ; then
-	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
-else
-	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-fi
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
-
-DEPEND="
-	>=sys-libs/ncurses-5.2-r2:0=
-	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
-	nls? ( virtual/libintl )
-"
-RDEPEND="
-	${DEPEND}
-	!<sys-apps/portage-2.1.6.7_p1
-"
-# we only need yacc when the .y files get patched (bash42-005)
-#DEPEND+=" virtual/yacc"
-
-S="${WORKDIR}/${MY_P}"
-
-PATCHES=(
-	# Patches from Chet sent to bashbug ml
-	"${FILESDIR}"/${PN}-5.0-history-zero-length.patch
-	"${FILESDIR}"/${PN}-5.0-history-append.patch
-	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
-	"${FILESDIR}"/${PN}-5.0-assignment-preceding-builtin.patch
-)
-
-pkg_setup() {
-	if is-flag -malign-double ; then #7332
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	unpack ${MY_P}.tar.gz
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if is_release ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
-		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
-	fi
-
-	# Prefixify hardcoded path names. No-op for non-prefix.
-	hprefixify pathnames.h.in
-
-	# Avoid regenerating docs after patches #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	eapply -p0 "${PATCHES[@]}"
-	eapply_user
-}
-
-src_configure() {
-	local myconf=(
-		--disable-profiling
-		--docdir='$(datarootdir)'/doc/${PF}
-		--htmldir='$(docdir)/html'
-		--with-curses
-		$(use_enable mem-scramble)
-		$(use_enable net net-redirections)
-		$(use_enable readline)
-		$(use_enable readline bang-history)
-		$(use_enable readline history)
-		$(use_with afs)
-		$(use_with mem-scramble bash-malloc)
-	)
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading Bug 7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	# Historically, we always used the builtin readline, but since
-	# our handling of SONAME upgrades has gotten much more stable
-	# in the PM (and the readline ebuild itself preserves the old
-	# libs during upgrades), linking against the system copy should
-	# be safe.
-	# Exact cached version here doesn't really matter as long as it
-	# is at least what's in the DEPEND up above.
-	export ac_cv_rl_version=${READLINE_VER%%_*}
-
-	# Force linking with system curses ... the bundled termcap lib
-	# sucks bad compared to ncurses.  For the most part, ncurses
-	# is here because readline needs it.  But bash itself calls
-	# ncurses in one or two small places :(.
-
-	if is_release ; then
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins; then
-		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-	tc-export AR #444070
-	econf "${myconf[@]}"
-}
-
-src_compile() {
-	emake
-
-	if use plugins ; then
-		emake -C examples/loadables all others
-	fi
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
-	keepdir /etc/bash/bashrc.d
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-	if ! use readline ; then
-		sed_args+=( #432338
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED%/}"/etc/skel/.bashrc \
-		"${ED%/}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			insinto /usr/share/doc/${PF}/${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					doins ${f}
-				fi
-			done
-		done
-	fi
-
-	doman doc/*.1
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-
-	if [[ -L ${EROOT}/bin/sh ]] ; then
-		# rewrite the symlink to ensure that its mtime changes. having /bin/sh
-		# missing even temporarily causes a fatal error with paludis.
-		local target=$(readlink "${EROOT}"/bin/sh)
-		local tmp=$(emktemp "${EROOT}"/bin)
-		ln -sf "${target}" "${tmp}"
-		mv -f "${tmp}" "${EROOT}"/bin/sh
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-5.0-history-zero-length.patch b/app-shells/bash/files/bash-5.0-history-zero-length.patch
deleted file mode 100644
index 981bbfb0625..00000000000
--- a/app-shells/bash/files/bash-5.0-history-zero-length.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-*** ../bash-5.0-patched/bashhist.c	2018-07-05 22:41:14.000000000 -0400
---- bashhist.c	2019-02-20 16:20:04.000000000 -0500
-***************
-*** 561,573 ****
-    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
-      {
-        /* If we are expanding the second or later line of a multi-line
-  	 command, decrease history_length so references to history expansions
-  	 in these lines refer to the previous history entry and not the
-  	 current command. */
-        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
-          history_length--;
-        expanded = history_expand (line, &history_value);
-        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
-!         history_length++;
-  
-        if (expanded)
---- 561,576 ----
-    if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
-      {
-+       int old_len;
-+ 
-        /* If we are expanding the second or later line of a multi-line
-  	 command, decrease history_length so references to history expansions
-  	 in these lines refer to the previous history entry and not the
-  	 current command. */
-+       old_len = history_length;
-        if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
-          history_length--;
-        expanded = history_expand (line, &history_value);
-        if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
-!         history_length = old_len;
-  
-        if (expanded)


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2020-09-24 15:41 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2020-09-24 15:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e5a76c98a55a0ed14566f38a9cf78bd50e9b6591
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 15:40:29 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 15:41:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5a76c98

app-shells/bash: EAPI-7 conversion

Closes: https://bugs.gentoo.org/742575
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-shells/bash/bash-2.05b_p13.ebuild              | 71 +++++++++----------
 app-shells/bash/bash-3.0_p22.ebuild                | 81 +++++++++++-----------
 app-shells/bash/bash-3.1_p23.ebuild                | 70 ++++++++++---------
 app-shells/bash/bash-3.2_p57.ebuild                | 74 ++++++++++----------
 app-shells/bash/bash-4.0_p44.ebuild                | 74 ++++++++++----------
 app-shells/bash/bash-4.1_p17.ebuild                | 62 +++++++++--------
 app-shells/bash/bash-4.2_p53.ebuild                | 70 ++++++++++---------
 app-shells/bash/bash-4.3_p48-r2.ebuild             | 58 ++++++++--------
 app-shells/bash/bash-4.4_p23-r2.ebuild             | 20 +++---
 app-shells/bash/bash-5.0_p18.ebuild                | 20 +++---
 app-shells/bash/files/autoconf-mktime-2.59.patch   |  4 +-
 app-shells/bash/files/bash-3.0-crash.patch         |  4 +-
 app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch |  4 +-
 .../bash/files/bash-3.0-read-builtin-pipe.patch    |  4 +-
 .../bash/files/bash-3.0-trap-fg-signals.patch      |  4 +-
 .../bash/files/bash-3.0-volatile-command.patch     |  4 +-
 app-shells/bash/files/bash-3.1-ulimit.patch        | 12 ++--
 app-shells/bash/files/bash-3.2-process-subst.patch |  4 +-
 .../bash/files/bash-3.2-session-leader.patch       |  4 +-
 app-shells/bash/files/bash-3.2-ulimit.patch        |  4 +-
 app-shells/bash/files/bash-4.1-fbsd-eaccess.patch  |  4 +-
 .../files/bash-4.2-dev-fd-buffer-overflow.patch    |  4 +-
 .../bash/files/bash-4.4-popd-offset-overflow.patch |  4 +-
 .../bash/files/bash-4.x-deferred-heredocs.patch    |  4 +-
 24 files changed, 337 insertions(+), 327 deletions(-)

diff --git a/app-shells/bash/bash-2.05b_p13.ebuild b/app-shells/bash/bash-2.05b_p13.ebuild
index f5a44266db7..9c9eb79db32 100644
--- a/app-shells/bash/bash-2.05b_p13.ebuild
+++ b/app-shells/bash/bash-2.05b_p13.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-2.05b-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,19 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.05b-destdir.patch
+	"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
+	"${FILESDIR}"/${PN}-2.05b-protos.patch
+	"${FILESDIR}"/${PN}-2.05b-empty-herestring.patch
+	"${FILESDIR}"/${PN}-2.05b-rbash.patch #26854
+	"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
+	"${FILESDIR}"/${PN}-2.05b-jobs.patch
+	"${FILESDIR}"/${PN}-2.05b-fix-job-warning.patch
+	"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,28 +71,28 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/${PN}-2.05b-destdir.patch
-	epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
-	epatch "${FILESDIR}"/${PN}-2.05b-protos.patch
-	epatch "${FILESDIR}"/${PN}-2.05b-empty-herestring.patch
-	epatch "${FILESDIR}"/${PN}-2.05b-rbash.patch #26854
-	epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
-	epatch "${FILESDIR}"/${PN}-2.05b-jobs.patch
-	epatch "${FILESDIR}"/${PN}-2.05b-fix-job-warning.patch
-	epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
-
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		--without-gnu-malloc
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# Force pgrp synchronization
 	# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
@@ -118,18 +130,7 @@ src_configure() {
 	# This old autoconf script does not re-exec itself properly and fails when
 	# /bin/sh is not bash.  Rather than try to regen everything, just force the
 	# use of bash directly.
-	CONFIG_SHELL="/bin/bash" \
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		--without-gnu-malloc \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	CONFIG_SHELL="/bin/bash" econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-3.0_p22.ebuild b/app-shells/bash/bash-3.0_p22.ebuild
index cfd3e4195cb..6437d45fb53 100644
--- a/app-shells/bash/bash-3.0_p22.ebuild
+++ b/app-shells/bash/bash-3.0_p22.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,22 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
+	"${FILESDIR}"/${PN}-3.0-protos.patch
+	"${FILESDIR}"/${PN}-3.0-rbash.patch #26854
+	"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
+	"${FILESDIR}"/${PN}-3.0-darwin-conn.patch #79124
+	# read patch headers for more info ... many ripped from Fedora/Debian[17]/SuSe/upstream
+	"${FILESDIR}"/${PN}-3.0-{afs,crash,jobs,manpage,pwd,ulimit,histtimeformat,locale,multibyteifs,subshell,volatile-command}.patch
+	"${FILESDIR}"/${PN}-3.0-read-builtin-pipe.patch #87093
+	"${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
+	"${FILESDIR}"/${PN}-3.0-pgrp-pipe-fix.patch #92349
+	"${FILESDIR}"/${PN}-3.0-strnlen.patch
+	"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,36 +74,28 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
-	epatch "${FILESDIR}"/${PN}-3.0-protos.patch
-	epatch "${FILESDIR}"/${PN}-3.0-rbash.patch #26854
-	epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
-	epatch "${FILESDIR}"/${PN}-3.0-darwin-conn.patch #79124
-	# read patch headers for more info ... many ripped from Fedora/Debian[17]/SuSe/upstream
-	for i in afs crash jobs manpage pwd ulimit histtimeformat \
-	         locale multibyteifs subshell \
-	         volatile-command
-	do
-		epatch "${FILESDIR}"/${PN}-3.0-${i}.patch
-	done
-	epatch "${FILESDIR}"/${PN}-3.0-read-builtin-pipe.patch #87093
-	epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
-	epatch "${FILESDIR}"/${PN}-3.0-pgrp-pipe-fix.patch #92349
-	epatch "${FILESDIR}"/${PN}-3.0-strnlen.patch
-	epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
-
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		--without-gnu-malloc
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# Force pgrp synchronization
 	# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
@@ -123,17 +130,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		--without-gnu-malloc \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-3.1_p23.ebuild b/app-shells/bash/bash-3.1_p23.ebuild
index 05a7f9dd608..ad1a7e46c42 100644
--- a/app-shells/bash/bash-3.1_p23.ebuild
+++ b/app-shells/bash/bash-3.1_p23.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,19 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
+	"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
+	"${FILESDIR}"/${PN}-3.1-protos.patch
+	"${FILESDIR}"/${PN}-3.1-ulimit.patch
+	"${FILESDIR}"/${PN}-3.0-read-memleak.patch
+	"${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
+	"${FILESDIR}"/${PN}-3.1-fix-dash-login-shell.patch #118257
+	"${FILESDIR}"/${PN}-3.1-dev-fd-test-as-user.patch #131875
+	"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,28 +71,28 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
-	epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
-	epatch "${FILESDIR}"/${PN}-3.1-protos.patch
-	epatch "${FILESDIR}"/${PN}-3.1-ulimit.patch
-	epatch "${FILESDIR}"/${PN}-3.0-read-memleak.patch
-	epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
-	epatch "${FILESDIR}"/${PN}-3.1-fix-dash-login-shell.patch #118257
-	epatch "${FILESDIR}"/${PN}-3.1-dev-fd-test-as-user.patch #131875
-	epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
-
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		--without-gnu-malloc
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# Force pgrp synchronization
 	# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
@@ -115,17 +127,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		--without-gnu-malloc \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-3.2_p57.ebuild b/app-shells/bash/bash-3.2_p57.ebuild
index 1c31b22879b..f555e3f03de 100644
--- a/app-shells/bash/bash-3.2_p57.ebuild
+++ b/app-shells/bash/bash-3.2_p57.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,21 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/autoconf-mktime-2.59.patch #220040
+	"${FILESDIR}"/${PN}-3.2-loadables.patch
+	"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
+	"${FILESDIR}"/${PN}-3.2-protos.patch
+	"${FILESDIR}"/${PN}-3.2-session-leader.patch #231775
+	"${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947
+	"${FILESDIR}"/${PN}-3.2-process-subst.patch
+	"${FILESDIR}"/${PN}-3.2-ulimit.patch
+	"${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
+	"${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875
+	"${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,30 +73,28 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/autoconf-mktime-2.59.patch #220040
-	epatch "${FILESDIR}"/${PN}-3.2-loadables.patch
-	epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
-	epatch "${FILESDIR}"/${PN}-3.2-protos.patch
-	epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775
-	epatch "${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947
-	epatch "${FILESDIR}"/${PN}-3.2-process-subst.patch
-	epatch "${FILESDIR}"/${PN}-3.2-ulimit.patch
-	epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
-	epatch "${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875
-	epatch "${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
-
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		--without-gnu-malloc
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# Force pgrp synchronization
 	# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
@@ -117,17 +129,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		--without-gnu-malloc \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-4.0_p44.ebuild b/app-shells/bash/bash-4.0_p44.ebuild
index a3dd97b7f88..560929519b5 100644
--- a/app-shells/bash/bash-4.0_p44.ebuild
+++ b/app-shells/bash/bash-4.0_p44.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-4.0-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,18 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.0-configure.patch #304901
+	"${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
+
+	"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
+	"${FILESDIR}"/${PN}-4.0-ldflags-for-build.patch #211947
+	"${FILESDIR}"/${PN}-4.0-negative-return.patch
+	"${FILESDIR}"/${PN}-4.0-parallel-build.patch #267613
+	"${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,28 +70,32 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/${PN}-4.0-configure.patch #304901
-	epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
-	sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
-	epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
-	epatch "${FILESDIR}"/${PN}-4.0-ldflags-for-build.patch #211947
-	epatch "${FILESDIR}"/${PN}-4.0-negative-return.patch
-	epatch "${FILESDIR}"/${PN}-4.0-parallel-build.patch #267613
-	epatch "${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
-	sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613
-
-	epatch_user
+	default
+
+	sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c || die # needs fpurge() decl
+	sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in || die #267613
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		$(use_enable mem-scramble)
+		$(use_with mem-scramble bash-malloc)
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# For descriptions of these, see config-top.h
 	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
@@ -111,18 +126,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-4.1_p17.ebuild b/app-shells/bash/bash-4.1_p17.ebuild
index bf95280c839..9c68ac62d28 100644
--- a/app-shells/bash/bash-4.1_p17.ebuild
+++ b/app-shells/bash/bash-4.1_p17.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-4.1-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -43,7 +43,14 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
 	static? ( ${LIB_DEPEND} )"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.1-fbsd-eaccess.patch #303411
+
+	"${FILESDIR}"/${PN}-4.1-parallel-build.patch
+	"${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -59,23 +66,31 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
-	epatch "${FILESDIR}"/${PN}-4.1-fbsd-eaccess.patch #303411
-	sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
-	epatch "${FILESDIR}"/${PN}-4.1-parallel-build.patch
-	epatch "${FILESDIR}"/${PN}-4.2-dev-fd-buffer-overflow.patch #431850
+	default
 
-	epatch_user
+	sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c || die # needs fpurge() decl
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		$(use_enable mem-scramble)
+		$(use_with mem-scramble bash-malloc)
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	myconf+=( --without-lispdir ) #335896
 
@@ -108,18 +123,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-4.2_p53.ebuild b/app-shells/bash/bash-4.2_p53.ebuild
index 000f5397f9c..1e566e163ed 100644
--- a/app-shells/bash/bash-4.2_p53.ebuild
+++ b/app-shells/bash/bash-4.2_p53.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="4"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -40,12 +40,20 @@ LIB_DEPEND=">=sys-libs/ncurses-5.2-r2[static-libs(+)]
 	nls? ( virtual/libintl )
 	readline? ( >=sys-libs/readline-6.2[static-libs(+)] )"
 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
-# we only need yacc when the .y files get patched (bash42-005)
 DEPEND="${RDEPEND}
-	virtual/yacc
 	static? ( ${LIB_DEPEND} )"
+# we only need yacc when the .y files get patched (bash42-005)
+BDEPEND="virtual/yacc"
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
+	"${FILESDIR}"/${PN}-4.2-parallel-build.patch
+	"${FILESDIR}"/${PN}-4.2-no-readline.patch
+	"${FILESDIR}"/${PN}-4.2-read-retry.patch #447810
+	"${FILESDIR}"/${PN}-4.2-speed-up-read-N.patch
+)
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -61,28 +69,33 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones
-	rm -rf lib/{readline,termcap}/*
-	touch lib/{readline,termcap}/Makefile.in # for config.status
+	rm -rf lib/{readline,termcap}/* || die
+	touch lib/{readline,termcap}/Makefile.in || die # for config.status
 	sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 
 	# Avoid regenerating docs after patches #407985
 	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
-
-	epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
-	epatch "${FILESDIR}"/${PN}-4.2-parallel-build.patch
-	epatch "${FILESDIR}"/${PN}-4.2-no-readline.patch
-	epatch "${FILESDIR}"/${PN}-4.2-read-retry.patch #447810
-	epatch "${FILESDIR}"/${PN}-4.2-speed-up-read-N.patch
+	touch -r . doc/* || die
 
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--with-installed-readline=.
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		$(use_enable mem-scramble)
+		$(use_with mem-scramble bash-malloc)
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# For descriptions of these, see config-top.h
 	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
@@ -113,18 +126,7 @@ src_configure() {
 	# ncurses in one or two small places :(.
 
 	tc-export AR #444070
-	econf \
-		--with-installed-readline=. \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_install() {

diff --git a/app-shells/bash/bash-4.3_p48-r2.ebuild b/app-shells/bash/bash-4.3_p48-r2.ebuild
index 97bf26b8e8f..d535737ea7e 100644
--- a/app-shells/bash/bash-4.3_p48-r2.ebuild
+++ b/app-shells/bash/bash-4.3_p48-r2.ebuild
@@ -1,19 +1,19 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="5"
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs multilib
+inherit flag-o-matic toolchain-funcs multilib
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -46,7 +46,7 @@ DEPEND=">=sys-libs/ncurses-5.2-r2:0=
 RDEPEND="${DEPEND}
 	!<sys-apps/portage-2.1.6.7_p1"
 # we only need yacc when the .y files get patched (bash42-005)
-DEPEND+=" virtual/yacc"
+BDEPEND="virtual/yacc"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
@@ -55,7 +55,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-4.4-popd-offset-overflow.patch #600174
 )
 
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
 
 pkg_setup() {
 	if is-flag -malign-double ; then #7332
@@ -75,26 +75,36 @@ src_unpack() {
 
 src_prepare() {
 	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
 
 	# Clean out local libs so we know we use system ones w/releases.
 	if [[ ${PV} != *_rc* ]] ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
 		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 	fi
 
 	# Avoid regenerating docs after patches #407985
 	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
+	touch -r . doc/* || die
 
-	epatch "${PATCHES[@]}"
-
-	epatch_user
+	default
 }
 
 src_configure() {
-	local myconf=()
+	local myconf=(
+		--docdir='$(datarootdir)'/doc/${PF}
+		--htmldir='$(docdir)/html'
+		--with-curses
+		$(use_with afs)
+		$(use_enable net net-redirections)
+		--disable-profiling
+		$(use_enable mem-scramble)
+		$(use_with mem-scramble bash-malloc)
+		$(use_enable readline)
+		$(use_enable readline history)
+		$(use_enable readline bang-history)
+	)
 
 	# For descriptions of these, see config-top.h
 	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
@@ -145,19 +155,7 @@ src_configure() {
 			configure || die
 	fi
 	tc-export AR #444070
-	econf \
-		--docdir='$(datarootdir)'/doc/${PF} \
-		--htmldir='$(docdir)/html' \
-		--with-curses \
-		$(use_with afs) \
-		$(use_enable net net-redirections) \
-		--disable-profiling \
-		$(use_enable mem-scramble) \
-		$(use_with mem-scramble bash-malloc) \
-		$(use_enable readline) \
-		$(use_enable readline history) \
-		$(use_enable readline bang-history) \
-		"${myconf[@]}"
+	econf "${myconf[@]}"
 }
 
 src_compile() {

diff --git a/app-shells/bash/bash-4.4_p23-r2.ebuild b/app-shells/bash/bash-4.4_p23-r2.ebuild
index 645851b12af..518e64ef49f 100644
--- a/app-shells/bash/bash-4.4_p23-r2.ebuild
+++ b/app-shells/bash/bash-4.4_p23-r2.ebuild
@@ -3,14 +3,14 @@
 
 EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs multilib prefix
+inherit flag-o-matic toolchain-funcs multilib prefix
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 is_release() {
 	case ${PV} in
 	*_alpha*|*_beta*|*_rc*) return 1 ;;
@@ -19,7 +19,7 @@ is_release() {
 }
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -58,7 +58,7 @@ RDEPEND="
 	${DEPEND}
 "
 # we only need yacc when the .y files get patched (bash42-005)
-#DEPEND+=" virtual/yacc"
+#BDEPEND="virtual/yacc"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -87,8 +87,8 @@ src_prepare() {
 
 	# Clean out local libs so we know we use system ones w/releases.
 	if is_release ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
 		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 	fi
 
@@ -97,7 +97,7 @@ src_prepare() {
 
 	# Avoid regenerating docs after patches #407985
 	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
+	touch -r . doc/* || die
 
 	eapply_user
 }

diff --git a/app-shells/bash/bash-5.0_p18.ebuild b/app-shells/bash/bash-5.0_p18.ebuild
index c40437fdc3a..37017ab2929 100644
--- a/app-shells/bash/bash-5.0_p18.ebuild
+++ b/app-shells/bash/bash-5.0_p18.ebuild
@@ -3,14 +3,14 @@
 
 EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs multilib prefix
+inherit flag-o-matic toolchain-funcs multilib prefix
 
 # Official patchlevel
 # See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
-PLEVEL=${PV##*_p}
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
 is_release() {
 	case ${PV} in
 	*_alpha*|*_beta*|*_rc*) return 1 ;;
@@ -19,7 +19,7 @@ is_release() {
 }
 [[ ${PV} != *_p* ]] && PLEVEL=0
 patches() {
-	local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
+	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
 	[[ ${plevel} -eq 0 ]] && return 1
 	eval set -- {1..${plevel}}
 	set -- $(printf "${pn}${pv/\.}-%03d " "$@")
@@ -58,7 +58,7 @@ RDEPEND="
 	${DEPEND}
 "
 # we only need yacc when the .y files get patched (bash42-005)
-#DEPEND+=" virtual/yacc"
+#BDEPEND="virtual/yacc"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -90,8 +90,8 @@ src_prepare() {
 
 	# Clean out local libs so we know we use system ones w/releases.
 	if is_release ; then
-		rm -rf lib/{readline,termcap}/*
-		touch lib/{readline,termcap}/Makefile.in # for config.status
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
 		sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
 	fi
 
@@ -100,7 +100,7 @@ src_prepare() {
 
 	# Avoid regenerating docs after patches #407985
 	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/*
+	touch -r . doc/* || die
 
 	eapply -p0 "${PATCHES[@]}"
 	eapply_user

diff --git a/app-shells/bash/files/autoconf-mktime-2.59.patch b/app-shells/bash/files/autoconf-mktime-2.59.patch
index 3ac3ad1da86..33055a7be61 100644
--- a/app-shells/bash/files/autoconf-mktime-2.59.patch
+++ b/app-shells/bash/files/autoconf-mktime-2.59.patch
@@ -1,6 +1,6 @@
 http://bugs.gentoo.org/220040
---- configure
-+++ configure
+--- a/configure
++++ b/configure
 @@ -5299,26 +6059,25 @@
  cat >>conftest.$ac_ext <<_ACEOF
  /* end confdefs.h.  */

diff --git a/app-shells/bash/files/bash-3.0-crash.patch b/app-shells/bash/files/bash-3.0-crash.patch
index 984e85d82ed..38577e2a67e 100644
--- a/app-shells/bash/files/bash-3.0-crash.patch
+++ b/app-shells/bash/files/bash-3.0-crash.patch
@@ -14,8 +14,8 @@
 
 Thanks for the report.  Here's a quick fix:
 
-*** arrayfunc.c~	Sat Nov  6 15:08:29 2004
---- arrayfunc.c	Mon Jan 31 11:56:21 2005
+*** a/arrayfunc.c
+--- b/arrayfunc.c
 ***************
 *** 709,713 ****
   	  return ((char *)NULL);

diff --git a/app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch b/app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch
index 35b0b7d0592..46df6213b7a 100644
--- a/app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch
+++ b/app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch
@@ -6,8 +6,8 @@ http://bugs.gentoo.org/92349
 
 Patch from upstream
 
-*** jobs.c  Wed Sep  8 11:08:16 2004
---- jobs.c      Thu Jun 30 17:21:26 2005
+*** a/jobs.c
+--- b/jobs.c
 ***************
 *** 3456,3459 ****
 --- 3901,3907 ----

diff --git a/app-shells/bash/files/bash-3.0-read-builtin-pipe.patch b/app-shells/bash/files/bash-3.0-read-builtin-pipe.patch
index 466e45ae300..0b90cc3dc2b 100644
--- a/app-shells/bash/files/bash-3.0-read-builtin-pipe.patch
+++ b/app-shells/bash/files/bash-3.0-read-builtin-pipe.patch
@@ -7,8 +7,8 @@ http://lists.gnu.org/archive/html/bug-bash/2005-03/msg00168.html
 http://lists.gnu.org/archive/html/bug-bash/2005-03/msg00173.html
 http://bugs.gentoo.org/show_bug.cgi?id=87093
 
---- builtins/read.def
-+++ builtins/read.def
+--- a/builtins/read.def
++++ b/builtins/read.def
 @@ -276,7 +276,7 @@
    input_is_tty = isatty (fd);
    if (input_is_tty == 0)

diff --git a/app-shells/bash/files/bash-3.0-trap-fg-signals.patch b/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
index cde18326ed2..c7010511853 100644
--- a/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
+++ b/app-shells/bash/files/bash-3.0-trap-fg-signals.patch
@@ -2,8 +2,8 @@ Don't barf on handled signals inside of scripts.  Makes for nicer output.
 
 patch by Martin Schlemmer <azarah@gentoo.org>
 
---- jobs.c
-+++ jobs.c
+--- a/jobs.c
++++ b/jobs.c
 @@ -2893,11 +2893,11 @@
  		}
  	      else if (IS_FOREGROUND (job))

diff --git a/app-shells/bash/files/bash-3.0-volatile-command.patch b/app-shells/bash/files/bash-3.0-volatile-command.patch
index 8b89b35914b..87b9f25ffc2 100644
--- a/app-shells/bash/files/bash-3.0-volatile-command.patch
+++ b/app-shells/bash/files/bash-3.0-volatile-command.patch
@@ -4,8 +4,8 @@ Ripped from Debian
 #     being optimized away as dead code.  In reality, the use of setjmp/longjmp
 #     makes it not dead code at all.
 
---- eval.old	2003-12-18 23:44:15.000000000 -0500
-+++ eval.c	2005-10-03 01:59:31.000000000 -0400
+--- a/eval.c
++++ b/eval.c
 @@ -63,7 +63,7 @@
  reader_loop ()
  {

diff --git a/app-shells/bash/files/bash-3.1-ulimit.patch b/app-shells/bash/files/bash-3.1-ulimit.patch
index 432fb54966b..8c2474825cf 100644
--- a/app-shells/bash/files/bash-3.1-ulimit.patch
+++ b/app-shells/bash/files/bash-3.1-ulimit.patch
@@ -3,8 +3,8 @@ Ripped from Fedora
 Add support for RLIMIT_NICE/RLIMIT_RTPRIO and add missing documentation
 for many other options
 
---- builtins/ulimit.def
-+++ builtins/ulimit.def
+--- a/builtins/ulimit.def
++++ b/builtins/ulimit.def
 @@ -24,7 +24,7 @@
  $BUILTIN ulimit
  $FUNCTION ulimit_builtin
@@ -58,8 +58,8 @@ for many other options
  #ifdef RLIMIT_STACK
    { 's',	RLIMIT_STACK, 1024,	"stack size",		"kbytes" },
  #endif
---- doc/bashref.texi
-+++ doc/bashref.texi
+--- a/doc/bashref.texi
++++ b/doc/bashref.texi
 @@ -3833,7 +3833,7 @@
  @item ulimit
  @btindex ulimit
@@ -89,8 +89,8 @@ for many other options
  @item -s
  The maximum stack size.
  
---- doc/bash.1
-+++ doc/bash.1
+--- a/doc/bash.1
++++ b/doc/bash.1
 @@ -8490,7 +8490,7 @@
  returns true if any of the arguments are found, false if
  none are found.

diff --git a/app-shells/bash/files/bash-3.2-process-subst.patch b/app-shells/bash/files/bash-3.2-process-subst.patch
index bd0b3f4e179..94877c62b31 100644
--- a/app-shells/bash/files/bash-3.2-process-subst.patch
+++ b/app-shells/bash/files/bash-3.2-process-subst.patch
@@ -1,7 +1,7 @@
 Fix process substitution on BSD
 
---- execute_cmd.c
-+++ execute_cmd.c
+--- a/execute_cmd.c
++++ b/execute_cmd.c
 @@ -2672,6 +2672,7 @@
  
  	  do_piping (pipe_in, pipe_out);

diff --git a/app-shells/bash/files/bash-3.2-session-leader.patch b/app-shells/bash/files/bash-3.2-session-leader.patch
index 82f7d980633..2e9286f34d4 100644
--- a/app-shells/bash/files/bash-3.2-session-leader.patch
+++ b/app-shells/bash/files/bash-3.2-session-leader.patch
@@ -7,8 +7,8 @@ condition.  A result is that the child can then not then execute some commands
 (like stty) from its init script (e.g. .bashrc).  The result I (and others)
 have seen is that the bash shell will hang while reading the init script.
 
-*** jobs.c.20080704	2008-07-10 15:14:13.000000000 -0400
---- jobs.c	2008-07-10 15:17:59.000000000 -0400
+*** a/jobs.c
+--- b/jobs.c
 ***************
 *** 266,269 ****
 --- 266,270 ----

diff --git a/app-shells/bash/files/bash-3.2-ulimit.patch b/app-shells/bash/files/bash-3.2-ulimit.patch
index a0975cb6e9a..19ea7e6e5e3 100644
--- a/app-shells/bash/files/bash-3.2-ulimit.patch
+++ b/app-shells/bash/files/bash-3.2-ulimit.patch
@@ -1,7 +1,7 @@
 add missing docs for -e and -r options
 
---- builtins/ulimit.def
-+++ builtins/ulimit.def
+--- a/builtins/ulimit.def
++++ b/builtins/ulimit.def
 @@ -24,7 +24,7 @@
  $BUILTIN ulimit
  $FUNCTION ulimit_builtin

diff --git a/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch b/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch
index 576a8a47a61..3c5b5dd98d9 100644
--- a/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch
+++ b/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch
@@ -4,8 +4,8 @@ executable files when run by root on FreeBSD.
 See http://bugs.gentoo.org/303411
 
 Patch from Johan Hattne <johan.hattne@utsuthwestern.edu>
---- lib/sh/eaccess.c.orig
-+++ lib/sh/eaccess.c
+--- a/lib/sh/eaccess.c.orig
++++ b/lib/sh/eaccess.c
 @@ -198,11 +198,19 @@
       char *path;
       int mode;

diff --git a/app-shells/bash/files/bash-4.2-dev-fd-buffer-overflow.patch b/app-shells/bash/files/bash-4.2-dev-fd-buffer-overflow.patch
index bef960ab980..d50c269b7e7 100644
--- a/app-shells/bash/files/bash-4.2-dev-fd-buffer-overflow.patch
+++ b/app-shells/bash/files/bash-4.2-dev-fd-buffer-overflow.patch
@@ -20,8 +20,8 @@ buffer to avoid buffer overflow.
 
 Patch (apply with `patch -p0'):
 
-*** ../bash-4.2-patched/lib/sh/eaccess.c	2011-01-08 20:50:10.000000000 -0500
---- lib/sh/eaccess.c	2012-06-04 21:06:43.000000000 -0400
+*** bash-4.2/lib/sh/eaccess.c
+--- bash-4.2/lib/sh/eaccess.c
 ***************
 *** 83,86 ****
 --- 83,88 ----

diff --git a/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch b/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch
index c6ef19d03f5..cc6b622eca3 100644
--- a/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch
+++ b/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch
@@ -1,8 +1,8 @@
 https://bugs.gentoo.org/600174
 https://lists.gnu.org/archive/html/bug-bash/2016-11/msg00099.html
 
-*** ../bash-4.4-patched/builtins/pushd.def	2016-01-25 13:31:49.000000000 -0500
---- builtins/pushd.def	2016-10-28 10:46:49.000000000 -0400
+*** bash-4.4/builtins/pushd.def
+--- bash-4.4/builtins/pushd.def
 ***************
 *** 366,370 ****
       }

diff --git a/app-shells/bash/files/bash-4.x-deferred-heredocs.patch b/app-shells/bash/files/bash-4.x-deferred-heredocs.patch
index 698d277a3db..c6a6de44d36 100644
--- a/app-shells/bash/files/bash-4.x-deferred-heredocs.patch
+++ b/app-shells/bash/files/bash-4.x-deferred-heredocs.patch
@@ -3,8 +3,8 @@ http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00063.html
 
 fix heredocs handling in `set` output
 
-*** ../bash-4.1-patched/print_cmd.c	2009-09-16 15:32:26.000000000 -0400
---- print_cmd.c	2010-03-22 21:15:30.000000000 -0400
+*** bash-4.1/print_cmd.c
+--- bash-4.1/print_cmd.c
 ***************
 *** 114,117 ****
 --- 114,123 ----


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2022-10-08 22:08 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2022-10-08 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     f311a77983e608c3218f492ece715bced27f77a0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  8 22:07:20 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 22:08:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f311a779

app-shells/bash: reorganise 5.2_p2-r2 patches

Just splits the patches from 47950445cddff736a1e6c0c1346a20ab6b326cc1
into two.

Closes: https://bugs.gentoo.org/873931
See: 47950445cddff736a1e6c0c1346a20ab6b326cc1
Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.2_p2-r2.ebuild              |  3 +-
 ...r-brackets-in-nested-parameter-expansions.patch | 41 ++++++++++++++++++++++
 ...h-5.2_p2-fixes-for-extglob-in-compat-mode.patch | 38 --------------------
 3 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/app-shells/bash/bash-5.2_p2-r2.ebuild b/app-shells/bash/bash-5.2_p2-r2.ebuild
index 897cf5324a38..c79b71ca70ef 100644
--- a/app-shells/bash/bash-5.2_p2-r2.ebuild
+++ b/app-shells/bash/bash-5.2_p2-r2.ebuild
@@ -108,7 +108,8 @@ PATCHES=(
 
 	# Patches from Chet sent to bash-bug ml
 	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
-	"${FILESDIR}"/${PN}-5.2_p2-fixes-for-extglob-in-compat-mode.patch
+	"${FILESDIR}"/${P}-fix-for-brackets-in-nested-parameter-expansions.patch
+	"${FILESDIR}"/${P}-fixes-for-extglob-in-compat-mode.patch
 )
 
 pkg_setup() {

diff --git a/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch b/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch
new file mode 100644
index 000000000000..9c1b03f8b2df
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch
@@ -0,0 +1,41 @@
+https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=22f21b760ed90eb77c3756e6ccf39b73c84f532a
+
+--- subst.c
++++ subst.c
+@@ -1798,6 +1798,9 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags)
+   return (result);
+ }
+ 
++#define PARAMEXPNEST_MAX	32	// for now
++static int dbstate[PARAMEXPNEST_MAX];
++
+ /* Extract a parameter expansion expression within ${ and } from STRING.
+    Obey the Posix.2 rules for finding the ending `}': count braces while
+    skipping over enclosed quoted strings and command substitutions.
+@@ -1828,6 +1831,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
+   if (quoted == Q_HERE_DOCUMENT && dolbrace_state == DOLBRACE_QUOTE && (flags & SX_NOALLOC) == 0)
+     return (extract_heredoc_dolbrace_string (string, sindex, quoted, flags));
+ 
++  dbstate[0] = dolbrace_state;
++
+   pass_character = 0;
+   nesting_level = 1;
+   slen = strlen (string + *sindex) + *sindex;
+@@ -1852,6 +1857,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
+ 
+       if (string[i] == '$' && string[i+1] == LBRACE)
+ 	{
++	  if (nesting_level < PARAMEXPNEST_MAX)
++	    dbstate[nesting_level] = dolbrace_state;
+ 	  nesting_level++;
+ 	  i += 2;
+ 	  if (dolbrace_state == DOLBRACE_QUOTE || dolbrace_state == DOLBRACE_WORD)
+@@ -1864,6 +1871,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
+ 	  nesting_level--;
+ 	  if (nesting_level == 0)
+ 	    break;
++	  dolbrace_state = (nesting_level < PARAMEXPNEST_MAX) ? dbstate[nesting_level] : dbstate[0];	/* Guess using initial state */
+ 	  i++;
+ 	  continue;
+ 	}
+

diff --git a/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
index 06415b5cdaa4..16393c79af8b 100644
--- a/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
+++ b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
@@ -213,44 +213,6 @@ https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=22f21b760ed90eb77c
  
     This file is part of GNU Bash, the Bourne Again SHell.
  
---- subst.c
-+++ subst.c
-@@ -1798,6 +1798,9 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags)
-   return (result);
- }
- 
-+#define PARAMEXPNEST_MAX	32	// for now
-+static int dbstate[PARAMEXPNEST_MAX];
-+
- /* Extract a parameter expansion expression within ${ and } from STRING.
-    Obey the Posix.2 rules for finding the ending `}': count braces while
-    skipping over enclosed quoted strings and command substitutions.
-@@ -1828,6 +1831,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
-   if (quoted == Q_HERE_DOCUMENT && dolbrace_state == DOLBRACE_QUOTE && (flags & SX_NOALLOC) == 0)
-     return (extract_heredoc_dolbrace_string (string, sindex, quoted, flags));
- 
-+  dbstate[0] = dolbrace_state;
-+
-   pass_character = 0;
-   nesting_level = 1;
-   slen = strlen (string + *sindex) + *sindex;
-@@ -1852,6 +1857,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
- 
-       if (string[i] == '$' && string[i+1] == LBRACE)
- 	{
-+	  if (nesting_level < PARAMEXPNEST_MAX)
-+	    dbstate[nesting_level] = dolbrace_state;
- 	  nesting_level++;
- 	  i += 2;
- 	  if (dolbrace_state == DOLBRACE_QUOTE || dolbrace_state == DOLBRACE_WORD)
-@@ -1864,6 +1871,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
- 	  nesting_level--;
- 	  if (nesting_level == 0)
- 	    break;
-+	  dolbrace_state = (nesting_level < PARAMEXPNEST_MAX) ? dbstate[nesting_level] : dbstate[0];	/* Guess using initial state */
- 	  i++;
- 	  continue;
- 	}
 --- tests/extglob.right
 +++ tests/extglob.right
 @@ -182,3 +182,10 @@ no dotglob: .a .foo bar


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2022-11-24  2:41 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2022-11-24  2:41 UTC (permalink / raw
  To: gentoo-commits

commit:     7e76039814e8fd90df70b0d63e9c8832629d966b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 24 02:37:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 24 02:40:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e760398

app-shells/bash: drop 5.2_p9-r1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.2_p9-r1.ebuild              | 345 ---------------------
 ...ash-5.2_p9-fix-for-extglob-in-compat-mode.patch |  42 ---
 2 files changed, 387 deletions(-)

diff --git a/app-shells/bash/bash-5.2_p9-r1.ebuild b/app-shells/bash/bash-5.2_p9-r1.ebuild
deleted file mode 100644
index 4d87e7c40c59..000000000000
--- a/app-shells/bash/bash-5.2_p9-r1.ebuild
+++ /dev/null
@@ -1,345 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-# Official patchlevel
-# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
-PLEVEL="${PV##*_p}"
-MY_PV="${PV/_p*}"
-MY_PV="${MY_PV/_/-}"
-MY_P="${PN}-${MY_PV}"
-MY_PATCHES=()
-
-is_release() {
-	case ${PV} in
-		9999|*_alpha*|*_beta*|*_rc*)
-			return 1
-			;;
-		*)
-			return 0
-			;;
-	esac
-}
-
-[[ ${PV} != *_p* ]] && PLEVEL=0
-
-# The version of readline this bash normally ships with.
-# Note: right now, we don't use the system copy of readline for bash for non-releases.
-READLINE_VER="8.2_p1"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]] ; then
-	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
-	EGIT_BRANCH=devel
-	inherit git-r3
-elif is_release ; then
-	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
-	SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
-
-	if [[ ${PLEVEL} -gt 0 ]] ; then
-		# bash-5.1 -> bash51
-		my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
-
-		patch_url=
-		my_patch_index=
-
-		for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
-			for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
-				patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
-				SRC_URI+=" ${patch_url}"
-				SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
-			done
-
-			MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
-		done
-
-		unset my_pn patch_url my_patch_index
-	fi
-else
-	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
-	SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
-fi
-
-if [[ -n ${GENTOO_PATCH_VER} ]] ; then
-	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
-fi
-
-LICENSE="GPL-3+"
-SLOT="0"
-if is_release ; then
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
-	>=sys-libs/ncurses-5.2-r2:=
-	nls? ( virtual/libintl )
-"
-if is_release ; then
-	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
-	${DEPEND}
-"
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
-BDEPEND="
-	virtual/yacc
-	pgo? ( dev-util/gperf )
-	verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-S="${WORKDIR}/${MY_P}"
-
-# EAPI 8 tries to append it but it doesn't exist here
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
-	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
-	# Patches from Chet sent to bash-bug ml
-	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
-	"${FILESDIR}"/${P}-fix-for-extglob-in-compat-mode.patch
-)
-
-pkg_setup() {
-	# bug #7332
-	if is-flag -malign-double ; then
-		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
-		eerror "as it breaks LFS (struct stat64) on x86."
-		die "remove -malign-double from your CFLAGS mr ricer"
-	fi
-
-	if use bashlogger ; then
-		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
-		ewarn "This will log ALL output you enter into the shell, you have been warned."
-	fi
-}
-
-src_unpack() {
-	if [[ ${PV} == 9999 ]] ; then
-		git-r3_src_unpack
-	else
-		if use verify-sig ; then
-			verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
-		fi
-
-		unpack ${MY_P}.tar.gz
-
-		if [[ -n ${GENTOO_PATCH_VER} ]] ; then
-			unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
-		fi
-	fi
-}
-
-src_prepare() {
-	# Include official patches
-	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
-
-	# Clean out local libs so we know we use system ones w/releases.
-	if is_release ; then
-		rm -rf lib/{readline,termcap}/* || die
-		touch lib/{readline,termcap}/Makefile.in || die # for config.status
-		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
-	fi
-
-	# Prefixify hardcoded path names. No-op for non-prefix.
-	hprefixify pathnames.h.in
-
-	# Avoid regenerating docs after patches, bug #407985
-	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
-	touch -r . doc/* || die
-
-	eapply -p0 "${PATCHES[@]}"
-	eapply_user
-}
-
-src_configure() {
-	local myconf=(
-		--disable-profiling
-
-		# Force linking with system curses ... the bundled termcap lib
-		# sucks bad compared to ncurses.  For the most part, ncurses
-		# is here because readline needs it.  But bash itself calls
-		# ncurses in one or two small places :(.
-		--with-curses
-
-		$(use_enable mem-scramble)
-		$(use_enable net net-redirections)
-		$(use_enable readline)
-		$(use_enable readline bang-history)
-		$(use_enable readline history)
-		$(use_with afs)
-		$(use_with mem-scramble bash-malloc)
-	)
-
-	# For descriptions of these, see config-top.h
-	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
-	append-cppflags \
-		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-		-DNON_INTERACTIVE_LOGIN_SHELLS \
-		-DSSH_SOURCE_BASHRC \
-		$(use bashlogger && echo -DSYSLOG_HISTORY)
-
-	# Don't even think about building this statically without
-	# reading bug #7714 first.  If you still build it statically,
-	# don't come crying to us with bugs ;).
-	#use static && export LDFLAGS="${LDFLAGS} -static"
-	use nls || myconf+=( --disable-nls )
-
-	if is_release ; then
-		# Historically, we always used the builtin readline, but since
-		# our handling of SONAME upgrades has gotten much more stable
-		# in the PM (and the readline ebuild itself preserves the old
-		# libs during upgrades), linking against the system copy should
-		# be safe.
-		# Exact cached version here doesn't really matter as long as it
-		# is at least what's in the DEPEND up above.
-		export ac_cv_rl_version=${READLINE_VER%%_*}
-
-		# Use system readline only with released versions.
-		myconf+=( --with-installed-readline=. )
-	fi
-
-	if use plugins ; then
-		append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
-	else
-		# Disable the plugins logic by hand since bash doesn't
-		# provide a way of doing it.
-		export ac_cv_func_dl{close,open,sym}=no \
-			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
-		sed -i \
-			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
-			configure || die
-	fi
-
-	# bug #444070
-	tc-export AR
-
-	econf "${myconf[@]}"
-}
-
-src_compile() {
-	if use pgo ; then
-		# Build Bash and run its tests to generate profiles.
-		emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo"
-
-		# Used in test suite.
-		unset A
-
-		emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check
-
-		# Rebuild Bash using the profiling data we just generated.
-		emake clean
-		emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo"
-
-		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others
-	else
-		emake
-
-		use plugins && emake -C examples/loadables all others
-	fi
-}
-
-src_test() {
-	# Used in test suite.
-	unset A
-
-	default
-}
-
-src_install() {
-	local d f
-
-	default
-
-	dodir /bin
-	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
-	dosym bash /bin/rbash
-
-	insinto /etc/bash
-	doins "${FILESDIR}"/bash_logout
-	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
-
-	keepdir /etc/bash/bashrc.d
-
-	insinto /etc/skel
-	for f in bash{_logout,_profile,rc} ; do
-		newins "${FILESDIR}"/dot-${f} .${f}
-	done
-
-	local sed_args=(
-		-e "s:#${USERLAND}#@::"
-		-e '/#@/d'
-	)
-
-	if ! use readline ; then
-		# bug #432338
-		sed_args+=(
-			-e '/^shopt -s histappend/s:^:#:'
-			-e 's:use_color=true:use_color=false:'
-		)
-	fi
-
-	sed -i \
-		"${sed_args[@]}" \
-		"${ED}"/etc/skel/.bashrc \
-		"${ED}"/etc/bash/bashrc || die
-
-	if use plugins ; then
-		exeinto /usr/$(get_libdir)/bash
-		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
-
-		insinto /usr/include/bash-plugins
-		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
-	fi
-
-	if use examples ; then
-		for d in examples/{functions,misc,scripts,startup-files} ; do
-			exeinto /usr/share/doc/${PF}/${d}
-			docinto ${d}
-			for f in ${d}/* ; do
-				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
-					doexe ${f}
-				else
-					dodoc ${f}
-				fi
-			done
-		done
-	fi
-
-	# Install bash_builtins.1 and rbash.1
-	emake -C doc DESTDIR="${D}" install_builtins
-	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
-	doman "${T}"/rbash.1
-
-	newdoc CWRU/changelog ChangeLog
-	dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
-	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
-		mkdir -p "${EROOT}"/etc/bash
-		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
-	fi
-}
-
-pkg_postinst() {
-	# If /bin/sh does not exist, provide it
-	if [[ ! -e ${EROOT}/bin/sh ]] ; then
-		ln -sf bash "${EROOT}"/bin/sh
-	fi
-}

diff --git a/app-shells/bash/files/bash-5.2_p9-fix-for-extglob-in-compat-mode.patch b/app-shells/bash/files/bash-5.2_p9-fix-for-extglob-in-compat-mode.patch
deleted file mode 100644
index 440800666870..000000000000
--- a/app-shells/bash/files/bash-5.2_p9-fix-for-extglob-in-compat-mode.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00039.html
-https://bugs.gentoo.org/873931
-
-*** ../bash-5.2-patched/parse.y	2022-08-31 11:47:03.000000000 -0400
---- parse.y	2022-10-05 11:55:18.000000000 -0400
-***************
-*** 4230,4234 ****
-    sh_parser_state_t ps;
-    sh_input_line_state_t ls;
-!   int orig_ind, nc, sflags, start_lineno;
-    char *ret, *ep, *ostring;
-  
---- 4230,4234 ----
-    sh_parser_state_t ps;
-    sh_input_line_state_t ls;
-!   int orig_ind, nc, sflags, start_lineno, local_extglob;
-    char *ret, *ep, *ostring;
-  
-***************
-*** 4273,4277 ****
-    expand_aliases = 0;
-  #if defined (EXTENDED_GLOB)
-!   global_extglob = extended_glob;		/* for reset_parser() */
-  #endif
-  
---- 4273,4277 ----
-    expand_aliases = 0;
-  #if defined (EXTENDED_GLOB)
-!   local_extglob = global_extglob = extended_glob;	/* for reset_parser() */
-  #endif
-  
-***************
-*** 4291,4294 ****
---- 4291,4297 ----
-    restore_parser_state (&ps);
-  
-+ #if defined (EXTENDED_GLOB)
-+   extended_glob = local_extglob;
-+ #endif
-    token_to_read = 0;
-  
-


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2023-01-11  7:50 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2023-01-11  7:50 UTC (permalink / raw
  To: gentoo-commits

commit:     c834e23a32d262a415a7d553e5bd6c6460b0d38a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 11 07:43:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 11 07:48:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c834e23a

app-shells/bash: backport random UB fix

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.2_p15-r1.ebuild             | 354 +++++++++++++++++++++
 app-shells/bash/files/bash-5.2_p15-random-ub.patch |  13 +
 2 files changed, 367 insertions(+)

diff --git a/app-shells/bash/bash-5.2_p15-r1.ebuild b/app-shells/bash/bash-5.2_p15-r1.ebuild
new file mode 100644
index 000000000000..5fad0049fc09
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p15-r1.ebuild
@@ -0,0 +1,354 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+MY_PATCHES=()
+
+is_release() {
+	case ${PV} in
+		9999|*_alpha*|*_beta*|*_rc*)
+			return 1
+			;;
+		*)
+			return 0
+			;;
+	esac
+}
+
+[[ ${PV} != *_p* ]] && PLEVEL=0
+
+# The version of readline this bash normally ships with.
+# Note: right now, we don't use the system copy of readline for bash for non-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+	EGIT_BRANCH=devel
+	inherit git-r3
+elif is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
+
+	if [[ ${PLEVEL} -gt 0 ]] ; then
+		# bash-5.1 -> bash51
+		my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
+
+		patch_url=
+		my_patch_index=
+
+		for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
+			for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
+				patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
+				SRC_URI+=" ${patch_url}"
+				SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
+			done
+
+			MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
+		done
+
+		unset my_pn patch_url my_patch_index
+	fi
+else
+	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
+fi
+
+if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+if is_release ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:=
+	nls? ( virtual/libintl )
+"
+if is_release ; then
+	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+	${DEPEND}
+"
+# We only need yacc when the .y files get patched (bash42-005, bash51-011)
+BDEPEND="
+	app-alternatives/yacc
+	pgo? ( dev-util/gperf )
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# EAPI 8 tries to append it but it doesn't exist here
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+	# Patches from Chet sent to bash-bug ml
+	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+	"${FILESDIR}"/${PN}-5.2_p15-random-ub.patch
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double ; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+	else
+		if use verify-sig ; then
+			verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
+
+			local patch
+			for patch in "${MY_PATCHES[@]}" ; do
+				verify-sig_verify_detached ${patch}{,.sig}
+			done
+		fi
+
+		unpack ${MY_P}.tar.gz
+
+		if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+			unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
+		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/* || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading bug #7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	if is_release ; then
+		# Historically, we always used the builtin readline, but since
+		# our handling of SONAME upgrades has gotten much more stable
+		# in the PM (and the readline ebuild itself preserves the old
+		# libs during upgrades), linking against the system copy should
+		# be safe.
+		# Exact cached version here doesn't really matter as long as it
+		# is at least what's in the DEPEND up above.
+		export ac_cv_rl_version=${READLINE_VER%%_*}
+
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins ; then
+		append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	if use pgo ; then
+		# Build Bash and run its tests to generate profiles.
+		emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo"
+
+		# Used in test suite.
+		unset A
+
+		emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check
+
+		if tc-is-clang; then
+			llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+		fi
+
+		# Rebuild Bash using the profiling data we just generated.
+		emake clean
+		emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo"
+
+		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others
+	else
+		emake
+
+		use plugins && emake -C examples/loadables all others
+	fi
+}
+
+src_test() {
+	# Used in test suite.
+	unset A
+
+	default
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+
+	keepdir /etc/bash/bashrc.d
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+
+	if ! use readline ; then
+		# bug #432338
+		sed_args+=(
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			docinto ${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					dodoc ${f}
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.2_p15-random-ub.patch b/app-shells/bash/files/bash-5.2_p15-random-ub.patch
new file mode 100644
index 000000000000..d4dc060b510a
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p15-random-ub.patch
@@ -0,0 +1,13 @@
+https://lists.gnu.org/archive/html/bug-bash/2023-01/msg00016.html
+https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=0647e53bd15c8982d89a03c2db1643aedd7cd649
+
+--- lib/sh/random.c
++++ lib/sh/random.c
+@@ -75,7 +75,7 @@ u_bits32_t last;
+   /* Can't seed with 0. */
+   ret = (last == 0) ? 123459876 : last;
+   h = ret / 127773;
+-  l = ret - (127773 * h);
++  l = ret % 127773;
+   t = 16807 * l - 2836 * h;
+   ret = (t < 0) ? t + 0x7fffffff : t;


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2023-02-28  3:20 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2023-02-28  3:20 UTC (permalink / raw
  To: gentoo-commits

commit:     f70b4736f5aa8521c18c1ef39e5d3dcf6d592544
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 28 03:19:00 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 28 03:19:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f70b4736

app-shells/bash: backport clang 16 configure fix to 5.1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.1_p16-r3.ebuild             | 315 +++++++++++++++++++++
 .../files/bash-5.1_p16-configure-clang16.patch     |  37 +++
 2 files changed, 352 insertions(+)

diff --git a/app-shells/bash/bash-5.1_p16-r3.ebuild b/app-shells/bash/bash-5.1_p16-r3.ebuild
new file mode 100644
index 000000000000..9ff113498a62
--- /dev/null
+++ b/app-shells/bash/bash-5.1_p16-r3.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset
+GENTOO_PATCH_DEV="sam"
+GENTOO_PATCH_VER="${PV}"
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+MY_PATCHES=()
+
+is_release() {
+	case ${PV} in
+		*_alpha*|*_beta*|*_rc*)
+			return 1
+			;;
+		*)
+			return 0
+			;;
+	esac
+}
+
+[[ ${PV} != *_p* ]] && PLEVEL=0
+
+# The version of readline this bash normally ships with.
+READLINE_VER="8.1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html"
+
+if is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
+
+	if [[ ${PLEVEL} -gt 0 ]] ; then
+		# bash-5.1 -> bash51
+		my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
+
+	        patch_url=
+		my_patch_index=
+
+		for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
+			for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
+				patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
+				SRC_URI+=" ${patch_url}"
+				SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
+
+			done
+
+			MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
+		done
+
+		unset my_pn patch_url my_patch_index
+	fi
+else
+	SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
+fi
+
+if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+[[ "${PV}" == *_rc* ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:0=
+	nls? ( virtual/libintl )
+	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
+"
+RDEPEND="
+	${DEPEND}
+"
+# We only need yacc when the .y files get patched (bash42-005, bash51-011)
+BDEPEND="app-alternatives/yacc
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	# Patches from Chet sent to bashbug ml
+	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-5.0-syslog-history-extern.patch
+
+	"${FILESDIR}"/${PN}-5.1_p16-configure-clang16.patch
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double ; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+	else
+		if use verify-sig ; then
+			verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
+
+			local patch
+			for patch in "${MY_PATCHES[@]}" ; do
+				verify-sig_verify_detached ${patch}{,.sig}
+			done
+		fi
+
+		unpack ${MY_P}.tar.gz
+
+		if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+			unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
+		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/* || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading bug #7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	# Historically, we always used the builtin readline, but since
+	# our handling of SONAME upgrades has gotten much more stable
+	# in the PM (and the readline ebuild itself preserves the old
+	# libs during upgrades), linking against the system copy should
+	# be safe.
+	# Exact cached version here doesn't really matter as long as it
+	# is at least what's in the DEPEND up above.
+	export ac_cv_rl_version=${READLINE_VER%%_*}
+
+	if is_release ; then
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins ; then
+		append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	emake
+
+	if use plugins ; then
+		emake -C examples/loadables all others
+	fi
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+
+	keepdir /etc/bash/bashrc.d
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e "s:#${USERLAND}#@::"
+		-e '/#@/d'
+	)
+
+	if ! use readline ; then
+		# bug #432338
+		sed_args+=(
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			docinto ${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					dodoc ${f}
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.1_p16-configure-clang16.patch b/app-shells/bash/files/bash-5.1_p16-configure-clang16.patch
new file mode 100644
index 000000000000..8d77fbd968a7
--- /dev/null
+++ b/app-shells/bash/files/bash-5.1_p16-configure-clang16.patch
@@ -0,0 +1,37 @@
+https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00000.html)
+
+From 2cdf8b42885189b3cf7c47096b01f104e520546a Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 2 Feb 2023 05:43:37 +0000
+Subject: [PATCH] aclocal.m4: fix -Wimplicit-function-declaration in dup2 check
+
+dup2 requires a <unistd.h> include. Fixes the following when diffing config.log
+ when testing with a stricter compiler:
+```
+-warning: call to undeclared function 'dup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
++error: call to undeclared function 'dup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+```
+--- aclocal.m4
++++ aclocal.m4
+@@ -284,6 +284,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken,
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
+ int
+ main()
+ {
+--- configure
++++ configure
+@@ -16990,6 +16990,9 @@ else
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
+ int
+ main()
+ {


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2024-01-08 17:14 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2024-01-08 17:14 UTC (permalink / raw
  To: gentoo-commits

commit:     0cf3adc18c761e0e85543ace7bfcfe5fa1a66d92
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  8 17:12:22 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan  8 17:12:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cf3adc1

app-shells/bash: backport memory leak fix for 5.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.2_p21-r2.ebuild             | 375 +++++++++++++++++++++
 .../bash/files/bash-5.2_p21-memory-leak.patch      |  18 +
 2 files changed, 393 insertions(+)

diff --git a/app-shells/bash/bash-5.2_p21-r2.ebuild b/app-shells/bash/bash-5.2_p21-r2.ebuild
new file mode 100644
index 000000000000..6a1506f3ea13
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p21-r2.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+MY_PATCHES=()
+
+is_release() {
+	case ${PV} in
+		9999|*_alpha*|*_beta*|*_rc*)
+			return 1
+			;;
+		*)
+			return 0
+			;;
+	esac
+}
+
+[[ ${PV} != *_p* ]] && PLEVEL=0
+
+# The version of readline this bash normally ships with.
+# Note: right now, we don't use the system copy of readline for bash for non-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+	EGIT_BRANCH=devel
+	inherit git-r3
+elif is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
+
+	if [[ ${PLEVEL} -gt 0 ]] ; then
+		# bash-5.1 -> bash51
+		my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
+
+		patch_url=
+		my_patch_index=
+
+		upstream_url_base="mirror://gnu/bash"
+		mirror_url_base="ftp://ftp.cwru.edu/pub/bash"
+
+		for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
+			printf -v mangled_patch_ver ${my_p}-%03d ${my_patch_index}
+			patch_url="${upstream_url_base}/${MY_P}-patches/${mangled_patch_ver}"
+
+			SRC_URI+=" ${patch_url}"
+			SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
+
+			# Add in the mirror URL too.
+			SRC_URI+=" ${patch_url/${upstream_url_base}/${mirror_url_base}}"
+			SRC_URI+=" verify-sig? ( ${patch_url/${upstream_url_base}/${mirror_url_base}} )"
+
+			MY_PATCHES+=( "${DISTDIR}"/${mangled_patch_ver} )
+		done
+
+		unset my_p patch_url my_patch_index upstream_url_base mirror_url_base
+	fi
+else
+	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
+fi
+
+if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+if is_release ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:=
+	nls? ( virtual/libintl )
+"
+if is_release ; then
+	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+	${DEPEND}
+"
+# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011)
+BDEPEND="
+	pgo? ( dev-util/gperf )
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# EAPI 8 tries to append it but it doesn't exist here
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+	# Patches from Chet sent to bash-bug ml
+	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+	"${FILESDIR}"/${PN}-5.2_p15-random-ub.patch
+	"${FILESDIR}"/${PN}-5.2_p15-configure-clang16.patch
+	"${FILESDIR}"/${PN}-5.2_p21-wpointer-to-int.patch
+	"${FILESDIR}"/${PN}-5.2_p21-configure-strtold.patch
+	"${FILESDIR}"/${PN}-5.2_p21-memory-leak.patch
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double ; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+	else
+		if use verify-sig ; then
+			verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
+
+			local patch
+			for patch in "${MY_PATCHES[@]}" ; do
+				verify-sig_verify_detached ${patch}{,.sig}
+			done
+		fi
+
+		unpack ${MY_P}.tar.gz
+
+		if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+			unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
+		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/* || die
+
+	# Sometimes hangs (more noticeable w/ pgo), bug #907403.
+	rm tests/run-jobs || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	# Upstream only test with Bison and require GNUisms like YYEOF and
+	# YYERRCODE. The former at least may be in POSIX soon:
+	# https://www.austingroupbugs.net/view.php?id=1269.
+	# configure warns on use of non-Bison but doesn't abort. The result
+	# may misbehave at runtime.
+	unset YACC
+
+	local myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading bug #7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	if is_release ; then
+		# Historically, we always used the builtin readline, but since
+		# our handling of SONAME upgrades has gotten much more stable
+		# in the PM (and the readline ebuild itself preserves the old
+		# libs during upgrades), linking against the system copy should
+		# be safe.
+		# Exact cached version here doesn't really matter as long as it
+		# is at least what's in the DEPEND up above.
+		export ac_cv_rl_version=${READLINE_VER%%_*}
+
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins ; then
+		append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	# -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+	# See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+	local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/pgo -fprofile-generate=${T}/pgo $(test-flags-CC -fprofile-partial-training)")
+	local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo $(test-flags-CC -fprofile-partial-training)")
+
+	emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+	use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags}" all others
+
+	# Build Bash and run its tests to generate profiles.
+	if use pgo ; then
+		# Used in test suite.
+		unset A
+
+		emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
+
+		if tc-is-clang; then
+			llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+		fi
+
+		# Rebuild Bash using the profiling data we just generated.
+		emake clean
+		emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags}" all others
+	fi
+}
+
+src_test() {
+	# Used in test suite.
+	unset A
+
+	default
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+
+	keepdir /etc/bash/bashrc.d
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e 's:#GNU#@::'
+		-e '/#@/d'
+	)
+
+	if ! use readline ; then
+		# bug #432338
+		sed_args+=(
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			docinto ${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					dodoc ${f}
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.2_p21-memory-leak.patch b/app-shells/bash/files/bash-5.2_p21-memory-leak.patch
new file mode 100644
index 000000000000..19c25e95ea7b
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p21-memory-leak.patch
@@ -0,0 +1,18 @@
+https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00011.html
+https://git.savannah.gnu.org/cgit/bash.git/diff/builtins/evalstring.c?h=devel&id=81f7b44564cd1510788035cea7c59631865a7db2&dt=1#n766
+
+*** builtins/evalstring.c   Tue Dec 13 12:53:21 2022
+--- builtins/evalstring.c       Tue Nov 28 17:25:39 2023
+***************
+*** 763,766 ****
+--- 773,779 ----
+    if (fnp)
+      *fnp = fn;
++   else
++     free (fn);
++
+    return fd;
+  }
+
+
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2024-01-14  2:30 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2024-01-14  2:30 UTC (permalink / raw
  To: gentoo-commits

commit:     45393b3f565745cf2a002ca96b36d94759c55c9e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 14 02:29:14 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 02:29:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45393b3f

app-shells/bash: add 5.2_p26

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/Manifest                           |  10 +
 app-shells/bash/bash-5.2_p26.ebuild                | 375 +++++++++++++++++++++
 .../bash/files/bash-5.2_p26-memory-leaks.patch     | 136 ++++++++
 3 files changed, 521 insertions(+)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index c4530d8443f3..639407e73561 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -415,3 +415,13 @@ DIST bash52-020 1459 BLAKE2B de3e38dbb2395c765767aed516ae3d143e3187a44964f90c587
 DIST bash52-020.sig 95 BLAKE2B 8fd778b381cc14d17de8f2b7e215fa0d35c569a90d46fac77c0a94bea525bd62428663f0a908e64ff773bd4caf0aab7f92c2dda1f4158aacbd53f053be91d16d SHA512 0ae6d9189329e560a89af9f42f0f98126faeb15d29bd327e6bd7694870a9bcfae3d3d545e42baf4223dcc732a50d46e4c22477c41b98be85736bb05a359eeeec
 DIST bash52-021 1890 BLAKE2B cc2d886da8c51eb7bdbed694423eae29dc05dc2c7bd0cd41b9ee3acbc56ef135043bb48275c4162d33d2d4051a0a8b27f3aec097335b9d15e38fd841a6793f71 SHA512 c3a61e975819919d7ba120f322fc5e9a420b21f03d7bf989a5e7b6a99bfe35372744277040e88361ee383ab53b05d607d52ff2000b401de038af67c91728b48f
 DIST bash52-021.sig 95 BLAKE2B 79572b14f423f0a96e89d106c5ed448c2b447760e99c743354bd6315132325c19312cfcad98f94c42d3094bb4283c1f7753ac4d3c600d46c63e49d0f7cc3befd SHA512 4063559edade78d1510c12b825aa29925e515807b447e50fe564770ee26ddf34e18b47132e5154a4c883043cc80b3d6415e4ba370bad308a17dc0f6b53fc61c5
+DIST bash52-022 1305 BLAKE2B 2e0cc2255c0313ab85547363d7dd060d460db44131b698235275413c51e79cdc33b77064f84d56e75a0951fc62f947482c2f317a0d4f732822a4ffaed943a9cd SHA512 12a669f3b6ba936be31a85c50bfe52689f3deea02eedb31100ab113b1e74d8104934e615965b4bf7f3b1cf5ad71870211b0bd910bf0862e8ce603505b4b1db3f
+DIST bash52-022.sig 95 BLAKE2B 423bcd005987dae027e29c873edecda0cf51cdcb4bb652b1577c28258602e2a34cfecbc38383068fc95f6e1e0e558bc6de64a225a9e7392f05518a9190237d3f SHA512 f3af8e4ea507b53dd979f597cfde69bd59bf4b7229fd0058c299a2c1abb36182b3a38b8630a81e0654f8da8bc47725459ddf32031ab1a5615105651c14640167
+DIST bash52-023 1817 BLAKE2B 9727ad8cf219ba906021f833cacbbccf6c5b9c94decf861a5f40627680ac3d19d65eaeafecd575545dc7eb538f27b0ecc55a7462b49d226751ad14fb2f40e825 SHA512 59a2e9e4ee4938ba868552eecdbed5f5d797e143bf6f69fde5c50a4e478c19ce36d562b9f51f65d7da5fe216050276bfe1eb430c151c845cffa77d3fdc9ce771
+DIST bash52-023.sig 95 BLAKE2B 84621d203ab68da6a6e5a36fe31160e463fda864620a94fec99f0be3c18df6c465adf2179f3bc99cae2627058d174e3b3d35d473836609252ae41527857e6464 SHA512 b17a8718467e1aee6d47d01b8bcad0892b3c7369f17794604481b655b3404b6f0970aabf5d29b6898e598530946ccdf3e2bddbfb02a7e033927a9be2686aa246
+DIST bash52-024 2298 BLAKE2B f9113fcb1b8ee8d96744e45f020fd8ec49546d6a29883544f4d4a4ef1087b764de6e7c37c760ac709370cdace9619aec84f03713be5e6bc9a9e90d97dd35caa0 SHA512 ff77920ba4c8df7cb8841d94f483a5678a65ff2aab3f03b02b21eba7daaea15d05af26d2fc7f468509c2047f682908d78cd94254e0688496280e345d010aac24
+DIST bash52-024.sig 95 BLAKE2B 412b7f3aad7f6eeb49abfafd428bd9dbc72c5b80be0b8908d8284befa29c62c6460f883142145a2eefb157fc53030ea391d6ff50706f387a2ef933b3c89a9895 SHA512 d56fc42b92a9c0d2de32a0365c3f83913e0fe37d60a57254ac773d5ee12793694d078ee8de207718a2166631f8269bdb91fb5d386fec09fd19e7f4e6d2008b97
+DIST bash52-025 1454 BLAKE2B 5d18e00cc44710f078037f25c61741a078bb0fc906d6d5555e581e093d9e99be71f7f06fc0d139f4f25d40f5f854378031aff6e63d26ead55fe6cca626df50bd SHA512 20e708ff483ae2ba655c069fbaccdef59d81f52ba787d97fd1b997522248e9e7e1d7773a35f3a6e44c4521a7a5be273ffa25c580533e6d1d1bfb5e49040530c3
+DIST bash52-025.sig 95 BLAKE2B aff63f1a0a753b632f0d2ce4cf8f4117689469150d41dd0e0d7f76fca973d52fb16f3957b12709826e50705f921fe141108b1046de05d17b40216ed5d4a00893 SHA512 079888adce1cb8583b547d67005f179614f1c42756de20acdb9e24763dec145a421c68e7ceb48d42b853ae7fcb07e051cc1ca56f9dfd337c9a1b001618df2828
+DIST bash52-026 1372 BLAKE2B ebe3bc47dadf5d689258c5ccf9883838d3383dc43bec68d2a6767b6348cf1515a98ec9e445c3110e8eb0d87e742c20a0d4ddb70649ec94217f55aad7d18552af SHA512 571993da2b8067ef5b7b705aee65dd414ee70b216ffbcb9fab7c08807b87a72465594c3f1576c795ae86bf951911cdde70ad1037e851b88ee379c4237ccff6fe
+DIST bash52-026.sig 95 BLAKE2B 175df0703ee5374094d41761ebc2827d34cb97328ea8e486cc9e5c946e482a7d0a16a7ac45e11296500cff8ac4c013e60b07d34abf8b3478527a80f742fbe85e SHA512 6db725ffcf429e04551b2fde329067696b20bef9418b57cff56a62f31c262d0b800061284469eb9f809ca49516516735213dc05defab52ff864ac3b214336559

diff --git a/app-shells/bash/bash-5.2_p26.ebuild b/app-shells/bash/bash-5.2_p26.ebuild
new file mode 100644
index 000000000000..1bee48a4a941
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p26.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
+PLEVEL="${PV##*_p}"
+MY_PV="${PV/_p*}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+MY_PATCHES=()
+
+is_release() {
+	case ${PV} in
+		9999|*_alpha*|*_beta*|*_rc*)
+			return 1
+			;;
+		*)
+			return 0
+			;;
+	esac
+}
+
+[[ ${PV} != *_p* ]] && PLEVEL=0
+
+# The version of readline this bash normally ships with.
+# Note: right now, we don't use the system copy of readline for bash for non-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+	EGIT_BRANCH=devel
+	inherit git-r3
+elif is_release ; then
+	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
+
+	if [[ ${PLEVEL} -gt 0 ]] ; then
+		# bash-5.1 -> bash51
+		my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
+
+		patch_url=
+		my_patch_index=
+
+		upstream_url_base="mirror://gnu/bash"
+		mirror_url_base="ftp://ftp.cwru.edu/pub/bash"
+
+		for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
+			printf -v mangled_patch_ver ${my_p}-%03d ${my_patch_index}
+			patch_url="${upstream_url_base}/${MY_P}-patches/${mangled_patch_ver}"
+
+			SRC_URI+=" ${patch_url}"
+			SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
+
+			# Add in the mirror URL too.
+			SRC_URI+=" ${patch_url/${upstream_url_base}/${mirror_url_base}}"
+			SRC_URI+=" verify-sig? ( ${patch_url/${upstream_url_base}/${mirror_url_base}} )"
+
+			MY_PATCHES+=( "${DISTDIR}"/${mangled_patch_ver} )
+		done
+
+		unset my_p patch_url my_patch_index upstream_url_base mirror_url_base
+	fi
+else
+	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
+fi
+
+if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+if is_release ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:=
+	nls? ( virtual/libintl )
+"
+if is_release ; then
+	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+	${DEPEND}
+"
+# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011)
+BDEPEND="
+	pgo? ( dev-util/gperf )
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# EAPI 8 tries to append it but it doesn't exist here
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+	# Patches from Chet sent to bash-bug ml
+	"${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
+	"${FILESDIR}"/${PN}-5.2_p15-random-ub.patch
+	"${FILESDIR}"/${PN}-5.2_p15-configure-clang16.patch
+	"${FILESDIR}"/${PN}-5.2_p21-wpointer-to-int.patch
+	"${FILESDIR}"/${PN}-5.2_p21-configure-strtold.patch
+	"${FILESDIR}"/${PN}-5.2_p26-memory-leaks.patch
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double ; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger ; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+	else
+		if use verify-sig ; then
+			verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
+
+			local patch
+			for patch in "${MY_PATCHES[@]}" ; do
+				verify-sig_verify_detached ${patch}{,.sig}
+			done
+		fi
+
+		unpack ${MY_P}.tar.gz
+
+		if [[ -n ${GENTOO_PATCH_VER} ]] ; then
+			unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches
+	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases.
+	if is_release ; then
+		rm -rf lib/{readline,termcap}/* || die
+		touch lib/{readline,termcap}/Makefile.in || die # for config.status
+		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985
+	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
+	touch -r . doc/* || die
+
+	# Sometimes hangs (more noticeable w/ pgo), bug #907403.
+	rm tests/run-jobs || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	# Upstream only test with Bison and require GNUisms like YYEOF and
+	# YYERRCODE. The former at least may be in POSIX soon:
+	# https://www.austingroupbugs.net/view.php?id=1269.
+	# configure warns on use of non-Bison but doesn't abort. The result
+	# may misbehave at runtime.
+	unset YACC
+
+	local myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	# Don't even think about building this statically without
+	# reading bug #7714 first.  If you still build it statically,
+	# don't come crying to us with bugs ;).
+	#use static && export LDFLAGS="${LDFLAGS} -static"
+	use nls || myconf+=( --disable-nls )
+
+	if is_release ; then
+		# Historically, we always used the builtin readline, but since
+		# our handling of SONAME upgrades has gotten much more stable
+		# in the PM (and the readline ebuild itself preserves the old
+		# libs during upgrades), linking against the system copy should
+		# be safe.
+		# Exact cached version here doesn't really matter as long as it
+		# is at least what's in the DEPEND up above.
+		export ac_cv_rl_version=${READLINE_VER%%_*}
+
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins ; then
+		append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
+	else
+		# Disable the plugins logic by hand since bash doesn't
+		# provide a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i \
+			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
+			configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	# -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+	# See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+	local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/pgo -fprofile-generate=${T}/pgo $(test-flags-CC -fprofile-partial-training)")
+	local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo $(test-flags-CC -fprofile-partial-training)")
+
+	emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+	use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags}" all others
+
+	# Build Bash and run its tests to generate profiles.
+	if use pgo ; then
+		# Used in test suite.
+		unset A
+
+		emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
+
+		if tc-is-clang; then
+			llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+		fi
+
+		# Rebuild Bash using the profiling data we just generated.
+		emake clean
+		emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags}" all others
+	fi
+}
+
+src_test() {
+	# Used in test suite.
+	unset A
+
+	default
+}
+
+src_install() {
+	local d f
+
+	default
+
+	dodir /bin
+	mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
+
+	keepdir /etc/bash/bashrc.d
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc} ; do
+		newins "${FILESDIR}"/dot-${f} .${f}
+	done
+
+	local sed_args=(
+		-e 's:#GNU#@::'
+		-e '/#@/d'
+	)
+
+	if ! use readline ; then
+		# bug #432338
+		sed_args+=(
+			-e '/^shopt -s histappend/s:^:#:'
+			-e 's:use_color=true:use_color=false:'
+		)
+	fi
+
+	sed -i \
+		"${sed_args[@]}" \
+		"${ED}"/etc/skel/.bashrc \
+		"${ED}"/etc/bash/bashrc || die
+
+	if use plugins ; then
+		exeinto /usr/$(get_libdir)/bash
+		doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples ; then
+		for d in examples/{functions,misc,scripts,startup-files} ; do
+			exeinto /usr/share/doc/${PF}/${d}
+			docinto ${d}
+			for f in ${d}/* ; do
+				if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
+					doexe ${f}
+				else
+					dodoc ${f}
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
+		mkdir -p "${EROOT}"/etc/bash
+		mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
+	fi
+}
+
+pkg_postinst() {
+	# If /bin/sh does not exist, provide it
+	if [[ ! -e ${EROOT}/bin/sh ]] ; then
+		ln -sf bash "${EROOT}"/bin/sh
+	fi
+}

diff --git a/app-shells/bash/files/bash-5.2_p26-memory-leaks.patch b/app-shells/bash/files/bash-5.2_p26-memory-leaks.patch
new file mode 100644
index 000000000000..10a5deb18192
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p26-memory-leaks.patch
@@ -0,0 +1,136 @@
+https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00036.html
+https://lists.gnu.org/archive/html/bug-bash/2024-01/txtm8yNNPR9RQ.txt
+
+For evalstring.c:
+* https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00011.html
+* https://git.savannah.gnu.org/cgit/bash.git/diff/builtins/evalstring.c?h=devel&id=81f7b44564cd1510788035cea7c59631865a7db2&dt=1#n766
+
+From 711ab85262884f2b91f09eceb9aefd0e2426ce67 Mon Sep 17 00:00:00 2001
+From: Grisha Levit <grishalevit@gmail.com>
+Date: Sat, 3 Jun 2023 16:51:26 -0400
+Subject: [PATCH] various leaks
+
+Found mostly by normal usage running a no-bash-malloc build with clang's
+LeakSanitizer enabled. So far seems to provide very accurate results.
+
+* arrayfunc.c
+- quote_compound_array_word: make sure to free VALUE
+- bind_assoc_var_internal: if assigning to a dynamic variable, make sure
+  to free the key (usually assoc_insert would do it)
+
+* bashline.c
+- bash_command_name_stat_hook: free original *NAME if we are going to
+  change what it points to (what the callers seem to expect)
+
+* builtins/evalstring.c
+- parse_and_execute: make sure to dispose of the parsed command
+  resulting from a failed function import attempt
+- open_redir_file: if we did not get a pointer to pass back the expanded
+  filename, make sure to free the name
+
+* examples/loadables/stat.c
+- loadstat: bind_assoc_variable does not free its VALUE argument so make
+  sure to do it
+
+* subst.c
+- param_expand: free temp1 value for codepaths that don't do it
+---
+ arrayfunc.c               | 6 +++++-
+ bashline.c                | 1 +
+ builtins/evalstring.c     | 4 ++++
+ examples/loadables/stat.c | 1 +
+ subst.c                   | 2 ++
+ 5 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/arrayfunc.c b/arrayfunc.c
+index 2c05d15b..8ba64084 100644
+--- arrayfunc.c
++++ arrayfunc.c
+@@ -208,7 +208,10 @@ bind_assoc_var_internal (entry, hash, key, value, flags)
+   newval = make_array_variable_value (entry, 0, key, value, flags);
+ 
+   if (entry->assign_func)
+-    (*entry->assign_func) (entry, newval, 0, key);
++    {
++      (*entry->assign_func) (entry, newval, 0, key);
++      FREE (key);
++    }
+   else
+     assoc_insert (hash, key, newval);
+ 
+@@ -985,6 +988,7 @@ quote_compound_array_word (w, type)
+   if (t != w+ind)
+    free (t);
+   strcpy (nword + i, value);
++  free (value);
+ 
+   return nword;
+ }
+diff --git a/bashline.c b/bashline.c
+index c85b05b6..bd7548cc 100644
+--- bashline.c
++++ bashline.c
+@@ -1928,6 +1928,7 @@ bash_command_name_stat_hook (name)
+   result = search_for_command (cname, 0);
+   if (result)
+     {
++      FREE (*name);
+       *name = result;
+       return 1;
+     }
+diff --git a/builtins/evalstring.c b/builtins/evalstring.c
+index df3dd68e..20c6a4a7 100644
+--- builtins/evalstring.c
++++ builtins/evalstring.c
+@@ -461,6 +461,8 @@ parse_and_execute (string, from_file, flags)
+ 		      should_jump_to_top_level = 0;
+ 		      last_result = last_command_exit_value = EX_BADUSAGE;
+ 		      set_pipestatus_from_exit (last_command_exit_value);
++		      dispose_command(command);
++		      global_command = (COMMAND *)NULL;
+ 		      reset_parser ();
+ 		      break;
+ 		    }
+@@ -762,6 +764,8 @@ open_redir_file (r, fnp)
+ 
+   if (fnp)
+     *fnp = fn;
++  else
++    free (fn);
+   return fd;
+ }
+ 
+diff --git a/examples/loadables/stat.c b/examples/loadables/stat.c
+index 1e60e7b6..ed5c9764 100644
+--- examples/loadables/stat.c
++++ examples/loadables/stat.c
+@@ -349,6 +349,7 @@ loadstat (vname, var, fname, flags, fmt, sp)
+       key = savestring (arraysubs[i]);
+       value = statval (i, fname, flags, fmt, sp);
+       v = bind_assoc_variable (var, vname, key, value, ASS_FORCE);
++      free (value);
+     }
+   return 0;
+ }
+diff --git a/subst.c b/subst.c
+index 1ac6eb2d..ff0602da 100644
+--- subst.c
++++ subst.c
+@@ -10727,6 +10727,7 @@ comsub:
+ 	    {
+ 	      chk_atstar (temp, quoted, pflags, quoted_dollar_at_p, contains_dollar_at);
+ 	      tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, 0);
++	      free (temp1);
+ 	      if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal)
+ 		return (tdesc);
+ 	      ret = tdesc;
+@@ -10739,6 +10740,7 @@ comsub:
+ 	    {
+ 	      set_exit_status (EXECUTION_FAILURE);
+ 	      report_error (_("%s: invalid variable name for name reference"), temp);
++	      free (temp1);
+ 	      return (&expand_wdesc_error);	/* XXX */
+ 	    }
+ 	  else
+-- 
+2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2024-08-02  1:06 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2024-08-02  1:06 UTC (permalink / raw
  To: gentoo-commits

commit:     325ab4f07a2b890ca1cbfbf1402eb0dac122a7ee
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 01:05:01 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 01:05:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=325ab4f0

app-shells/bash: add 5.2_p32

Compared to bash-5.2_p26-memory-leaks.patch, this drops a hunk for
builtins/evalstring.c as the open_redir_file issue is fixed in patch 31
upstream for bash-5.2.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/Manifest                           |  12 +
 app-shells/bash/bash-5.2_p32.ebuild                | 402 +++++++++++++++++++++
 .../bash/files/bash-5.2_p32-memory-leaks.patch     | 130 +++++++
 3 files changed, 544 insertions(+)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index ead9a19e1f87..3789c5267d46 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -433,3 +433,15 @@ DIST bash52-025 1454 BLAKE2B 5d18e00cc44710f078037f25c61741a078bb0fc906d6d5555e5
 DIST bash52-025.sig 95 BLAKE2B aff63f1a0a753b632f0d2ce4cf8f4117689469150d41dd0e0d7f76fca973d52fb16f3957b12709826e50705f921fe141108b1046de05d17b40216ed5d4a00893 SHA512 079888adce1cb8583b547d67005f179614f1c42756de20acdb9e24763dec145a421c68e7ceb48d42b853ae7fcb07e051cc1ca56f9dfd337c9a1b001618df2828
 DIST bash52-026 1372 BLAKE2B ebe3bc47dadf5d689258c5ccf9883838d3383dc43bec68d2a6767b6348cf1515a98ec9e445c3110e8eb0d87e742c20a0d4ddb70649ec94217f55aad7d18552af SHA512 571993da2b8067ef5b7b705aee65dd414ee70b216ffbcb9fab7c08807b87a72465594c3f1576c795ae86bf951911cdde70ad1037e851b88ee379c4237ccff6fe
 DIST bash52-026.sig 95 BLAKE2B 175df0703ee5374094d41761ebc2827d34cb97328ea8e486cc9e5c946e482a7d0a16a7ac45e11296500cff8ac4c013e60b07d34abf8b3478527a80f742fbe85e SHA512 6db725ffcf429e04551b2fde329067696b20bef9418b57cff56a62f31c262d0b800061284469eb9f809ca49516516735213dc05defab52ff864ac3b214336559
+DIST bash52-027 1881 BLAKE2B b76ce03456e064f17db00e9026aa53656a063c195faa02c7d51da8d173f7525fe5411bf526f19ee9e717ee1ec957de7e73f5af851a68d5cb554f2c4492ab3844 SHA512 644ef1ea0ce002913b443cfc74d1376b3b8d1c7c976c88cfcec663313563ea905af3aa7ab7236e0ee8336195b01cfc7f2a5a738c5f787a637be92cda937f571e
+DIST bash52-027.sig 95 BLAKE2B 7120dc764120e108fbafd80dcd5010aea2f79f7508fda375740f7601c5e7508f2c830673101fe528a79cb4a7a5718ebd5dcf5e7ae81943008b128b10bb57ab8b SHA512 ad76bc672e53c62a8554a2889d420294f7dde0a996cb3058ca8a3a4108b53d35ed56dbcd0601f1984b3ae26dfe5eb6d99c9d46ebe78f0947b82502bef2419152
+DIST bash52-028 1571 BLAKE2B 58fdeecf6dd685103c7dc0e7c200cae65206e5fb3360d798b9cec05fc935ebae139bdf142f6018c9837d1780eb7c5cecff0a945369c14fa575e6801c46a15a31 SHA512 0e59ee230c2f9394814578e56270efa93e5ed8ed2fbf0c0777fdfad4d3f01f560923a80792998789c901068d88371f984f539fdebbec726759eeb7966d324328
+DIST bash52-028.sig 95 BLAKE2B 62d4663cfb25b470635321815e0860434c2edb35b220450d0123fc0bee2d80f29af060c34c765a48d75b49030f17d50852a1540be28fc615ebdd3f32391fe4d1 SHA512 e3e37ac8e6a29688c4c9dd318fc767331eec39bf947670060ebd42fd8262aad400152dc02d1d459f00170e6b788cf95d4a0a6dd62a2eae4af5bc67ebc80ece5d
+DIST bash52-029 3619 BLAKE2B 01ddb0acc5b6067e729320692284d61735ace62eeede81a74b7628fe6899da61d921a11bd0d22d0e6f2e241e7b0cb64591654a34a33916739e35e23d5cc6f5bd SHA512 b0b134347fbe0916b9c0fc60a9dbc6b6ebc7439bd5a12d0cda29a0012cbbcc16414392597764c24b8ca716ce727bce7da7fae39acc3cdba9506efb01014a43ae
+DIST bash52-029.sig 95 BLAKE2B 49c408e8da095c130868b3fab7afb85408307a10d9154dda818e014cec2ec973e1fc2a96dcd7a1769d1581e3c1d758d172bfa066d7b1ea6fdbb80e062d24ef64 SHA512 11aeca6b46a5cdf518b26a59a972e956455cb4d15aedd968ad36f8100bfc38448f89fe7a72dbecfa8da9fe556a194dda9bb34f1d16c2408b92b0e594f163f262
+DIST bash52-030 4111 BLAKE2B d0cf114642393eb2e2d060eac339674c8ce10af4d54bbcee0f450854d27373ede9dd159caf6d05fc69429ad357d666b47f6781ef590287f33a535b2c26d8754d SHA512 515902fd567dfbbca3d4f6d98a7f2f5a9d1ad323d829f9b90839de4807592708dea3d52f67cb868617278f9c8c6bb299ab3310d898be344d63e824043f17fe2d
+DIST bash52-030.sig 95 BLAKE2B b8edc295a6646721ce7be79ebac2331a36c0b84ca9f5a6b6e8c2da0674f1279debaf941bbbddd56e2b868afc60a92a34fd312e049fc8524ba1e88ca5cb952acc SHA512 2592d5b7f62a23dd16153691053e462342ae33f347349348de98487c52d2e73ab0d46216505925bc887bceb069bcb5c1c5ce7ce803e62eec7ef0458dbaf1fb69
+DIST bash52-031 1159 BLAKE2B dac378115906e21fc754267c42e129e2374c9b63f879d1717d79930589618d4d8d17821b2f529d1851db7567d3efdfb0410c18e6869047e3d87443b29d507289 SHA512 08f3e3cb6a6554ea6d1b1f5cbcd156cb75f9c0c5350801b67352a1c2ffec0d02d90c0947736fd52de304e549a1b919ea0ff42e23a8cf63a721a351ea1732bea5
+DIST bash52-031.sig 95 BLAKE2B 50e5c0b3afb0ffc8b1863bde645316d7c7c49e8b396041ca1dcf269c50b532aaccf0c3fb5a5e64036ece9054d8ccf78f7e829ecf0fbdcf8531ba57230b129f1c SHA512 f656d8fbbe79450fbf193e5c2aebc85cfc425703495f2925aa774d5c0e742ebf523c191264673c6dd76fa6071c39d5155698687475eb634cd6553e86266f91a5
+DIST bash52-032 1529 BLAKE2B 55aab849da0fcc69ab3516d9d7ff2858b5f15cbeaddf66282f43f272b52d646c2c41c2ceef632a2ae8f13c25d92e85f49fbc6de989ed4f6ac4bb7bea7fc59a5d SHA512 9eb277d2d92b9ec49f70582e52305bc45b425b189ba2a15c51c537e07ccf9cb894c1ca44fa399b04297fe51027aff7f169f41efe2d60895ca55c421c0778ef32
+DIST bash52-032.sig 95 BLAKE2B 23a5cd003c957932d0c0192b63a5e8e7366bf939c3f54ff91b444e3729607c88677fdf4a5b435e47da4a64624b10d8696e4e950fac8fbb6932bb4c64506d1f9f SHA512 d3b08c3d0efee81a8507b530405a886259438bfc4c2ab984dbe80d30177775aacf6448a2673f0bd274fe46c938a8b8d46844d3794374bafce63f7c1d8bf4efe1

diff --git a/app-shells/bash/bash-5.2_p32.ebuild b/app-shells/bash/bash-5.2_p32.ebuild
new file mode 100644
index 000000000000..c279cf9bca3d
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p32.ebuild
@@ -0,0 +1,402 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset.
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+MY_PATCHES=()
+
+# Determine the patchlevel. See ftp://ftp.gnu.org/gnu/bash/bash-5.2-patches/.
+case ${PV} in
+	*_p*)
+		PLEVEL=${PV##*_p}
+		;;
+	9999|*_alpha*|*_beta*|*_rc*)
+		# Set a negative patchlevel to indicate that it's a pre-release.
+		PLEVEL=-1
+		;;
+	*)
+		PLEVEL=0
+esac
+
+# The version of readline this bash normally ships with. Note that we only use
+# the bundled copy of readline for pre-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]]; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+	EGIT_BRANCH=devel
+	inherit git-r3
+else
+	my_urls=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}.tar.gz" )
+
+	# bash-5.1 -> bash51
+	my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
+
+	for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
+		printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
+		my_urls+=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}-patches/${my_patch_ver}" )
+		MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
+	done
+
+	SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
+
+	unset -v my_urls my_p my_patch_idx my_patch_ver
+fi
+
+if [[ ${GENTOO_PATCH_VER} ]]; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
+fi
+
+S=${WORKDIR}/${MY_P}
+
+LICENSE="GPL-3+"
+SLOT="0"
+if (( PLEVEL >= 0 )); then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:=
+	nls? ( virtual/libintl )
+"
+if (( PLEVEL >= 0 )); then
+	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+	${DEPEND}
+"
+# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
+BDEPEND="
+	pgo? ( dev-util/gperf )
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+# EAPI 8 tries to append it but it doesn't exist here.
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+	# Patches to or from Chet, posted to the bug-bash mailing list.
+	"${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
+	"${FILESDIR}/${PN}-5.2_p15-random-ub.patch"
+	"${FILESDIR}/${PN}-5.2_p15-configure-clang16.patch"
+	"${FILESDIR}/${PN}-5.2_p21-wpointer-to-int.patch"
+	"${FILESDIR}/${PN}-5.2_p21-configure-strtold.patch"
+	"${FILESDIR}/${PN}-5.2_p32-memory-leaks.patch"
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	local patch
+
+	if [[ ${PV} == 9999 ]]; then
+		git-r3_src_unpack
+	else
+		if use verify-sig; then
+			verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
+
+			for patch in "${MY_PATCHES[@]}"; do
+				verify-sig_verify_detached "${patch}"{,.sig}
+			done
+		fi
+
+		unpack "${MY_P}.tar.gz"
+
+		if [[ ${GENTOO_PATCH_VER} ]]; then
+			unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches.
+	(( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases. The
+	# touch utility is invoked for the benefit of config.status.
+	if (( PLEVEL >= 0 )); then
+		rm -rf lib/{readline,termcap}/* \
+		&& touch lib/{readline,termcap}/Makefile.in \
+		&& sed -i -E 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in \
+		|| die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985.
+	sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
+	&& touch -r . doc/* \
+	|| die
+
+	# Sometimes hangs (more noticeable w/ pgo), bug #907403.
+	rm tests/run-jobs || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local -a myconf
+
+	# Upstream only test with Bison and require GNUisms like YYEOF and
+	# YYERRCODE. The former at least may be in POSIX soon:
+	# https://www.austingroupbugs.net/view.php?id=1269.
+	# configure warns on use of non-Bison but doesn't abort. The result
+	# may misbehave at runtime.
+	unset -v YACC
+
+	myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h.
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	use nls || myconf+=( --disable-nls )
+
+	if (( PLEVEL >= 0 )); then
+		# Historically, we always used the builtin readline, but since
+		# our handling of SONAME upgrades has gotten much more stable
+		# in the PM (and the readline ebuild itself preserves the old
+		# libs during upgrades), linking against the system copy should
+		# be safe.
+		# Exact cached version here doesn't really matter as long as it
+		# is at least what's in the DEPEND up above.
+		export ac_cv_rl_version=${READLINE_VER%%_*}
+
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
+	else
+		# Disable the plugins logic by hand since bash doesn't provide
+		# a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	local -a pgo_generate_flags pgo_use_flags
+	local flag
+
+	# -fprofile-partial-training because upstream notes the test suite isn't
+	# super comprehensive.
+	# https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+	if use pgo; then
+		pgo_generate_flags=(
+			-fprofile-update=atomic
+			-fprofile-dir="${T}"/pgo
+			-fprofile-generate="${T}"/pgo
+		)
+		pgo_use_flags=(
+			-fprofile-use="${T}"/pgo
+			-fprofile-dir="${T}"/pgo
+		)
+		if flag=$(test-flags-CC -fprofile-partial-training); then
+			pgo_generate_flags+=( "${flag}" )
+			pgo_use_flags+=( "${flag}" )
+		fi
+	fi
+
+	emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
+	use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
+
+	# Build Bash and run its tests to generate profiles.
+	if (( ${#pgo_generate_flags[@]} )); then
+		# Used in test suite.
+		unset -v A
+
+		emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
+
+		if tc-is-clang; then
+			llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+		fi
+
+		# Rebuild Bash using the profiling data we just generated.
+		emake clean
+		emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
+		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
+	fi
+}
+
+src_test() {
+	# Used in test suite.
+	unset -v A
+
+	default
+}
+
+src_install() {
+	local d f
+
+	default
+
+	my_prefixify() {
+		while read -r; do
+			if [[ $REPLY == *$1* ]]; then
+				REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+			fi
+			printf '%s\n' "${REPLY}" || ! break
+		done < "$2" || die
+	}
+
+	dodir /bin
+	mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
+
+	insinto /etc/bash/bashrc.d
+	my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
+	newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r1.bash 10-gentoo-title.bash
+	if [[ ! ${EPREFIX} ]]; then
+		doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
+	fi
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc}; do
+		newins "${FILESDIR}/dot-${f}" ".${f}"
+	done
+
+	if use plugins; then
+		exeinto "/usr/$(get_libdir)/bash"
+		set -- examples/loadables/*.o
+		doexe "${@%.o}"
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples; then
+		for d in examples/{functions,misc,scripts,startup-files}; do
+			exeinto "/usr/share/doc/${PF}/${d}"
+			docinto "${d}"
+			for f in "${d}"/*; do
+				if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
+					doexe "${f}"
+				else
+					dodoc "${f}"
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1.
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
+		mkdir -p -- "${EROOT}"/etc/bash \
+		&& mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
+		|| die
+	fi
+}
+
+pkg_postinst() {
+	local old_ver
+
+	# If /bin/sh does not exist, provide it.
+	if [[ ! -e ${EROOT}/bin/sh ]]; then
+		ln -sf -- bash "${EROOT}"/bin/sh || die
+	fi
+
+	read -r old_ver <<<"${REPLACING_VERSIONS}"
+	if [[ ! $old_ver ]]; then
+		:
+	elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
+		return
+	fi
+
+	while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, it may contain a command to set
+the terminal's window title. Those who were already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash set the window title in the case
+that the terminal is controlled by sshd(8), unless screen is launched on the
+remote side or the terminal reliably supports saving and restoring the title
+(as alacritty, foot and tmux do). Those wanting for the title to be set
+regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
+drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
+}

diff --git a/app-shells/bash/files/bash-5.2_p32-memory-leaks.patch b/app-shells/bash/files/bash-5.2_p32-memory-leaks.patch
new file mode 100644
index 000000000000..0c60e70d3cb5
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p32-memory-leaks.patch
@@ -0,0 +1,130 @@
+[Compared to bash-5.2_p26-memory-leaks.patch, this drops a hunk for
+builtins/evalstring.c as the open_redir_file issue is fixed in patch 31
+upstream for bash-5.2]
+
+https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00036.html
+https://lists.gnu.org/archive/html/bug-bash/2024-01/txtm8yNNPR9RQ.txt
+
+For evalstring.c:
+* https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00011.html
+* https://git.savannah.gnu.org/cgit/bash.git/diff/builtins/evalstring.c?h=devel&id=81f7b44564cd1510788035cea7c59631865a7db2&dt=1#n766
+
+From 711ab85262884f2b91f09eceb9aefd0e2426ce67 Mon Sep 17 00:00:00 2001
+From: Grisha Levit <grishalevit@gmail.com>
+Date: Sat, 3 Jun 2023 16:51:26 -0400
+Subject: [PATCH] various leaks
+
+Found mostly by normal usage running a no-bash-malloc build with clang's
+LeakSanitizer enabled. So far seems to provide very accurate results.
+
+* arrayfunc.c
+- quote_compound_array_word: make sure to free VALUE
+- bind_assoc_var_internal: if assigning to a dynamic variable, make sure
+  to free the key (usually assoc_insert would do it)
+
+* bashline.c
+- bash_command_name_stat_hook: free original *NAME if we are going to
+  change what it points to (what the callers seem to expect)
+
+* builtins/evalstring.c
+- parse_and_execute: make sure to dispose of the parsed command
+  resulting from a failed function import attempt
+
+* examples/loadables/stat.c
+- loadstat: bind_assoc_variable does not free its VALUE argument so make
+  sure to do it
+
+* subst.c
+- param_expand: free temp1 value for codepaths that don't do it
+---
+ arrayfunc.c               | 6 +++++-
+ bashline.c                | 1 +
+ builtins/evalstring.c     | 4 ++++
+ examples/loadables/stat.c | 1 +
+ subst.c                   | 2 ++
+ 5 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/arrayfunc.c b/arrayfunc.c
+index 2c05d15b..8ba64084 100644
+--- arrayfunc.c
++++ arrayfunc.c
+@@ -208,7 +208,10 @@ bind_assoc_var_internal (entry, hash, key, value, flags)
+   newval = make_array_variable_value (entry, 0, key, value, flags);
+ 
+   if (entry->assign_func)
+-    (*entry->assign_func) (entry, newval, 0, key);
++    {
++      (*entry->assign_func) (entry, newval, 0, key);
++      FREE (key);
++    }
+   else
+     assoc_insert (hash, key, newval);
+ 
+@@ -985,6 +988,7 @@ quote_compound_array_word (w, type)
+   if (t != w+ind)
+    free (t);
+   strcpy (nword + i, value);
++  free (value);
+ 
+   return nword;
+ }
+diff --git a/bashline.c b/bashline.c
+index c85b05b6..bd7548cc 100644
+--- bashline.c
++++ bashline.c
+@@ -1928,6 +1928,7 @@ bash_command_name_stat_hook (name)
+   result = search_for_command (cname, 0);
+   if (result)
+     {
++      FREE (*name);
+       *name = result;
+       return 1;
+     }
+diff --git a/builtins/evalstring.c b/builtins/evalstring.c
+index df3dd68e..20c6a4a7 100644
+--- builtins/evalstring.c
++++ builtins/evalstring.c
+@@ -461,6 +461,8 @@ parse_and_execute (string, from_file, flags)
+ 		      should_jump_to_top_level = 0;
+ 		      last_result = last_command_exit_value = EX_BADUSAGE;
+ 		      set_pipestatus_from_exit (last_command_exit_value);
++		      dispose_command(command);
++		      global_command = (COMMAND *)NULL;
+ 		      reset_parser ();
+ 		      break;
+ 		    }
+ 
+diff --git a/examples/loadables/stat.c b/examples/loadables/stat.c
+index 1e60e7b6..ed5c9764 100644
+--- examples/loadables/stat.c
++++ examples/loadables/stat.c
+@@ -349,6 +349,7 @@ loadstat (vname, var, fname, flags, fmt, sp)
+       key = savestring (arraysubs[i]);
+       value = statval (i, fname, flags, fmt, sp);
+       v = bind_assoc_variable (var, vname, key, value, ASS_FORCE);
++      free (value);
+     }
+   return 0;
+ }
+diff --git a/subst.c b/subst.c
+index 1ac6eb2d..ff0602da 100644
+--- subst.c
++++ subst.c
+@@ -10727,6 +10727,7 @@ comsub:
+ 	    {
+ 	      chk_atstar (temp, quoted, pflags, quoted_dollar_at_p, contains_dollar_at);
+ 	      tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, 0);
++	      free (temp1);
+ 	      if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal)
+ 		return (tdesc);
+ 	      ret = tdesc;
+@@ -10739,6 +10740,7 @@ comsub:
+ 	    {
+ 	      set_exit_status (EXECUTION_FAILURE);
+ 	      report_error (_("%s: invalid variable name for name reference"), temp);
++	      free (temp1);
+ 	      return (&expand_wdesc_error);	/* XXX */
+ 	    }
+ 	  else
+-- 
+2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/
@ 2024-08-26 22:54 Sam James
  0 siblings, 0 replies; 21+ messages in thread
From: Sam James @ 2024-08-26 22:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4cee167d4a8ec031f598dd315a1dc2ff8fd6da13
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Aug 23 04:22:39 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 22:54:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cee167d

app-shells/bash: add 5.2_p32-r1 with fix for 5.0-introduced regression in read

This backports a fix for an issue whereby the delimiter employed by the
read builtin is ignored in the case that it is part of an invalid
multibyte sequence. Further details can be found within the patch.

[sam: Keep -r0.]

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-5.2_p32-r1.ebuild             | 403 +++++++++++++++++++++
 ...-5.2_p32-read-delimiter-in-invalid-mbchar.patch | 297 +++++++++++++++
 2 files changed, 700 insertions(+)

diff --git a/app-shells/bash/bash-5.2_p32-r1.ebuild b/app-shells/bash/bash-5.2_p32-r1.ebuild
new file mode 100644
index 000000000000..e84a17739b2c
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p32-r1.ebuild
@@ -0,0 +1,403 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset.
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+MY_PATCHES=()
+
+# Determine the patchlevel. See ftp://ftp.gnu.org/gnu/bash/bash-5.2-patches/.
+case ${PV} in
+	*_p*)
+		PLEVEL=${PV##*_p}
+		;;
+	9999|*_alpha*|*_beta*|*_rc*)
+		# Set a negative patchlevel to indicate that it's a pre-release.
+		PLEVEL=-1
+		;;
+	*)
+		PLEVEL=0
+esac
+
+# The version of readline this bash normally ships with. Note that we only use
+# the bundled copy of readline for pre-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]]; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+	EGIT_BRANCH=devel
+	inherit git-r3
+else
+	my_urls=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}.tar.gz" )
+
+	# bash-5.1 -> bash51
+	my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
+
+	for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
+		printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
+		my_urls+=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}-patches/${my_patch_ver}" )
+		MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
+	done
+
+	SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
+
+	unset -v my_urls my_p my_patch_idx my_patch_ver
+fi
+
+if [[ ${GENTOO_PATCH_VER} ]]; then
+	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
+fi
+
+S=${WORKDIR}/${MY_P}
+
+LICENSE="GPL-3+"
+SLOT="0"
+if (( PLEVEL >= 0 )); then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+	>=sys-libs/ncurses-5.2-r2:=
+	nls? ( virtual/libintl )
+"
+if (( PLEVEL >= 0 )); then
+	DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+	${DEPEND}
+"
+# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
+BDEPEND="
+	pgo? ( dev-util/gperf )
+	verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+# EAPI 8 tries to append it but it doesn't exist here.
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+	#"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+	# Patches to or from Chet, posted to the bug-bash mailing list.
+	"${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
+	"${FILESDIR}/${PN}-5.2_p15-random-ub.patch"
+	"${FILESDIR}/${PN}-5.2_p15-configure-clang16.patch"
+	"${FILESDIR}/${PN}-5.2_p21-wpointer-to-int.patch"
+	"${FILESDIR}/${PN}-5.2_p21-configure-strtold.patch"
+	"${FILESDIR}/${PN}-5.2_p32-memory-leaks.patch"
+	"${FILESDIR}/${PN}-5.2_p32-read-delimiter-in-invalid-mbchar.patch"
+)
+
+pkg_setup() {
+	# bug #7332
+	if is-flag -malign-double; then
+		eerror "Detected bad CFLAGS '-malign-double'.  Do not use this"
+		eerror "as it breaks LFS (struct stat64) on x86."
+		die "remove -malign-double from your CFLAGS mr ricer"
+	fi
+
+	if use bashlogger; then
+		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+		ewarn "This will log ALL output you enter into the shell, you have been warned."
+	fi
+}
+
+src_unpack() {
+	local patch
+
+	if [[ ${PV} == 9999 ]]; then
+		git-r3_src_unpack
+	else
+		if use verify-sig; then
+			verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
+
+			for patch in "${MY_PATCHES[@]}"; do
+				verify-sig_verify_detached "${patch}"{,.sig}
+			done
+		fi
+
+		unpack "${MY_P}.tar.gz"
+
+		if [[ ${GENTOO_PATCH_VER} ]]; then
+			unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+		fi
+	fi
+}
+
+src_prepare() {
+	# Include official patches.
+	(( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
+
+	# Clean out local libs so we know we use system ones w/releases. The
+	# touch utility is invoked for the benefit of config.status.
+	if (( PLEVEL >= 0 )); then
+		rm -rf lib/{readline,termcap}/* \
+		&& touch lib/{readline,termcap}/Makefile.in \
+		&& sed -i -E 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in \
+		|| die
+	fi
+
+	# Prefixify hardcoded path names. No-op for non-prefix.
+	hprefixify pathnames.h.in
+
+	# Avoid regenerating docs after patches, bug #407985.
+	sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
+	&& touch -r . doc/* \
+	|| die
+
+	# Sometimes hangs (more noticeable w/ pgo), bug #907403.
+	rm tests/run-jobs || die
+
+	eapply -p0 "${PATCHES[@]}"
+	eapply_user
+}
+
+src_configure() {
+	local -a myconf
+
+	# Upstream only test with Bison and require GNUisms like YYEOF and
+	# YYERRCODE. The former at least may be in POSIX soon:
+	# https://www.austingroupbugs.net/view.php?id=1269.
+	# configure warns on use of non-Bison but doesn't abort. The result
+	# may misbehave at runtime.
+	unset -v YACC
+
+	myconf=(
+		--disable-profiling
+
+		# Force linking with system curses ... the bundled termcap lib
+		# sucks bad compared to ncurses.  For the most part, ncurses
+		# is here because readline needs it.  But bash itself calls
+		# ncurses in one or two small places :(.
+		--with-curses
+
+		$(use_enable mem-scramble)
+		$(use_enable net net-redirections)
+		$(use_enable readline)
+		$(use_enable readline bang-history)
+		$(use_enable readline history)
+		$(use_with afs)
+		$(use_with mem-scramble bash-malloc)
+	)
+
+	# For descriptions of these, see config-top.h.
+	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+	append-cppflags \
+		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+		-DNON_INTERACTIVE_LOGIN_SHELLS \
+		-DSSH_SOURCE_BASHRC \
+		$(use bashlogger && echo -DSYSLOG_HISTORY)
+
+	use nls || myconf+=( --disable-nls )
+
+	if (( PLEVEL >= 0 )); then
+		# Historically, we always used the builtin readline, but since
+		# our handling of SONAME upgrades has gotten much more stable
+		# in the PM (and the readline ebuild itself preserves the old
+		# libs during upgrades), linking against the system copy should
+		# be safe.
+		# Exact cached version here doesn't really matter as long as it
+		# is at least what's in the DEPEND up above.
+		export ac_cv_rl_version=${READLINE_VER%%_*}
+
+		# Use system readline only with released versions.
+		myconf+=( --with-installed-readline=. )
+	fi
+
+	if use plugins; then
+		append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
+	else
+		# Disable the plugins logic by hand since bash doesn't provide
+		# a way of doing it.
+		export ac_cv_func_dl{close,open,sym}=no \
+			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+		sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
+	fi
+
+	# bug #444070
+	tc-export AR
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	local -a pgo_generate_flags pgo_use_flags
+	local flag
+
+	# -fprofile-partial-training because upstream notes the test suite isn't
+	# super comprehensive.
+	# https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+	if use pgo; then
+		pgo_generate_flags=(
+			-fprofile-update=atomic
+			-fprofile-dir="${T}"/pgo
+			-fprofile-generate="${T}"/pgo
+		)
+		pgo_use_flags=(
+			-fprofile-use="${T}"/pgo
+			-fprofile-dir="${T}"/pgo
+		)
+		if flag=$(test-flags-CC -fprofile-partial-training); then
+			pgo_generate_flags+=( "${flag}" )
+			pgo_use_flags+=( "${flag}" )
+		fi
+	fi
+
+	emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
+	use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
+
+	# Build Bash and run its tests to generate profiles.
+	if (( ${#pgo_generate_flags[@]} )); then
+		# Used in test suite.
+		unset -v A
+
+		emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
+
+		if tc-is-clang; then
+			llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+		fi
+
+		# Rebuild Bash using the profiling data we just generated.
+		emake clean
+		emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
+		use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
+	fi
+}
+
+src_test() {
+	# Used in test suite.
+	unset -v A
+
+	default
+}
+
+src_install() {
+	local d f
+
+	default
+
+	my_prefixify() {
+		while read -r; do
+			if [[ $REPLY == *$1* ]]; then
+				REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+			fi
+			printf '%s\n' "${REPLY}" || ! break
+		done < "$2" || die
+	}
+
+	dodir /bin
+	mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+	dosym bash /bin/rbash
+
+	insinto /etc/bash
+	doins "${FILESDIR}"/bash_logout
+	my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
+
+	insinto /etc/bash/bashrc.d
+	my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
+	newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r1.bash 10-gentoo-title.bash
+	if [[ ! ${EPREFIX} ]]; then
+		doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
+	fi
+
+	insinto /etc/skel
+	for f in bash{_logout,_profile,rc}; do
+		newins "${FILESDIR}/dot-${f}" ".${f}"
+	done
+
+	if use plugins; then
+		exeinto "/usr/$(get_libdir)/bash"
+		set -- examples/loadables/*.o
+		doexe "${@%.o}"
+
+		insinto /usr/include/bash-plugins
+		doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+	fi
+
+	if use examples; then
+		for d in examples/{functions,misc,scripts,startup-files}; do
+			exeinto "/usr/share/doc/${PF}/${d}"
+			docinto "${d}"
+			for f in "${d}"/*; do
+				if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
+					doexe "${f}"
+				else
+					dodoc "${f}"
+				fi
+			done
+		done
+	fi
+
+	# Install bash_builtins.1 and rbash.1.
+	emake -C doc DESTDIR="${D}" install_builtins
+	sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+	doman "${T}"/rbash.1
+
+	newdoc CWRU/changelog ChangeLog
+	dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+	if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
+		mkdir -p -- "${EROOT}"/etc/bash \
+		&& mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
+		|| die
+	fi
+}
+
+pkg_postinst() {
+	local old_ver
+
+	# If /bin/sh does not exist, provide it.
+	if [[ ! -e ${EROOT}/bin/sh ]]; then
+		ln -sf -- bash "${EROOT}"/bin/sh || die
+	fi
+
+	read -r old_ver <<<"${REPLACING_VERSIONS}"
+	if [[ ! $old_ver ]]; then
+		:
+	elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
+		return
+	fi
+
+	while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, it may contain a command to set
+the terminal's window title. Those who were already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash set the window title in the case
+that the terminal is controlled by sshd(8), unless screen is launched on the
+remote side or the terminal reliably supports saving and restoring the title
+(as alacritty, foot and tmux do). Those wanting for the title to be set
+regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
+drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
+}

diff --git a/app-shells/bash/files/bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch b/app-shells/bash/files/bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch
new file mode 100644
index 000000000000..832520c6e7ec
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p32-read-delimiter-in-invalid-mbchar.patch
@@ -0,0 +1,297 @@
+From 0432ec33408ac124b620c44416c9c58f0c10b63b Mon Sep 17 00:00:00 2001
+From: Kerin Millar <kfm@plushkava.net>
+Date: Fri, 23 Aug 2024 04:14:36 +0100
+Subject: [PATCH] Backport fix for issue with read delimiter in invalid
+ mutibyte char
+
+This addresses a regression introduced by 5.0. Consider the following
+test case.
+
+for i in {194..245}; do printf -v o %o "$i"; printf "\\$o\\n"; done |
+while read -r; do declare -p REPLY; done
+
+BEFORE
+
+declare -- REPLY=$'\302\n\303\n\304\n\305\n\306\n\307\n\310\n\311\n\312\
+n\313\n\314\n\315\n\316\n\317\n\320\n\321\n\322\n\323\n\324\n\325\n\326\
+n\327\n\330\n\331\n\332\n\333\n\334\n\335\n\336\n\337\n\340\n\341\n\342\
+n\343\n\344\n\345\n\346\n\347\n\350\n\351\n\352\n\353\n\354\n\355\n\356\
+n\357\n\360\n\361\n\362\n\363\n\364\n\365'
+
+AFTER
+
+declare -- REPLY=$'\302'
+declare -- REPLY=$'\303'
+declare -- REPLY=$'\304'
+declare -- REPLY=$'\305'
+declare -- REPLY=$'\306'
+declare -- REPLY=$'\307'
+declare -- REPLY=$'\310'
+declare -- REPLY=$'\311'
+declare -- REPLY=$'\312'
+declare -- REPLY=$'\313'
+declare -- REPLY=$'\314'
+declare -- REPLY=$'\315'
+declare -- REPLY=$'\316'
+declare -- REPLY=$'\317'
+declare -- REPLY=$'\320'
+declare -- REPLY=$'\321'
+declare -- REPLY=$'\322'
+declare -- REPLY=$'\323'
+declare -- REPLY=$'\324'
+declare -- REPLY=$'\325'
+declare -- REPLY=$'\326'
+declare -- REPLY=$'\327'
+declare -- REPLY=$'\330'
+declare -- REPLY=$'\331'
+declare -- REPLY=$'\332'
+declare -- REPLY=$'\333'
+declare -- REPLY=$'\334'
+declare -- REPLY=$'\335'
+declare -- REPLY=$'\336'
+declare -- REPLY=$'\337'
+declare -- REPLY=$'\340'
+declare -- REPLY=$'\341'
+declare -- REPLY=$'\342'
+declare -- REPLY=$'\343'
+declare -- REPLY=$'\344'
+declare -- REPLY=$'\345'
+declare -- REPLY=$'\346'
+declare -- REPLY=$'\347'
+declare -- REPLY=$'\350'
+declare -- REPLY=$'\351'
+declare -- REPLY=$'\352'
+declare -- REPLY=$'\353'
+declare -- REPLY=$'\354'
+declare -- REPLY=$'\355'
+declare -- REPLY=$'\356'
+declare -- REPLY=$'\357'
+declare -- REPLY=$'\360'
+declare -- REPLY=$'\361'
+declare -- REPLY=$'\362'
+declare -- REPLY=$'\363'
+declare -- REPLY=$'\364'
+declare -- REPLY=$'\365'
+
+Signed-off-by: Kerin Millar <kfm@plushkava.net>
+---
+ builtins/read.def | 25 ++++++++++++----
+ externs.h         |  1 +
+ lib/sh/zread.c    | 74 +++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 94 insertions(+), 6 deletions(-)
+
+diff --git builtins/read.def builtins/read.def
+index ddd91d32..53b4bd81 100644
+--- builtins/read.def
++++ builtins/read.def
+@@ -130,7 +130,7 @@ static void set_readline_timeout PARAMS((sh_timer *t, time_t, long));
+ #endif
+ static SHELL_VAR *bind_read_variable PARAMS((char *, char *, int));
+ #if defined (HANDLE_MULTIBYTE)
+-static int read_mbchar PARAMS((int, char *, int, int, int));
++static int read_mbchar PARAMS((int, char *, int, int, int, int));
+ #endif
+ static void ttyrestore PARAMS((struct ttsave *));
+ 
+@@ -806,7 +806,7 @@ add_char:
+ 	  else
+ #  endif
+ 	  if (locale_utf8locale == 0 || ((c & 0x80) != 0))
+-	    i += read_mbchar (fd, input_string, i, c, unbuffered_read);
++	    i += read_mbchar (fd, input_string, i, c, delim, unbuffered_read);
+ 	}
+ #endif
+ 
+@@ -1064,10 +1064,10 @@ bind_read_variable (name, value, flags)
+ 
+ #if defined (HANDLE_MULTIBYTE)
+ static int
+-read_mbchar (fd, string, ind, ch, unbuffered)
++read_mbchar (fd, string, ind, ch, delim, unbuffered)
+      int fd;
+      char *string;
+-     int ind, ch, unbuffered;
++     int ind, ch, delim, unbuffered;
+ {
+   char mbchar[MB_LEN_MAX + 1];
+   int i, n, r;
+@@ -1101,8 +1101,21 @@ read_mbchar (fd, string, ind, ch, unbuffered)
+ 	  mbchar[i++] = c;	
+ 	  continue;
+ 	}
+-      else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0)
+-	break;
++      else if (ret == (size_t)-1)
++	{
++	  /* If we read a delimiter character that makes this an invalid
++	     multibyte character, we can't just add it to the input string
++	     and treat it as a byte. We need to push it back so a subsequent
++	     zread will pick it up. */
++	  if (c == delim)
++	    {
++	      zungetc (c);
++	      mbchar[--i] = '\0';		/* unget the delimiter */
++	    }
++	  break;		/* invalid multibyte character */
++	}
++      else if (ret == (size_t)0 || ret > (size_t)0)
++	break;		/* valid multibyte character */
+     }
+ 
+ mbchar_return:
+diff --git externs.h externs.h
+index 931dba9c..1b70a13b 100644
+--- externs.h
++++ externs.h
+@@ -536,6 +536,7 @@ extern ssize_t zreadintr PARAMS((int, char *, size_t));
+ extern ssize_t zreadc PARAMS((int, char *));
+ extern ssize_t zreadcintr PARAMS((int, char *));
+ extern ssize_t zreadn PARAMS((int, char *, size_t));
++extern int zungetc PARAMS((int));
+ extern void zreset PARAMS((void));
+ extern void zsyncfd PARAMS((int));
+ 
+diff --git lib/sh/zread.c lib/sh/zread.c
+index dafb7f60..7cfbb288 100644
+--- lib/sh/zread.c
++++ lib/sh/zread.c
+@@ -41,6 +41,10 @@ extern int errno;
+ #  define ZBUFSIZ 4096
+ #endif
+ 
++#ifndef EOF
++#  define EOF -1
++#endif
++
+ extern int executing_builtin;
+ 
+ extern void check_signals_and_traps (void);
+@@ -48,6 +52,11 @@ extern void check_signals (void);
+ extern int signal_is_trapped (int);
+ extern int read_builtin_timeout (int);
+ 
++int zungetc (int);
++
++/* Provide one character of pushback whether we are using read or zread. */
++static int zpushedchar = -1;
++
+ /* Read LEN bytes from FD into BUF.  Retry the read on EINTR.  Any other
+    error causes the loop to break. */
+ ssize_t
+@@ -59,6 +68,15 @@ zread (fd, buf, len)
+   ssize_t r;
+ 
+   check_signals ();	/* check for signals before a blocking read */
++
++  /* If we pushed a char back, return it immediately */
++  if (zpushedchar != -1)
++    {
++      *buf = (unsigned char)zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   /* should generalize into a mechanism where different parts of the shell can
+      `register' timeouts and have them checked here. */
+   while (((r = read_builtin_timeout (fd)) < 0 || (r = read (fd, buf, len)) < 0) &&
+@@ -95,6 +113,14 @@ zreadretry (fd, buf, len)
+   ssize_t r;
+   int nintr;
+ 
++  /* If we pushed a char back, return it immediately */
++  if (zpushedchar != -1)
++    {
++      *buf = (unsigned char)zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   for (nintr = 0; ; )
+     {
+       r = read (fd, buf, len);
+@@ -118,6 +144,15 @@ zreadintr (fd, buf, len)
+      size_t len;
+ {
+   check_signals ();
++
++  /* If we pushed a char back, return it immediately */
++  if (zpushedchar != -1)
++    {
++      *buf = (unsigned char)zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   return (read (fd, buf, len));
+ }
+ 
+@@ -135,6 +170,14 @@ zreadc (fd, cp)
+ {
+   ssize_t nr;
+ 
++  /* If we pushed a char back, return it immediately */
++  if (zpushedchar != -1 && cp)
++    {
++      *cp = (unsigned char)zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   if (lind == lused || lused == 0)
+     {
+       nr = zread (fd, lbuf, sizeof (lbuf));
+@@ -160,6 +203,14 @@ zreadcintr (fd, cp)
+ {
+   ssize_t nr;
+ 
++  /* If we pushed a char back, return it immediately */
++  if (zpushedchar != -1 && cp)
++    {
++      *cp = (unsigned char)zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   if (lind == lused || lused == 0)
+     {
+       nr = zreadintr (fd, lbuf, sizeof (lbuf));
+@@ -186,6 +237,13 @@ zreadn (fd, cp, len)
+ {
+   ssize_t nr;
+ 
++  if (zpushedchar != -1 && cp)
++    {
++      *cp = zpushedchar;
++      zpushedchar = -1;
++      return 1;
++    }
++
+   if (lind == lused || lused == 0)
+     {
+       if (len > sizeof (lbuf))
+@@ -204,6 +262,22 @@ zreadn (fd, cp, len)
+   return 1;
+ }
+ 
++int
++zungetc (c)
++     int c;
++{
++  if (zpushedchar == -1)
++    {
++      zpushedchar = c;
++      return c;
++    }
++
++  if (c == EOF || lind == 0)
++    return (EOF);
++  lbuf[--lind] = c;		/* XXX */
++  return c;
++}
++
+ void
+ zreset ()
+ {
+-- 
+2.45.2
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-08-26 22:54 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24  2:41 [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-08-26 22:54 Sam James
2024-08-02  1:06 Sam James
2024-01-14  2:30 Sam James
2024-01-08 17:14 Sam James
2023-02-28  3:20 Sam James
2023-01-11  7:50 Sam James
2022-10-08 22:08 Sam James
2020-09-24 15:41 Lars Wendler
2019-09-02  7:54 Lars Wendler
2019-03-20 18:25 Lars Wendler
2019-03-07 22:19 Lars Wendler
2019-03-07 22:19 Lars Wendler
2018-01-16  9:50 Lars Wendler
2016-12-04 16:09 Lars Wendler
2016-10-13  8:32 Lars Wendler
2016-10-07  9:06 Lars Wendler
2016-08-11 13:28 Mike Frysinger
2016-06-23  5:44 Mike Frysinger
2016-01-26  7:23 Mike Frysinger
2015-10-15 16:22 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox