summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-03-23 02:27:46 +0000
committerMike Frysinger <vapier@gentoo.org>2010-03-23 02:27:46 +0000
commitb4a32e13f2d83a37a98b46be6416364b2285068c (patch)
treeb673da6ac9bd4b843a6f70a8c9c750e7f6c6cece /app-shells
parentVersion bump. (diff)
downloadhistorical-b4a32e13f2d83a37a98b46be6416364b2285068c.tar.gz
historical-b4a32e13f2d83a37a98b46be6416364b2285068c.tar.bz2
historical-b4a32e13f2d83a37a98b46be6416364b2285068c.zip
Add fix from upstream for `set` heredoc output #310197 by Doktor Notor.
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash/ChangeLog9
-rw-r--r--app-shells/bash/Manifest14
-rw-r--r--app-shells/bash/bash-4.0_p38.ebuild193
-rw-r--r--app-shells/bash/bash-4.1_p2-r1.ebuild186
-rw-r--r--app-shells/bash/files/bash-4.x-deferred-heredocs.patch47
5 files changed, 443 insertions, 6 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog
index faebcb02ef70..84d5d17b46ed 100644
--- a/app-shells/bash/ChangeLog
+++ b/app-shells/bash/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-shells/bash
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.249 2010/03/22 12:53:12 fauli Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.250 2010/03/23 02:27:42 vapier Exp $
+
+*bash-4.1_p2-r1 (23 Mar 2010)
+*bash-4.0_p38 (23 Mar 2010)
+
+ 23 Mar 2010; Mike Frysinger <vapier@gentoo.org> +bash-4.0_p38.ebuild,
+ +bash-4.1_p2-r1.ebuild, +files/bash-4.x-deferred-heredocs.patch:
+ Add fix from upstream for `set` heredoc output #310197 by Doktor Notor.
22 Mar 2010; Christian Faulhammer <fauli@gentoo.org> bash-4.0_p37.ebuild:
stable x86, bug 310473
diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 2f48c04c335e..91e3e6c28ac4 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -1,5 +1,5 @@
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA256
AUX autoconf-mktime-2.59.patch 4686 RMD160 64f719df39ae0a17999cb6b87ce9c5e275fcd7eb SHA1 4355b22b415c703c8ca9cc1b7b89ec44edc7ad4c SHA256 3c16de6cbe24fc806c29390eaf4c7e1d9ceda3df523bb18941cf0a3184356bba
AUX bash-3.0-configs.patch 2538 RMD160 00e8015531efb6a59298782581928f1aff2247e6 SHA1 7f4615de4ac2219372d34dfbead3311fcfdfab2a SHA256 09d11c8e6158b2346fc39830d75af2210cd1cec7c8e9965aed96b66213310d3f
@@ -24,6 +24,7 @@ AUX bash-4.0-ldflags-for-build.patch 512 RMD160 cebd92af1de1a97838248bbd5db0d626
AUX bash-4.0-negative-return.patch 748 RMD160 ba602c6fb3caa055a09a72122c45e160ea51e323 SHA1 8fe1b27ad67e3e3b098b7ddeb6ded35594a9b106 SHA256 771f89825fc81ff035f1b03dfe1e65b7e58a0039c005067b0c37414b84ddbf2b
AUX bash-4.0-parallel-build.patch 2237 RMD160 82aa28d48f12978cbaea7ebed987d13f5368c2c8 SHA1 c82d0c9ca049fe3c53418f4a3b399a840bbcdc90 SHA256 65db03b0c0b8e2fd917f049e9e84f7b2b234b3e9e37f395d4d8984194b392a56
AUX bash-4.1-parallel-build.patch 829 RMD160 371bd2d62a0b70c4305697975780165e02f2b38d SHA1 9978a6ed4668509660491799bbbc5b7d6ad2cbd9 SHA256 0da60b91e4fb2326137a4dde6d8937592b6efea45de51194ca1770127637e652
+AUX bash-4.x-deferred-heredocs.patch 1255 RMD160 69e3554d225e5a85be3f874b0bb0139c0e24c9b9 SHA1 b8d492af021ae59c9799dfbb169842c23ed9f826 SHA256 845ffcd7035eef5dc029747f211a737e0260b53b16086a37fb3c8ab3609a7d36
AUX bash_logout 205 RMD160 fa6064b67bd02cf66dc490759442a0127770d420 SHA1 a6983665cc842bde96fbc8811be89cf8fda71a45 SHA256 15aaded954389c05d7de5d36c4887db61975ad52c87ad78baf1062ec8997289d
AUX bashrc 2796 RMD160 7d88ed1dbe1f88c8752b2301376f4702fc178375 SHA1 783fcfd8c3273184db638f5e61da1d0921426d00 SHA256 de72a331ed65585fd70353d0d36d5d69e229b7db52c7cb97aeefd8f1b148d218
AUX dot-bash_logout 127 RMD160 6092e24ba79924d0dd566657f97972237f8f5b68 SHA1 9e1e6e03b033fdfcf9f2098324bac5754c26ec69 SHA256 3bcb4958dad662fc2cbe77177236679f7a09b8bdb0be738102df4457394f4022
@@ -137,6 +138,7 @@ DIST bash40-034 2160 RMD160 d6df7474d1ab799791330883ada9f090cab1d908 SHA1 ea9f32
DIST bash40-035 1884 RMD160 f82ce59f1134355d79248801d90fb2c8c112ad93 SHA1 79e6698a402b07450d3b9ab664f3ef5a6c53d85c SHA256 1806e4efa9b7dc796cec0acc4062cd501b2646591699c14b4899c26438c8f673
DIST bash40-036 2618 RMD160 b88d021c6ea269e4c0e8d86b2e780f77020621da SHA1 409df419c5562d110e405ddd3b8c8560f388d849 SHA256 7a78204900f68668dabf7b30a6df2398b47e810c51929e1c2b3f69f5a917102f
DIST bash40-037 1626 RMD160 bb19a618b2d8aa4823a7926c8064414c2cecefad SHA1 00173a5d8a68137c812892db404f6617daef4960 SHA256 f02284ad64deccb232bfc6c12fe2bc365c731d7e3ada354dd9527164c98cdf0a
+DIST bash40-038 1620 RMD160 ae6209461a5687c4b180949165494e8254da009c SHA1 e580745b95b4b7a80e865c5903328e16f0320691 SHA256 b31ea07d9ac47b261065265beb01a5420939447aa0932ff9f78b049117afc19f
DIST bash41-001 1445 RMD160 20730f893b6661a6bb00102548156c3cb059f6bc SHA1 41e176f9de749e432bebb8fac5d033a3936045f6 SHA256 a6e47fa108f853d0f0999520509c11680d37c8b7823b92b96d431766dd620278
DIST bash41-002 1799 RMD160 1a579481f81953e7f1dede0aaf1a03e4aad29aaf SHA1 72a9ad2e08d35e02ac1417f3aedf39db4cb4c66f SHA256 322e229de186b3bd87dedabfbad8386716f103e87ff00cd1b2db844e0dff78f8
DIST readline51-001 2042 RMD160 93dd36106f68682c4dc73a9b1ecf62bf7943fae4 SHA1 2d369ad65a8751d0a9721002c06e139afe35265b SHA256 2c9786b231a454504c3f38361af6fd74e61789bc1009eba5fb2447b5a3ac5774
@@ -144,13 +146,15 @@ EBUILD bash-3.1_p17.ebuild 4643 RMD160 46f3d1fe569cc0b5f23cb3f1c06244caf090fbd6
EBUILD bash-3.2_p50.ebuild 6146 RMD160 13f3957af7bc8763d431846802dfcdd8455f14cf SHA1 283ec5975998e5cf7128a9a0e889d6f54d506922 SHA256 703287cd42028c99c5a4f610042732f9af27a971d5728878fba12f8a25020515
EBUILD bash-4.0_p35.ebuild 5784 RMD160 0d3f12c317794f751da33ab6e51926aafde10694 SHA1 120e55091bc67363214967fbf02fcb373905aef7 SHA256 be228bea883c3b952851959f27f206777bfe571a575ee3b6202f9db5b4517ac8
EBUILD bash-4.0_p37.ebuild 5885 RMD160 4cac685cc3b1d4bef0437a1821660f544f8a9051 SHA1 eda3358e75600593546c479dc38a644267dce469 SHA256 be499d8b8bf64ec45d15cd469f3a1c2f69787e184d265fc414fece0b0f02cf34
+EBUILD bash-4.0_p38.ebuild 5906 RMD160 e4bb3f4cbde3e52393b7e63615a227b4e5e506b7 SHA1 b6e0561430b43bfac633ab11e46baf9d532d3cd1 SHA256 028319572ba6b6825eb33b2b67340831fc007fc7f1a1b5b2e52153d2a28a569a
+EBUILD bash-4.1_p2-r1.ebuild 5551 RMD160 25249eb4a26e6b7e27d61499224bc3656e4d37dd SHA1 9ac46b7d2ac45c11e759f8e64ba49404313df1e3 SHA256 f2ddeaeb56314150c254c2ee9b4041ee0ebcba5e908f2ba286a25e536c5bcd43
EBUILD bash-4.1_p2.ebuild 5491 RMD160 0c6d7734f41862701c320a648d97f6faa85bf70f SHA1 a4a48fd39d12db7aa620aeee2feef9b8fbfbaeea SHA256 b422714c9a54ec97a5c10a4bf7fb2de88fa65c3cad507b5924473e5fa6f7bc77
-MISC ChangeLog 39530 RMD160 6d24b46310ca1aa1d48075759e2a1460a1721fd6 SHA1 7fad3fcbfca4579c551866b825ef2f88c27f53f2 SHA256 785e34d296d6a5b2320ce2e2d9a7f8529d86a084b50392cfab5fe30b7cbdb2bd
+MISC ChangeLog 39804 RMD160 5e103dac191d367e925e21faf8510cfe8c11e789 SHA1 2eccb23c99eafabc41d695f6877ed5acf71da4b0 SHA256 a9d9cf3cc1eeecd5ff983cf3627c2bdc290e7cac631a709351457c2b25f1ba12
MISC metadata.xml 568 RMD160 c778ff1669af3c368238bcf481b344b741f0d6e1 SHA1 8d74d1c518351ad8085c9c26a5f2554d8c768b20 SHA256 48d380acb97dda0a7f4bd918b208d11367a8367d289b0a2d78ef08ef9a4e2562
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
-iEYEARECAAYFAkunaEoACgkQNQqtfCuFneOaRACfQkZiHi4z1q+44oyNcGY0cyeX
-Ik0An3BxgXoer4MRv3BIb9JLYbwN7nvw
-=qYxD
+iF4EAREIAAYFAkuoJyQACgkQTwhj9JtAlp5QygD/TgK+OV/3pSr930PnFYU/8ID+
+t8exaL8ZOmWyoTrZxOMBAIF31VAVpCTgAbKJ3mGw/6RXRhzsF8BC/BqUxxbIw8Xa
+=HOFV
-----END PGP SIGNATURE-----
diff --git a/app-shells/bash/bash-4.0_p38.ebuild b/app-shells/bash/bash-4.0_p38.ebuild
new file mode 100644
index 000000000000..ba2672aa83ed
--- /dev/null
+++ b/app-shells/bash/bash-4.0_p38.ebuild
@@ -0,0 +1,193 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.0_p38.ebuild,v 1.1 2010/03/23 02:27:42 vapier Exp $
+
+EAPI="1"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+READLINE_VER=6.0
+READLINE_PLEVEL=0 # both readline patches are also released as bash patches
+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
+}
+
+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)
+ $(patches ${READLINE_PLEVEL} readline ${READLINE_VER})"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla"
+
+DEPEND=">=sys-libs/ncurses-5.2-r2
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ !<sys-apps/portage-2.1.5
+ !<sys-apps/paludis-0.26.0_alpha5"
+
+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
+}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+ cd "${S}"
+
+ # Include official patches
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ cd lib/readline
+ [[ ${READLINE_PLEVEL} -gt 0 ]] && epatch $(patches -s ${READLINE_PLEVEL} readline ${READLINE_VER})
+ cd ../..
+
+ epatch "${FILESDIR}"/${PN}-4.0-configure.patch #304901
+ epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
+
+ if ! use vanilla ; then
+ sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
+ epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
+ 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
+ # Log bash commands to syslog #91327
+ 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."
+ ebeep
+ epause
+ epatch "${FILESDIR}"/${PN}-3.1-bash-logger.patch
+ fi
+ sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613
+ fi
+}
+
+src_compile() {
+ 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
+
+ # Always use the buildin readline, else if we update readline
+ # bash gets borked as readline is usually not binary compadible
+ # between minor versions.
+ #myconf="${myconf} $(use_with !readline installed-readline)"
+ myconf="${myconf} --without-installed-readline"
+
+ # 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="${myconf} --disable-nls"
+
+ # Force linking with system curses ... the bundled termcap lib
+ # sucks bad compared to ncurses
+ myconf="${myconf} --with-curses"
+
+ use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+ econf \
+ $(use_with afs) \
+ $(use_enable net net-redirections) \
+ --disable-profiling \
+ $(use_enable mem-scramble) \
+ $(use_with mem-scramble bash-malloc) \
+ ${myconf} || die
+ emake || die "make failed"
+
+ if use plugins ; then
+ emake -C examples/loadables all others || die
+ fi
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ dodir /bin
+ mv "${D}"/usr/bin/bash "${D}"/bin/ || die
+ dosym bash /bin/rbash
+
+ insinto /etc/bash
+ doins "${FILESDIR}"/{bashrc,bash_logout}
+ insinto /etc/skel
+ for f in bash{_logout,_profile,rc} ; do
+ newins "${FILESDIR}"/dot-${f} .${f}
+ done
+
+ sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
+ sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
+
+ if use plugins ; then
+ exeinto /usr/$(get_libdir)/bash
+ doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
+ fi
+
+ if use examples ; then
+ for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; 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
+ dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
+ dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+ if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
+ mkdir -p "${ROOT}"/etc/bash
+ mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
+ fi
+
+ if [[ -L ${ROOT}/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 "${ROOT}"/bin/sh)
+ ln -sf "${target}" "${ROOT}"/bin/sh
+ fi
+}
+
+pkg_postinst() {
+ # If /bin/sh does not exist, provide it
+ if [[ ! -e ${ROOT}/bin/sh ]]; then
+ ln -sf bash "${ROOT}"/bin/sh
+ fi
+}
diff --git a/app-shells/bash/bash-4.1_p2-r1.ebuild b/app-shells/bash/bash-4.1_p2-r1.ebuild
new file mode 100644
index 000000000000..fb373b5b01e5
--- /dev/null
+++ b/app-shells/bash/bash-4.1_p2-r1.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.1_p2-r1.ebuild,v 1.1 2010/03/23 02:27:42 vapier Exp $
+
+EAPI="1"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+# 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}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+READLINE_VER=6.1
+READLINE_PLEVEL=0 # both readline patches are also released as bash patches
+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
+}
+
+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)
+ $(patches ${READLINE_PLEVEL} readline ${READLINE_VER})"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla"
+
+DEPEND=">=sys-libs/ncurses-5.2-r2
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ !<sys-apps/portage-2.1.7.16
+ !<sys-apps/paludis-0.26.0_alpha5"
+
+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
+ cd "${S}"
+
+ # Include official patches
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ cd lib/readline
+ [[ ${READLINE_PLEVEL} -gt 0 ]] && epatch $(patches -s ${READLINE_PLEVEL} readline ${READLINE_VER})
+ cd ../..
+
+ epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
+
+ if ! use vanilla ; then
+ sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
+ epatch "${FILESDIR}"/${PN}-4.1-parallel-build.patch
+ fi
+}
+
+src_compile() {
+ 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)
+
+ # Always use the buildin readline, else if we update readline
+ # bash gets borked as readline is usually not binary compadible
+ # between minor versions.
+ #myconf="${myconf} $(use_with !readline installed-readline)"
+ myconf="${myconf} --without-installed-readline"
+
+ # 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="${myconf} --disable-nls"
+
+ # Force linking with system curses ... the bundled termcap lib
+ # sucks bad compared to ncurses
+ myconf="${myconf} --with-curses"
+
+ use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
+ econf \
+ $(use_with afs) \
+ $(use_enable net net-redirections) \
+ --disable-profiling \
+ $(use_enable mem-scramble) \
+ $(use_with mem-scramble bash-malloc) \
+ ${myconf} || die
+ emake || die "make failed"
+
+ if use plugins ; then
+ emake -C examples/loadables all others || die
+ fi
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ dodir /bin
+ mv "${D}"/usr/bin/bash "${D}"/bin/ || die
+ dosym bash /bin/rbash
+
+ insinto /etc/bash
+ doins "${FILESDIR}"/{bashrc,bash_logout}
+ insinto /etc/skel
+ for f in bash{_logout,_profile,rc} ; do
+ newins "${FILESDIR}"/dot-${f} .${f}
+ done
+
+ sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
+ sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
+
+ if use plugins ; then
+ exeinto /usr/$(get_libdir)/bash
+ doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
+ fi
+
+ if use examples ; then
+ for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; 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
+ dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
+ dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+ if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
+ mkdir -p "${ROOT}"/etc/bash
+ mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
+ fi
+
+ if [[ -L ${ROOT}/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 "${ROOT}"/bin/sh)
+ ln -sf "${target}" "${ROOT}"/bin/sh
+ fi
+}
+
+pkg_postinst() {
+ # If /bin/sh does not exist, provide it
+ if [[ ! -e ${ROOT}/bin/sh ]]; then
+ ln -sf bash "${ROOT}"/bin/sh
+ fi
+}
diff --git a/app-shells/bash/files/bash-4.x-deferred-heredocs.patch b/app-shells/bash/files/bash-4.x-deferred-heredocs.patch
new file mode 100644
index 000000000000..698d277a3db5
--- /dev/null
+++ b/app-shells/bash/files/bash-4.x-deferred-heredocs.patch
@@ -0,0 +1,47 @@
+http://bugs.gentoo.org/310197
+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
+***************
+*** 114,117 ****
+--- 114,123 ----
+ #define CHECK_XTRACE_FP xtrace_fp = (xtrace_fp ? xtrace_fp : stderr)
+
++ #define PRINT_DEFERRED_HEREDOCS(x) \
++ do { \
++ if (deferred_heredocs) \
++ print_deferred_heredocs (x); \
++ } while (0)
++
+ /* Non-zero means the stuff being printed is inside of a function def. */
+ static int inside_function_def;
+***************
+*** 561,571 ****
+ {
+ print_for_command_head (for_command);
+-
+ cprintf (";");
+ newline ("do\n");
+ indentation += indentation_amount;
+ make_command_string_internal (for_command->action);
+ semicolon ();
+ indentation -= indentation_amount;
+ newline ("done");
+ }
+--- 566,578 ----
+ {
+ print_for_command_head (for_command);
+ cprintf (";");
+ newline ("do\n");
++
+ indentation += indentation_amount;
+ make_command_string_internal (for_command->action);
++ PRINT_DEFERRED_HEREDOCS ("");
+ semicolon ();
+ indentation -= indentation_amount;
++
+ newline ("done");
+ }