summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-10-19 20:31:56 +0000
committerMike Frysinger <vapier@gentoo.org>2014-10-19 20:31:56 +0000
commit3d151766ad406d5bfc73eaa16c568b556b4c4774 (patch)
treec4307b160640b5bde41e3fefe74bd4ed19c65371 /app-shells
parentRevbump to fix mysql_config embedded libs location and tokudb patch (diff)
downloadgentoo-2-3d151766ad406d5bfc73eaa16c568b556b4c4774.tar.gz
gentoo-2-3d151766ad406d5bfc73eaa16c568b556b4c4774.tar.bz2
gentoo-2-3d151766ad406d5bfc73eaa16c568b556b4c4774.zip
Restore SLOTed bash-2.05b and bash-3.0 for devs.
(Portage version: 2.2.14_rc1/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key D2E96200)
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash/ChangeLog22
-rw-r--r--app-shells/bash/bash-2.05b_p13.ebuild143
-rw-r--r--app-shells/bash/bash-3.0_p22.ebuild152
-rw-r--r--app-shells/bash/bash-3.1_p23.ebuild6
-rw-r--r--app-shells/bash/files/bash-2.05b-destdir.patch28
-rw-r--r--app-shells/bash/files/bash-2.05b-empty-herestring.patch25
-rw-r--r--app-shells/bash/files/bash-2.05b-fix-job-warning.patch14
-rw-r--r--app-shells/bash/files/bash-2.05b-jobs.patch28
-rw-r--r--app-shells/bash/files/bash-2.05b-protos.patch25
-rw-r--r--app-shells/bash/files/bash-2.05b-rbash.patch27
-rw-r--r--app-shells/bash/files/bash-3.0-afs.patch20
-rw-r--r--app-shells/bash/files/bash-3.0-configs.patch22
-rw-r--r--app-shells/bash/files/bash-3.0-crash.patch46
-rw-r--r--app-shells/bash/files/bash-3.0-darwin-conn.patch20
-rw-r--r--app-shells/bash/files/bash-3.0-histtimeformat.patch56
-rw-r--r--app-shells/bash/files/bash-3.0-jobs.patch56
-rw-r--r--app-shells/bash/files/bash-3.0-locale.patch112
-rw-r--r--app-shells/bash/files/bash-3.0-manpage.patch15
-rw-r--r--app-shells/bash/files/bash-3.0-multibyteifs.patch281
-rw-r--r--app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch20
-rw-r--r--app-shells/bash/files/bash-3.0-protos.patch68
-rw-r--r--app-shells/bash/files/bash-3.0-pwd.patch16
-rw-r--r--app-shells/bash/files/bash-3.0-rbash.patch18
-rw-r--r--app-shells/bash/files/bash-3.0-read-builtin-pipe.patch20
-rw-r--r--app-shells/bash/files/bash-3.0-read-e-segfault.patch26
-rw-r--r--app-shells/bash/files/bash-3.0-strnlen.patch175
-rw-r--r--app-shells/bash/files/bash-3.0-subshell.patch39
-rw-r--r--app-shells/bash/files/bash-3.0-ulimit.patch186
-rw-r--r--app-shells/bash/files/bash-3.0-volatile-command.patch16
29 files changed, 1676 insertions, 6 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog
index d08d62101a57..7d447e736b14 100644
--- a/app-shells/bash/ChangeLog
+++ b/app-shells/bash/ChangeLog
@@ -1,6 +1,26 @@
# ChangeLog for app-shells/bash
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.421 2014/10/19 20:30:15 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.422 2014/10/19 20:31:56 vapier Exp $
+
+*bash-3.0_p22 (19 Oct 2014)
+*bash-2.05b_p13 (19 Oct 2014)
+
+ 19 Oct 2014; Mike Frysinger <vapier@gentoo.org> +bash-2.05b_p13.ebuild,
+ +bash-3.0_p22.ebuild, bash-3.1_p23.ebuild, +files/bash-2.05b-destdir.patch,
+ +files/bash-2.05b-empty-herestring.patch,
+ +files/bash-2.05b-fix-job-warning.patch, +files/bash-2.05b-jobs.patch,
+ +files/bash-2.05b-protos.patch, +files/bash-2.05b-rbash.patch,
+ +files/bash-3.0-afs.patch, +files/bash-3.0-configs.patch,
+ +files/bash-3.0-crash.patch, +files/bash-3.0-darwin-conn.patch,
+ +files/bash-3.0-histtimeformat.patch, +files/bash-3.0-jobs.patch,
+ +files/bash-3.0-locale.patch, +files/bash-3.0-manpage.patch,
+ +files/bash-3.0-multibyteifs.patch, +files/bash-3.0-pgrp-pipe-fix.patch,
+ +files/bash-3.0-protos.patch, +files/bash-3.0-pwd.patch,
+ +files/bash-3.0-rbash.patch, +files/bash-3.0-read-builtin-pipe.patch,
+ +files/bash-3.0-read-e-segfault.patch, +files/bash-3.0-strnlen.patch,
+ +files/bash-3.0-subshell.patch, +files/bash-3.0-ulimit.patch,
+ +files/bash-3.0-volatile-command.patch:
+ Restore SLOTed bash-2.05b and bash-3.0 for devs.
19 Oct 2014; Mike Frysinger <vapier@gentoo.org>
+files/bash-2.05b-parallel-build.patch, +files/bash-3.1-protos.patch,
diff --git a/app-shells/bash/bash-2.05b_p13.ebuild b/app-shells/bash/bash-2.05b_p13.ebuild
new file mode 100644
index 000000000000..05319183d2cc
--- /dev/null
+++ b/app-shells/bash/bash-2.05b_p13.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-2.05b_p13.ebuild,v 1.1 2014/10/19 20:31:56 vapier Exp $
+
+EAPI="4"
+
+inherit eutils 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}
+[[ ${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
+}
+
+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)"
+
+LICENSE="GPL-2"
+SLOT="${MY_PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="afs +net nls +readline"
+
+DEPEND=">=sys-libs/ncurses-5.2-r2
+ readline? ( >=sys-libs/readline-6.2 )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}"
+
+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
+}
+
+src_prepare() {
+ # Include official patches
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(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
+ 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_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # Force pgrp synchronization
+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
+ export bash_cv_pgrp_pipe=yes
+
+ # 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
+
+ # 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=6.2
+
+ # 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 :(.
+
+ 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[@]}"
+}
+
+src_install() {
+ into /
+ newbin bash bash-${SLOT}
+
+ newman doc/bash.1 bash-${SLOT}.1
+ newman doc/builtins.1 builtins-${SLOT}.1
+
+ insinto /usr/share/info
+ newins doc/bashref.info bash-${SLOT}.info
+ dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
+
+ dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
+}
diff --git a/app-shells/bash/bash-3.0_p22.ebuild b/app-shells/bash/bash-3.0_p22.ebuild
new file mode 100644
index 000000000000..765314adcb36
--- /dev/null
+++ b/app-shells/bash/bash-3.0_p22.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.0_p22.ebuild,v 1.1 2014/10/19 20:31:56 vapier Exp $
+
+EAPI="4"
+
+inherit eutils 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}
+[[ ${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
+}
+
+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)"
+
+LICENSE="GPL-2"
+SLOT="${MY_PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="afs +net nls +readline"
+
+DEPEND=">=sys-libs/ncurses-5.2-r2
+ readline? ( >=sys-libs/readline-6.2 )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}"
+
+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
+}
+
+src_prepare() {
+ # Include official patches
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(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
+ 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-configs.patch
+ epatch "${FILESDIR}"/${PN}-3.0-strnlen.patch
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # Force pgrp synchronization
+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
+ export bash_cv_pgrp_pipe=yes
+
+ # 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
+
+ # 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=6.2
+
+ # 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 :(.
+
+ 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[@]}"
+}
+
+src_install() {
+ into /
+ newbin bash bash-${SLOT}
+
+ newman doc/bash.1 bash-${SLOT}.1
+ newman doc/builtins.1 builtins-${SLOT}.1
+
+ insinto /usr/share/info
+ newins doc/bashref.info bash-${SLOT}.info
+ dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
+
+ dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
+}
diff --git a/app-shells/bash/bash-3.1_p23.ebuild b/app-shells/bash/bash-3.1_p23.ebuild
index fb8332eabe5a..aaa23e80820a 100644
--- a/app-shells/bash/bash-3.1_p23.ebuild
+++ b/app-shells/bash/bash-3.1_p23.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.1_p23.ebuild,v 1.5 2014/10/19 20:16:14 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.1_p23.ebuild,v 1.6 2014/10/19 20:31:56 vapier Exp $
EAPI="4"
@@ -128,10 +128,6 @@ src_configure() {
"${myconf[@]}"
}
-src_compile() {
- emake -j1 #102426
-}
-
src_install() {
into /
newbin bash bash-${SLOT}
diff --git a/app-shells/bash/files/bash-2.05b-destdir.patch b/app-shells/bash/files/bash-2.05b-destdir.patch
new file mode 100644
index 000000000000..a1089d293c16
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-destdir.patch
@@ -0,0 +1,28 @@
+support DESTDIR install
+
+--- bash-2.05b/Makefile.in
++++ bash-2.05b/Makefile.in
+@@ -20,16 +20,16 @@
+ all: .made
+
+ # Include some boilerplate Gnu makefile definitions.
+-prefix = @prefix@
++prefix = $(DESTDIR)@prefix@
+
+-exec_prefix = @exec_prefix@
+-bindir = @bindir@
+-libdir = @libdir@
+-infodir = @infodir@
+-includedir = @includedir@
++exec_prefix = $(DESTDIR)@exec_prefix@
++bindir = $(DESTDIR)@bindir@
++libdir = $(DESTDIR)@libdir@
++infodir = $(DESTDIR)@infodir@
++includedir = $(DESTDIR)@includedir@
+ datadir = @datadir@
+
+-mandir = @mandir@
++mandir = $(DESTDIR)@mandir@
+ manpfx = man
+
+ man1ext = .1
diff --git a/app-shells/bash/files/bash-2.05b-empty-herestring.patch b/app-shells/bash/files/bash-2.05b-empty-herestring.patch
new file mode 100644
index 000000000000..db868c49aea7
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-empty-herestring.patch
@@ -0,0 +1,25 @@
+###################################################################
+# Added by Tavis Ormandy <taviso@gentoo.org> 01/05/2003
+# Reproduce with
+#
+# $ xargs <<< ${EMTPY_VARIABLE}
+# Segmentation fault.
+#
+# note: bash will still give you a "\n" with this patch, but this is
+# standard behaviour, if you need proof:
+#
+# $ wc -l <<< ""
+###############################
+
+--- bash-2.05b/redir.c
++++ bash-2.05b/redir.c
+@@ -263,7 +263,7 @@
+ int herelen, n, e;
+
+ herestr = expand_string_to_string (redirectee->word, 0);
+- herelen = strlen (herestr);
++ herelen = (herestr == NULL) ? 0 : strlen (herestr);
+
+ n = write (fd, herestr, herelen);
+ if (n == herelen)
+ {
diff --git a/app-shells/bash/files/bash-2.05b-fix-job-warning.patch b/app-shells/bash/files/bash-2.05b-fix-job-warning.patch
new file mode 100644
index 000000000000..fcec078d3d0c
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-fix-job-warning.patch
@@ -0,0 +1,14 @@
+fix obvious error:
+common.c:247:5: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
+
+--- a/builtins/common.c
++++ b/builtins/common.c
+@@ -244,7 +244,7 @@
+ char *s;
+ {
+ if (s)
+- builtin_error ("%s: no job control");
++ builtin_error ("%s: no job control", s);
+ else
+ builtin_error ("no job control");
+ }
diff --git a/app-shells/bash/files/bash-2.05b-jobs.patch b/app-shells/bash/files/bash-2.05b-jobs.patch
new file mode 100644
index 000000000000..4ed475eab799
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-jobs.patch
@@ -0,0 +1,28 @@
+Fix using bash with post-20040808 glibc ebuilds (from fedora)
+
+--- bash-2.05b/jobs.c
++++ bash-2.05b/jobs.c
+@@ -2423,6 +2423,7 @@
+ PROCESS *child;
+ pid_t pid;
+ int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
++ static int wcontinued_not_supported = 0;
+
+ call_set_current = children_exited = 0;
+ last_stopped_job = NO_JOB;
+@@ -2436,7 +2437,15 @@
+ : 0;
+ if (sigchld || block == 0)
+ waitpid_flags |= WNOHANG;
++ retry:
++ if (wcontinued_not_supported)
++ waitpid_flags &= ~WCONTINUED;
+ pid = WAITPID (-1, &status, waitpid_flags);
++ if (pid == -1 && errno == EINVAL)
++ {
++ wcontinued_not_supported = 1;
++ goto retry;
++ }
+
+ /* The check for WNOHANG is to make sure we decrement sigchld only
+ if it was non-zero before we called waitpid. */
diff --git a/app-shells/bash/files/bash-2.05b-protos.patch b/app-shells/bash/files/bash-2.05b-protos.patch
new file mode 100644
index 000000000000..2a42ced54711
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-protos.patch
@@ -0,0 +1,25 @@
+move prototypes around so they show up when needed
+
+--- a/externs.h
++++ b/externs.h
+@@ -327,6 +327,9 @@
+ #undef xstrchr
+ extern char *xstrchr __P((const char *, int));
+
++/* declarations for functions defined in lib/sh/zcatfd.c */
++extern int zcatfd __P((int, int, char *));
++
+ /* declarations for functions defined in lib/sh/zread.c */
+ extern ssize_t zread __P((int, char *, size_t));
+ extern ssize_t zreadintr __P((int, char *, size_t));
+--- a/jobs.h
++++ b/jobs.h
+@@ -175,6 +175,8 @@
+ extern void ignore_tty_job_signals __P((void));
+ extern void default_tty_job_signals __P((void));
+
++extern void close_pgrp_pipe __P((void));
++
+ #if defined (JOB_CONTROL)
+ extern int job_control;
+ #endif
diff --git a/app-shells/bash/files/bash-2.05b-rbash.patch b/app-shells/bash/files/bash-2.05b-rbash.patch
new file mode 100644
index 000000000000..19b89ca35e2f
--- /dev/null
+++ b/app-shells/bash/files/bash-2.05b-rbash.patch
@@ -0,0 +1,27 @@
+Fix broken rbash functionality when used as a login shell via /etc/passwd
+
+http://bugs.gentoo.org/26854
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=170298
+
+Backported from bash-3.1
+
+--- bash-2.05b/shell.c
++++ bash-2.05b/shell.c
+@@ -1065,6 +1099,8 @@
+ if (restricted)
+ return 1;
+ temp = base_pathname (name);
++ if (*temp == '-')
++ temp++;
+ return (STREQ (temp, RESTRICTED_SHELL_NAME));
+ }
+
+@@ -1082,6 +1118,8 @@
+ char *temp;
+
+ temp = base_pathname (name);
++ if (*temp == '-')
++ temp++;
+ if (restricted || (STREQ (temp, RESTRICTED_SHELL_NAME)))
+ {
+ set_var_read_only ("PATH");
diff --git a/app-shells/bash/files/bash-3.0-afs.patch b/app-shells/bash/files/bash-3.0-afs.patch
new file mode 100644
index 000000000000..f07371c39eb4
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-afs.patch
@@ -0,0 +1,20 @@
+Ripped from Fedora
+
+- Fixed AFS support for output redirection, so that the correct errors
+ are reported for other filesystems (bug #155373).
+
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155373
+
+--- bash-3.0/redir.c.afs 2005-04-20 09:16:15.000000000 +0100
++++ bash-3.0/redir.c 2005-04-20 09:16:58.000000000 +0100
+@@ -596,7 +596,9 @@
+ fd = open (filename, flags, mode);
+ #if defined (AFS)
+ if ((fd < 0) && (errno == EACCES))
+- fd = open (filename, flags & ~O_CREAT, mode);
++ if ((fd = open (filename, flags & ~O_CREAT, mode)) < 0)
++ /* Restore previous errno. */
++ errno = EACCES;
+ #endif /* AFS */
+ }
+
diff --git a/app-shells/bash/files/bash-3.0-configs.patch b/app-shells/bash/files/bash-3.0-configs.patch
new file mode 100644
index 000000000000..956d1dca45b8
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-configs.patch
@@ -0,0 +1,22 @@
+--- bash-3.0/config.h.in
++++ bash-3.0/config.h.in
+@@ -197,7 +197,7 @@
+
+ /* System paths */
+
+-#define DEFAULT_MAIL_DIRECTORY "/usr/spool/mail"
++#define DEFAULT_MAIL_DIRECTORY "/var/spool/mail"
+
+ /* Characteristics of the system's header files and libraries that affect
+ the compilation environment. */
+--- bash-3.0/config-bot.h
++++ bash-3.0/config-bot.h
+@@ -178,4 +178,7 @@
+ /******************************************************************/
+
+ /* If you don't want bash to provide a default mail file to check. */
+-/* #undef DEFAULT_MAIL_DIRECTORY */
++/* DP: - don't define a default DEFAULT_MAIL_DIRECTORY, because it
++ * DP: can cause a timeout on NFS mounts.
++ */
++#undef DEFAULT_MAIL_DIRECTORY
diff --git a/app-shells/bash/files/bash-3.0-crash.patch b/app-shells/bash/files/bash-3.0-crash.patch
new file mode 100644
index 000000000000..984e85d82ed3
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-crash.patch
@@ -0,0 +1,46 @@
+> Machine Type: i686-pc-linux-gnu
+>
+> Bash Version: 3.0
+> Patch Level: 0
+> Release Status: release
+>
+> Description:
+> GNU bash, version 3.00.0(1)-release (i686-pc-linux-gnu)
+> (and
+> GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
+>
+> dumps a core because of a null pointer "in make_bare_word
+> at make_cmd.c:90" (see gdb output below)
+
+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
+***************
+*** 709,713 ****
+ return ((char *)NULL);
+ }
+! else if (var == 0)
+ return ((char *)NULL);
+ else if (array_p (var) == 0)
+--- 709,713 ----
+ return ((char *)NULL);
+ }
+! else if (var == 0 || value_cell (var) == 0)
+ return ((char *)NULL);
+ else if (array_p (var) == 0)
+
+
+Chet
+
+--
+``The lyf so short, the craft so long to lerne.'' - Chaucer
+( ``Discere est Dolere'' -- chet )
+ Live...Laugh...Love
+Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/
+
+
+_______________________________________________
+Bug-bash mailing list
+Bug-bash@gnu.org
+http://lists.gnu.org/mailman/listinfo/bug-bash
diff --git a/app-shells/bash/files/bash-3.0-darwin-conn.patch b/app-shells/bash/files/bash-3.0-darwin-conn.patch
new file mode 100644
index 000000000000..f83e4c3f701d
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-darwin-conn.patch
@@ -0,0 +1,20 @@
+Sune Foldager writes:
+On Darwin (Mac OS X), bash incorrectly assumed that it has been called over a
+network connection (such as ssh, rsh etc.), when stdin stems from the pipe()
+system call. This is because bash's heuristic code for determining if it's
+been started over a net connection is incorrect on Darwin kernels.
+
+http://bugs.gentoo.org/79124
+
+--- a/lib/sh/netconn.c
++++ b/lib/sh/netconn.c
+@@ -53,7 +53,8 @@
+ l = sizeof(sa);
+ rv = getpeername(fd, &sa, &l);
+ /* Solaris 2.5 getpeername() returns EINVAL if the fd is not a socket. */
+- return ((rv < 0 && (errno == ENOTSOCK || errno == EINVAL)) ? 0 : 1);
++ /* Darwin 7.7.0 getpeername() returns ENOTCONN if the fd was created with pipe(). */
++ return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1);
+ #else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */
+ # if defined (SVR4) || defined (SVR4_2)
+ /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */
diff --git a/app-shells/bash/files/bash-3.0-histtimeformat.patch b/app-shells/bash/files/bash-3.0-histtimeformat.patch
new file mode 100644
index 000000000000..b910600fd896
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-histtimeformat.patch
@@ -0,0 +1,56 @@
+Ripped from Debian
+
+http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00008.html
+
+From: Enrique Perez-Terron <enrio@online.no>
+To: bug-bash@gnu.org
+Subject: When using HISTTIMEFORMAT, the date and the command are run
+ together.
+Date: Sun, 01 Aug 2004 18:36:45 +0200
+
+Configuration Information [Automatically generated, do not change]:
+Machine: i586
+OS: linux-gnu
+Compiler: gcc
+Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
+-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu'
+-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'
+-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
+-g -O2
+uname output: Linux arabia.home.lan 2.6.6-1.435.2.3 #1 Thu Jul 1
+09:11:28 EDT 2004 i586 i586 i386 GNU/Linux
+Machine Type: i586-pc-linux-gnu
+
+# DP: Add space separating the time and the command in the
+# DP: output from the history builtin command.
+
+Bash Version: 3.0
+Patch Level: 0
+Release Status: release
+
+Description:
+ There is no space separating the time and the command in the
+ output from the history builtin command.
+
+Repeat-By:
+ $ export HISTTIMEFORMAT=_A_format_string_
+ $ history 3
+ 997 _A_format_string_echo $BASH_VERSION
+ 998 _A_format_string_export HISTTIMEFORMAT=_A_format_string_
+ 999 _A_format_string_history 3
+
+Fix:
+--- ./builtins/history.def.orig 2003-12-20 00:02:09.000000000 +0100
++++ ./builtins/history.def 2004-08-01 18:18:02.652720102 +0200
+@@ -287,9 +287,10 @@
+ QUIT;
+
+ timestr = (histtimefmt && *histtimefmt) ? histtime (hlist[i], histtimefmt) : (char *)NULL;
+- printf ("%5d%c %s%s\n", i + history_base,
++ printf ("%5d%c %s%s%s\n", i + history_base,
+ histdata(i) ? '*' : ' ',
+ ((timestr && *timestr) ? timestr : ""),
++ ((timestr && *timestr) ? " " : ""),
+ histline(i));
+ i++;
+ }
diff --git a/app-shells/bash/files/bash-3.0-jobs.patch b/app-shells/bash/files/bash-3.0-jobs.patch
new file mode 100644
index 000000000000..72c149c71cf5
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-jobs.patch
@@ -0,0 +1,56 @@
+Ripped from Fedora
+
+* Wed Sep 8 2004 Tim Waugh <twaugh@redhat.com> 3.0-13
+- Check for EINVAL from waitpid() and avoid WCONTINUED in that case.
+- Fixed jobs4 test.
+
+From: Tim Waugh
+Subject: [patch] bash-3.0: avoid WCONTINUED if invalid
+Date: Wed, 8 Sep 2004 16:52:38 +0100
+User-agent: Mutt/1.4.1i
+
+Hi,
+
+GNU libc defines WCONTINUED, but (at least on Linux 2.4.x kernels)
+waitpid() returns -1 with errno set to EINVAL if WCONTINUED is
+supplied in options.
+
+Here is a patch to retry without WCONTINUED set in that case.
+
+Tim.
+
+--- bash-3.0/tests/jobs4.sub
++++ bash-3.0/tests/jobs4.sub
+@@ -18,5 +18,5 @@
+
+ wait
+
+-cat &
++sleep 100 &
+ kill -1 %% && echo i killed it || echo could not kill it
+--- bash-3.0/jobs.c
++++ bash-3.0/jobs.c
+@@ -2475,6 +2475,7 @@
+ PROCESS *child;
+ pid_t pid;
+ int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
++ static int wcontinued_not_supported = 0;
+
+ call_set_current = children_exited = 0;
+ last_stopped_job = NO_JOB;
+@@ -2488,7 +2489,15 @@
+ : 0;
+ if (sigchld || block == 0)
+ waitpid_flags |= WNOHANG;
++ retry:
++ if (wcontinued_not_supported)
++ waitpid_flags &= ~WCONTINUED;
+ pid = WAITPID (-1, &status, waitpid_flags);
++ if (pid == -1 && errno == EINVAL)
++ {
++ wcontinued_not_supported = 1;
++ goto retry;
++ }
+
+ /* The check for WNOHANG is to make sure we decrement sigchld only
+ if it was non-zero before we called waitpid. */
diff --git a/app-shells/bash/files/bash-3.0-locale.patch b/app-shells/bash/files/bash-3.0-locale.patch
new file mode 100644
index 000000000000..ea1ef3deae36
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-locale.patch
@@ -0,0 +1,112 @@
+Ripped from SuSe
+
+http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00005.html
+
+From: schwab@suse.de
+To: bug-bash@gnu.org
+Subject: HISTTIMEFORMAT doesn't track locale changes
+Date: Sun, 1 Aug 2004 11:14:00 +0200 (CEST)
+
+Configuration Information [Automatically generated, do not change]:
+Machine: ia64
+OS: linux-gnu
+Compiler: gcc
+Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='ia64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='ia64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash-3.0 -I../bash-3.0/include -I../bash-3.0/lib -O2 -g
+uname output: Linux sykes 2.6.5-22-default #1 SMP Fri Jul 2 13:43:23 UTC 2004 ia64 ia64 ia64 GNU/Linux
+Machine Type: ia64-unknown-linux-gnu
+
+Bash Version: 3.0
+Patch Level: 0
+Release Status: release
+
+Description:
+Bash doesn't use the current locale when formatting HISTTIMEFORMAT.
+
+Repeat-By:
+sykes:/tmp/bash/Build/:[0]$ locale
+LANG=de_DE.UTF-8
+LC_CTYPE="de_DE.UTF-8"
+LC_NUMERIC=POSIX
+LC_TIME=POSIX
+LC_COLLATE=POSIX
+LC_MONETARY="de_DE.UTF-8"
+LC_MESSAGES=en_US.UTF-8
+LC_PAPER="de_DE.UTF-8"
+LC_NAME="de_DE.UTF-8"
+LC_ADDRESS="de_DE.UTF-8"
+LC_TELEPHONE="de_DE.UTF-8"
+LC_MEASUREMENT="de_DE.UTF-8"
+LC_IDENTIFICATION="de_DE.UTF-8"
+LC_ALL=
+sykes:/tmp/bash/Build/:[0]$ history 1
+ 1502 history 1
+sykes:/tmp/bash/Build/:[0]$ HISTTIMEFORMAT=%c
+sykes:/tmp/bash/Build/:[0]$ history 1
+ 1504 Sun Aug 1 10:56:59 2004history 1
+sykes:/tmp/bash/Build/:[0]$ export LC_TIME=$LANG
+sykes:/tmp/bash/Build/:[0]$ history 1
+ 1506 Sun Aug 1 10:57:24 2004history 1
+
+--- bash-3.0/locale.c
++++ bash-3.0/locale.c
+@@ -71,9 +71,10 @@ set_default_locale ()
+ textdomain (PACKAGE);
+ }
+
+-/* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES and LC_NUMERIC
+- if they are not specified in the environment, but LC_ALL is. This
+- should be called from main() after parsing the environment. */
++/* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_NUMERIC
++ and LC_TIME if they are not specified in the environment, but LC_ALL
++ is. This should be called from main() after parsing the
++ environment. */
+ void
+ set_default_locale_vars ()
+ {
+@@ -109,6 +110,12 @@ set_default_locale_vars ()
+ setlocale (LC_NUMERIC, lc_all);
+ # endif /* LC_NUMERIC */
+
++# if defined (LC_TIME)
++ val = get_string_value ("LC_TIME");
++ if (val == 0 && lc_all && *lc_all)
++ setlocale (LC_TIME, lc_all);
++# endif /* LC_TIME */
++
+ #endif /* HAVE_SETLOCALE */
+
+ val = get_string_value ("TEXTDOMAIN");
+@@ -213,6 +220,13 @@ set_locale_var (var, value)
+ return (setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC")) != 0);
+ # endif /* LC_NUMERIC */
+ }
++ else if (var[3] == 'T' && var[4] == 'I') /* LC_TIME */
++ {
++# if defined (LC_TIME)
++ if (lc_all == 0 || *lc_all == '\0')
++ return (setlocale (LC_TIME, get_locale_var ("LC_TIME")) != 0);
++# endif /* LC_TIME */
++ }
+ #endif /* HAVE_SETLOCALE */
+
+ return (0);
+@@ -285,6 +299,9 @@ reset_locale_vars ()
+ # if defined (LC_NUMERIC)
+ setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC"));
+ # endif
++# if defined (LC_TIME)
++ setlocale (LC_TIME, get_locale_var ("LC_TIME"));
++# endif
+
+ locale_setblanks ();
+
+--- bash-3.0/variables.c
++++ bash-3.0/variables.c
+@@ -3646,6 +3646,7 @@ static struct name_and_function special_
+ { "LC_CTYPE", sv_locale },
+ { "LC_MESSAGES", sv_locale },
+ { "LC_NUMERIC", sv_locale },
++ { "LC_TIME", sv_locale },
+
+ { "MAIL", sv_mail },
+ { "MAILCHECK", sv_mail },
diff --git a/app-shells/bash/files/bash-3.0-manpage.patch b/app-shells/bash/files/bash-3.0-manpage.patch
new file mode 100644
index 000000000000..08e3143e5422
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-manpage.patch
@@ -0,0 +1,15 @@
+Ripped from Fedora
+
+fix obvious display bug
+
+--- bash-3.0/doc/bash.1
++++ bash-3.0/doc/bash.1
+@@ -3929,7 +3929,7 @@
+ .B SIGHUP
+ to all jobs when an interactive login shell exits.
+ .PP
+-If \Bbash\fP is waiting for a command to complete and receives a signal
++If \fBbash\fP is waiting for a command to complete and receives a signal
+ for which a trap has been set, the trap will not be executed until
+ the command completes.
+ When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP
diff --git a/app-shells/bash/files/bash-3.0-multibyteifs.patch b/app-shells/bash/files/bash-3.0-multibyteifs.patch
new file mode 100644
index 000000000000..1e74832b638a
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-multibyteifs.patch
@@ -0,0 +1,281 @@
+From: Tim Waugh <twaugh@redhat.com>
+To: bug-bash@gnu.org
+Subject: [patch] multibyte IFS values
+Date: Tue, 24 Aug 2004 13:34:59 +0100
+
+Hi,
+
+Here is a patch to address these problems:
+
+http://lists.gnu.org/archive/html/bug-bash/2004-07/msg00294.html
+http://lists.gnu.org/archive/html/bug-bash/2004-07/msg00296.html
+
+It works well for me at least.
+
+Tim.
+
+--- bash-3.0/subst.c.multibyteifs 2004-08-20 15:22:48.366497771 +0100
++++ bash-3.0/subst.c 2004-08-20 18:13:30.833624616 +0100
+@@ -124,7 +124,12 @@
+ SHELL_VAR *ifs_var;
+ char *ifs_value;
+ unsigned char ifs_cmap[UCHAR_MAX + 1];
++#if defined (HANDLE_MULTIBYTE)
++unsigned char ifs_firstc[MB_LEN_MAX];
++size_t ifs_firstc_len;
++#else
+ unsigned char ifs_firstc;
++#endif
+
+ /* Extern functions and variables from different files. */
+ extern int last_command_exit_value, last_command_exit_signal;
+@@ -862,8 +867,14 @@
+ char *charlist;
+ {
+ register int i = *sindex;
++ size_t slen;
++#if defined (HANDLE_MULTIBYTE)
++ size_t clen;
++ wchar_t *wcharlist = NULL;
++#endif
+ int c;
+ char *temp;
++ DECLARE_MBSTATE;
+
+ if (charlist[0] == '\'' && charlist[1] == '\0')
+ {
+@@ -872,18 +883,65 @@
+ return temp;
+ }
+
+- for (i = *sindex; c = string[i]; i++)
++ slen = strlen (string + *sindex) + *sindex;
++ i = *sindex;
++#if defined (HANDLE_MULTIBYTE)
++ clen = strlen (charlist);
++#endif
++ while ((c = string[i]))
+ {
++#if defined (HANDLE_MULTIBYTE)
++ size_t mblength;
++#endif
++
+ if (c == CTLESC)
+ {
+- i++;
++ i += 2;
+ continue;
+ }
+
++#if defined (HANDLE_MULTIBYTE)
++ mblength = mblen (string + i, slen - i);
++ if (mblength > 1)
++ {
++ wchar_t wc;
++ size_t mblength = mbtowc (&wc, string + i, slen - i);
++ if (MB_INVALIDCH (mblength))
++ {
++ if (MEMBER (c, charlist))
++ break;
++ }
++ else
++ {
++ if (!wcharlist)
++ {
++ size_t len = mbstowcs (wcharlist, charlist, 0);
++ if (len == -1)
++ len = 0;
++ wcharlist = xmalloc (sizeof (wchar_t) * (len + 1));
++ mbstowcs (wcharlist, charlist, 1 + len);
++ }
++
++ if (wcschr (wcharlist, wc))
++ {
++ break;
++ }
++ }
++ }
++ else
++#endif
++
+ if (MEMBER (c, charlist))
+ break;
++
++ ADVANCE_CHAR (string, slen, i);
+ }
+
++#if defined (HANDLE_MULTIBYTE)
++ if (wcharlist)
++ free (wcharlist);
++#endif
++
+ temp = substring (string, *sindex, i);
+ *sindex = i;
+
+@@ -1456,11 +1514,36 @@
+ d2 = 0;
+ if (delims)
+ {
+- d2 = (char *)xmalloc (strlen (delims) + 1);
+- for (i = ts = 0; delims[i]; i++)
++ size_t slength = strlen (delims);
++#if defined (HANDLE_MULTIBYTE)
++ size_t mblength = 1;
++ DECLARE_MBSTATE;
++#endif
++
++ d2 = (char *)xmalloc (slength + 1);
++ i = ts = 0;
++ while (delims[i])
+ {
++#if defined (HANDLE_MULTIBYTE)
++ mbstate_t state_bak = state;
++ mblength = mbrlen (delims + i, slength, &state);
++
++ if (MB_INVALIDCH (mblength))
++ state = state_bak;
++ else if (mblength != 1)
++ {
++ memcpy (d2 + ts, delims + i, mblength);
++ ts += mblength;
++ i += mblength;
++ slength -= mblength;
++ continue;
++ }
++#endif
++
+ if (whitespace(delims[i]) == 0)
+ d2[ts++] = delims[i];
++ i++;
++ slength--;
+ }
+ d2[ts] = '\0';
+ }
+@@ -1654,10 +1737,19 @@
+ string_list_dollar_star (list)
+ WORD_LIST *list;
+ {
++#if defined (HANDLE_MULTIBYTE)
++ char sep[MB_CUR_MAX + 1];
++#else
+ char sep[2];
++#endif
+
++#if defined (HANDLE_MULTIBYTE)
++ memcpy (sep, ifs_firstc, ifs_firstc_len);
++ sep[ifs_firstc_len] = '\0';
++#else
+ sep[0] = ifs_firstc;
+ sep[1] = '\0';
++#endif
+
+ return (string_list_internal (list, sep));
+ }
+@@ -1676,14 +1768,41 @@
+ WORD_LIST *list;
+ int quoted;
+ {
+- char *ifs, sep[2];
++ char *ifs;
++#if defined (HANDLE_MULTIBYTE)
++ char sep[MB_CUR_MAX + 1];
++#else
++ char sep[2];
++#endif
+ WORD_LIST *tlist;
+
+ /* XXX this could just be ifs = ifs_value; */
+ ifs = ifs_var ? value_cell (ifs_var) : (char *)0;
+
++#if defined (HANDLE_MULTIBYTE)
++ if (ifs && *ifs)
++ {
++ size_t mblength = mblen (ifs, strnlen (ifs, MB_CUR_MAX));
++ if (MB_INVALIDCH (mblength))
++ {
++ sep[0] = *ifs;
++ sep[1] = '\0';
++ }
++ else
++ {
++ memcpy (sep, ifs, mblength);
++ sep[mblength] = '\0';
++ }
++ }
++ else
++ {
++ sep[0] = ' ';
++ sep[1] = '\0';
++ }
++#else
+ sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs;
+ sep[1] = '\0';
++#endif
+
+ tlist = ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (ifs && *ifs == 0))
+ ? quote_list (list)
+@@ -1732,6 +1851,7 @@
+ WORD_DESC *t;
+ char *current_word, *s;
+ int sindex, sh_style_split, whitesep;
++ size_t slen = 0;
+
+ if (!string || !*string)
+ return ((WORD_LIST *)NULL);
+@@ -1805,7 +1925,12 @@
+
+ /* Move past the current separator character. */
+ if (string[sindex])
+- sindex++;
++ {
++ DECLARE_MBSTATE;
++ if (!slen)
++ slen = strlen (string);
++ ADVANCE_CHAR (string, slen, sindex);
++ }
+
+ /* Now skip sequences of space, tab, or newline characters if they are
+ in the list of separators. */
+@@ -6796,7 +6921,27 @@
+ ifs_cmap[uc] = 1;
+ }
+
++#if defined (HANDLE_MULTIBYTE)
++ if (!ifs_value)
++ {
++ ifs_firstc[0] = '\0';
++ ifs_firstc_len = 1;
++ }
++ else
++ {
++ size_t ifs_len = strnlen (ifs_value, MB_CUR_MAX);
++ ifs_firstc_len = mblen (ifs_value, ifs_len);
++ if (MB_INVALIDCH (ifs_firstc_len))
++ {
++ ifs_firstc[0] = '\0';
++ ifs_firstc_len = 1;
++ }
++ else
++ memcpy (ifs_firstc, ifs_value, ifs_firstc_len);
++ }
++#else
+ ifs_firstc = ifs_value ? *ifs_value : 0;
++#endif
+ }
+
+ char *
+--- bash-3.0/subst.h.multibyteifs 2004-08-20 15:51:08.301074583 +0100
++++ bash-3.0/subst.h 2004-08-20 15:51:39.070206473 +0100
+@@ -231,7 +231,12 @@
+ extern SHELL_VAR *ifs_var;
+ extern char *ifs_value;
+ extern unsigned char ifs_cmap[];
++#if defined (HANDLE_MULTIBYTE)
++extern unsigned char ifs_firstc[];
++extern size_t ifs_firstc_len;
++#else
+ extern unsigned char ifs_firstc;
++#endif
+
+ /* Evaluates to 1 if C is a character in $IFS. */
+ #define isifs(c) (ifs_cmap[(unsigned char)(c)] != 0)
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
new file mode 100644
index 000000000000..35b0b7d05924
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-pgrp-pipe-fix.patch
@@ -0,0 +1,20 @@
+Fix an error when using pipes and PGRP_PIPE is enabled.
+( exec 3>&1; : `echo >&3` )
+bash: 3: Bad file descriptor
+
+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
+***************
+*** 3456,3459 ****
+--- 3901,3907 ----
+ stop_making_children ();
+ start_pipeline ();
++ #if defined (PGRP_PIPE)
++ pipe_close (pgrp_pipe);
++ #endif
+ delete_all_jobs (0);
+ set_job_control (0);
diff --git a/app-shells/bash/files/bash-3.0-protos.patch b/app-shells/bash/files/bash-3.0-protos.patch
new file mode 100644
index 000000000000..b1337b203954
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-protos.patch
@@ -0,0 +1,68 @@
+move prototypes around so they show up when needed
+
+--- a/externs.h
++++ b/externs.h
+@@ -327,6 +327,9 @@
+ #undef xstrchr
+ extern char *xstrchr __P((const char *, int));
+
++/* declarations for functions defined in lib/sh/zcatfd.c */
++extern int zcatfd __P((int, int, char *));
++
+ /* declarations for functions defined in lib/sh/zread.c */
+ extern ssize_t zread __P((int, char *, size_t));
+ extern ssize_t zreadintr __P((int, char *, size_t));
+--- a/jobs.h
++++ b/jobs.h
+@@ -175,6 +175,8 @@
+ extern void ignore_tty_job_signals __P((void));
+ extern void default_tty_job_signals __P((void));
+
++extern void close_pgrp_pipe __P((void));
++
+ #if defined (JOB_CONTROL)
+ extern int job_control;
+ #endif
+--- a/general.c
++++ b/general.c
+@@ -39,6 +39,8 @@
+ #include "bashintl.h"
+
+ #include "shell.h"
++#include "test.h"
++
+ #include <tilde/tilde.h>
+
+ #if !defined (errno)
+--- a/builtins/evalfile.c
++++ b/builtins/evalfile.c
+@@ -39,6 +39,7 @@
+ #include "../flags.h"
+ #include "../input.h"
+ #include "../execute_cmd.h"
++#include "../trap.h"
+
+ #if defined (HISTORY)
+ # include "../bashhist.h"
+--- a/lib/glob/strmatch.c
++++ b/lib/glob/strmatch.c
+@@ -25,9 +25,6 @@
+ #include "strmatch.h"
+
+ extern int xstrmatch __P((char *, char *, int));
+-#if defined (HAVE_MULTIBYTE)
+-extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
+-#endif
+
+ int
+ strmatch (pattern, string, flags)
+--- a/lib/glob/strmatch.h
++++ b/lib/glob/strmatch.h
+@@ -57,6 +57,7 @@
+
+ #if HANDLE_MULTIBYTE
+ extern int wcsmatch __P((wchar_t *, wchar_t *, int));
++extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
+ #endif
+
+ #endif /* _STRMATCH_H */
diff --git a/app-shells/bash/files/bash-3.0-pwd.patch b/app-shells/bash/files/bash-3.0-pwd.patch
new file mode 100644
index 000000000000..77f0918fb4d8
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-pwd.patch
@@ -0,0 +1,16 @@
+Ripped from Fedora
+
+* Tue Mar 15 2005 Tim Waugh <twaugh@redhat.com> 3.0-30
+- Fix PS1 expansion crash when PWD is unset (bg #151116).
+
+--- bash-3.0/parse.y.pwd 2005-03-15 14:22:36.000000000 +0000
++++ bash-3.0/parse.y 2005-03-15 14:22:37.000000000 +0000
+@@ -4103,7 +4103,7 @@
+ #define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0)
+ #define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0)
+ /* Abbreviate \W as ~ if $PWD == $HOME */
+- if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, temp) == 0))
++ if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0))
+ {
+ if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0)
+ {
diff --git a/app-shells/bash/files/bash-3.0-rbash.patch b/app-shells/bash/files/bash-3.0-rbash.patch
new file mode 100644
index 000000000000..e804d20f06a9
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-rbash.patch
@@ -0,0 +1,18 @@
+Fix broken rbash functionality when used as a login shell via /etc/passwd
+
+http://bugs.gentoo.org/26854
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=170298
+
+Backported from bash-3.1
+
+--- bash-3.0/shell.c
++++ bash-3.0/shell.c
+@@ -1089,6 +1099,8 @@
+ if (restricted)
+ return 1;
+ temp = base_pathname (name);
++ if (*temp == '-')
++ temp++;
+ return (STREQ (temp, RESTRICTED_SHELL_NAME));
+ }
+
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
new file mode 100644
index 000000000000..466e45ae3004
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-read-builtin-pipe.patch
@@ -0,0 +1,20 @@
+Description:
+When using 'read -u 3' or the like, and the pipe-buf already contains
+more than one line, the first line is returned, and bytes up to the next
+multiple of 128 are skipped.
+
+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
+@@ -276,7 +276,7 @@
+ input_is_tty = isatty (fd);
+ if (input_is_tty == 0)
+ #ifndef __CYGWIN__
+- input_is_pipe = (lseek (0, 0L, SEEK_CUR) < 0) && (errno == ESPIPE);
++ input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE);
+ #else
+ input_is_pipe = 1;
+ #endif
diff --git a/app-shells/bash/files/bash-3.0-read-e-segfault.patch b/app-shells/bash/files/bash-3.0-read-e-segfault.patch
new file mode 100644
index 000000000000..e578631c424e
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-read-e-segfault.patch
@@ -0,0 +1,26 @@
+> Hmm, a better patch for this seems to be:
+
+I installed this patch a while back:
+
+*** ../bash-3.0-patched/lib/readline/display.c Wed Sep 8 11:07:51 2004
+--- lib/readline/display.c Fri Nov 12 13:31:42 2004
+***************
+*** 336,340 ****
+
+ local_prompt = local_prompt_prefix = (char *)0;
+! prompt_last_invisible = prompt_visible_length = 0;
+
+ if (prompt == 0 || *prompt == 0)
+--- 341,346 ----
+
+ local_prompt = local_prompt_prefix = (char *)0;
+! prompt_last_invisible = prompt_invis_chars_first_line = 0;
+! prompt_visible_length = prompt_physical_chars = 0;
+
+ if (prompt == 0 || *prompt == 0)
+
+--
+``The lyf so short, the craft so long to lerne.'' - Chaucer
+( ``Discere est Dolere'' -- chet )
+ Live...Laugh...Love
+Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/
diff --git a/app-shells/bash/files/bash-3.0-strnlen.patch b/app-shells/bash/files/bash-3.0-strnlen.patch
new file mode 100644
index 000000000000..056e00b3de57
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-strnlen.patch
@@ -0,0 +1,175 @@
+Add strnlen function for non-glibc systems, as one of Fedora's patches requires it.
+
+--- bash-3.0/configure.in
++++ bash-3.0/configure.in
+@@ -613,6 +613,9 @@
+ AC_LIBOBJ(vprint)
+ fi
+
++AC_CHECK_FUNCS([strnlen])
++AC_LIBOBJ(strnlen)
++
+ dnl signal stuff
+ AC_TYPE_SIGNAL
+
+--- /dev/null
++++ bash-3.0/lib/sh/strnlen.c
+@@ -0,0 +1,27 @@
++/*
++ Copyright (C) 2005 Gentoo Foundation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License
++ as published by the Free Software Foundation; either version 2
++ of the License, or (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
++*/
++
++#include <stdlib.h>
++
++size_t strnlen(const char *s, size_t n)
++{
++ int i;
++ for (i=0; s[i] && i<n; i++)
++ /* noop */ ;
++ return i;
++}
+--- bash-3.0/configure
++++ bash-3.0/configure
+@@ -10696,9 +10696,127 @@ _ACEOF
+ fi
+
+ if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then
+- LIBOBJS="$LIBOBJS vprint.$ac_objext"
++ case $LIBOBJS in
++ "vprint.$ac_objext" | \
++ *" vprint.$ac_objext" | \
++ "vprint.$ac_objext "* | \
++ *" vprint.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS vprint.$ac_objext" ;;
++esac
++
+ fi
+
++
++for ac_func in strnlen
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
++if eval "test \"\${$as_ac_var+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func (); below.
++ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++ <limits.h> exists even on freestanding compilers. */
++
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++
++#undef $ac_func
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++char (*f) () = $ac_func;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != $ac_func;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_var=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_var=no"
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
++if test `eval echo '${'$as_ac_var'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++done
++
++case $LIBOBJS in
++ "strnlen.$ac_objext" | \
++ *" strnlen.$ac_objext" | \
++ "strnlen.$ac_objext "* | \
++ *" strnlen.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" ;;
++esac
++
++
+ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+ echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+ if test "${ac_cv_type_signal+set}" = set; then
diff --git a/app-shells/bash/files/bash-3.0-subshell.patch b/app-shells/bash/files/bash-3.0-subshell.patch
new file mode 100644
index 000000000000..a1d7dfe7d342
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-subshell.patch
@@ -0,0 +1,39 @@
+Ripped from Fedora which took this from upstream
+
+* Tue Nov 22 2005 Tim Waugh <twaugh@redhat.com> 3.0-37
+- Applied patch from upstream to fix parsing problem (bug #146638).
+
+http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146638
+
+--- bash-3.0/parse.y.subshell 2005-11-22 13:19:11.000000000 +0000
++++ bash-3.0/parse.y 2005-11-22 13:19:24.000000000 +0000
+@@ -2055,14 +2055,6 @@
+ if (uc)
+ shell_input_line_index++;
+
+- if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n')
+- {
+- if (SHOULD_PROMPT ())
+- prompt_again ();
+- line_number++;
+- goto restart_read;
+- }
+-
+ #if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
+ /* If UC is NULL, we have reached the end of the current input string. If
+ pushed_string_list is non-empty, it's time to pop to the previous string
+@@ -2078,6 +2070,14 @@
+ }
+ #endif /* ALIAS || DPAREN_ARITHMETIC */
+
++ if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n')
++ {
++ if (SHOULD_PROMPT ())
++ prompt_again ();
++ line_number++;
++ goto restart_read;
++ }
++
+ if (!uc && shell_input_line_terminator == EOF)
+ return ((shell_input_line_index != 0) ? '\n' : EOF);
+
diff --git a/app-shells/bash/files/bash-3.0-ulimit.patch b/app-shells/bash/files/bash-3.0-ulimit.patch
new file mode 100644
index 000000000000..8202b95d2769
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-ulimit.patch
@@ -0,0 +1,186 @@
+Ripped from Fedora
+
+--- bash-3.0/builtins/ulimit.def
++++ bash-3.0/builtins/ulimit.def
+@@ -34,15 +34,20 @@
+ -a all current limits are reported
+ -c the maximum size of core files created
+ -d the maximum size of a process's data segment
++ -e the maximum scheduling priority (`nice')
+ -f the maximum size of files created by the shell
++ -i the maximum number of pending signals
+ -l the maximum size a process may lock into memory
+ -m the maximum resident set size
+ -n the maximum number of open file descriptors
+ -p the pipe buffer size
++ -q the maximum number of bytes in POSIX message queues
++ -r the maximum rt priority
+ -s the maximum stack size
+ -t the maximum amount of cpu time in seconds
+ -u the maximum number of user processes
+ -v the size of virtual memory
++ -x the maximum number of file locks
+
+ If LIMIT is given, it is the new value of the specified resource;
+ the special LIMIT values `soft', `hard', and `unlimited' stand for
+@@ -199,7 +204,13 @@
+ #ifdef RLIMIT_DATA
+ { 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" },
+ #endif
++#ifdef RLIMIT_NICE
++ { 'e', RLIMIT_NICE, 1, "max nice", (char *)NULL},
++#endif /* RLIMIT_NICE */
+ { 'f', RLIMIT_FILESIZE, 1024, "file size", "blocks" },
++#ifdef RLIMIT_SIGPENDING
++ { 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL},
++#endif
+ #ifdef RLIMIT_MEMLOCK
+ { 'l', RLIMIT_MEMLOCK, 1024, "max locked memory", "kbytes" },
+ #endif
+@@ -208,6 +219,12 @@
+ #endif /* RLIMIT_RSS */
+ { 'n', RLIMIT_OPENFILES, 1, "open files", (char *)NULL},
+ { 'p', RLIMIT_PIPESIZE, 512, "pipe size", "512 bytes" },
++#ifdef RLIMIT_MSGQUEUE
++ { 'q', RLIMIT_MSGQUEUE, 1, "POSIX message queues", "bytes" },
++#endif
++#ifdef RLIMIT_RTPRIO
++ { 'r', RLIMIT_RTPRIO, 1, "max rt priority", (char *)NULL},
++#endif /* RLIMIT_RTPRIO */
+ #ifdef RLIMIT_STACK
+ { 's', RLIMIT_STACK, 1024, "stack size", "kbytes" },
+ #endif
+@@ -221,6 +238,9 @@
+ #ifdef RLIMIT_SWAP
+ { 'w', RLIMIT_SWAP, 1024, "swap size", "kbytes" },
+ #endif
++#ifdef RLIMIT_LOCKS
++ { 'x', RLIMIT_LOCKS, 1, "file locks", (char *)NULL},
++#endif
+ { -1, -1, -1, (char *)NULL, (char *)NULL }
+ };
+ #define NCMDS (sizeof(limits) / sizeof(limits[0]))
+@@ -647,11 +667,11 @@
+
+ for (i = 0; limits[i].option > 0; i++)
+ {
+- if (get_limit (i, &softlim, &hardlim) < 0)
++ if (get_limit (i, &softlim, &hardlim) == 0)
++ printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
++ else if (errno != EINVAL)
+ builtin_error ("%s: cannot get limit: %s", limits[i].description,
+ strerror (errno));
+- else
+- printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
+ }
+ }
+
+@@ -670,7 +690,7 @@
+ else
+ sprintf (unitstr, "(-%c) ", limits[limind].option);
+
+- printf ("%-18s %16s", limits[limind].description, unitstr);
++ printf ("%-20s %16s", limits[limind].description, unitstr);
+ }
+ if (curlim == RLIM_INFINITY)
+ puts ("unlimited");
+--- bash-3.0/doc/bashref.texi
++++ bash-3.0/doc/bashref.texi
+@@ -3793,7 +3793,7 @@
+ @item ulimit
+ @btindex ulimit
+ @example
+-ulimit [-acdflmnpstuvSH] [@var{limit}]
++ulimit [-acdeflmnpqrstuvxSH] [@var{limit}]
+ @end example
+ @code{ulimit} provides control over the resources available to processes
+ started by the shell, on systems that allow such control. If an
+@@ -3814,9 +3814,15 @@
+ @item -d
+ The maximum size of a process's data segment.
+
++@item -e
++The maximum scheduling priority.
++
+ @item -f
+ The maximum size of files created by the shell.
+
++@item -i
++The maximum number of pending signals.
++
+ @item -l
+ The maximum size that may be locked into memory.
+
+@@ -3829,6 +3835,12 @@
+ @item -p
+ The pipe buffer size.
+
++@item -q
++The maximum number of bytes in POSIX message queues.
++
++@item -r
++The maximum RT priority.
++
+ @item -s
+ The maximum stack size.
+
+@@ -3841,6 +3853,9 @@
+ @item -v
+ The maximum amount of virtual memory available to the process.
+
++@item -x
++The maximum amount of file locks.
++
+ @end table
+
+ If @var{limit} is given, it is the new value of the specified resource;
+--- bash-3.0/doc/bash.1
++++ bash-3.0/doc/bash.1
+@@ -8362,7 +8362,7 @@
+ returns true if any of the arguments are found, false if
+ none are found.
+ .TP
+-\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
++\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\fP [\fIlimit\fP]]
+ Provides control over the resources available to the shell and to
+ processes started by it, on systems that allow such control.
+ The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
+@@ -8398,9 +8398,15 @@
+ .B \-d
+ The maximum size of a process's data segment
+ .TP
++.B \-e
++The maximum scheduling priority (`nice')
++.TP
+ .B \-f
+ The maximum size of files created by the shell
+ .TP
++.B \-i
++The maximum number of pending signals
++.TP
+ .B \-l
+ The maximum size that may be locked into memory
+ .TP
+@@ -8414,6 +8420,12 @@
+ .B \-p
+ The pipe size in 512-byte blocks (this may not be set)
+ .TP
++.B \-q
++The maximum number of bytes in POSIX message queues
++.TP
++.B \-r
++The maximum rt priority
++.TP
+ .B \-s
+ The maximum stack size
+ .TP
+@@ -8425,6 +8437,9 @@
+ .TP
+ .B \-v
+ The maximum amount of virtual memory available to the shell
++.TP
++.B \-x
++The maximum number of file locks
+ .PD
+ .PP
+ If
diff --git a/app-shells/bash/files/bash-3.0-volatile-command.patch b/app-shells/bash/files/bash-3.0-volatile-command.patch
new file mode 100644
index 000000000000..8b89b35914b1
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-volatile-command.patch
@@ -0,0 +1,16 @@
+Ripped from Debian
+
+# DP: current_command must be declared volatile to prevent assignments from
+# 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
+@@ -63,7 +63,7 @@
+ reader_loop ()
+ {
+ int our_indirection_level;
+- COMMAND *current_command = (COMMAND *)NULL;
++ COMMAND * volatile current_command = (COMMAND *)NULL;
+
+ USE_VAR(current_command);