diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-12-22 13:42:06 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-12-22 13:42:06 +0000 |
commit | a483cbaf2197444a93a9d74db88934cd606e1ecb (patch) | |
tree | 8ae2a8c44f0119ac7181fe0dc3dea37038642fd6 /app-shells | |
parent | amd64 stable, bug #492168 (diff) | |
download | gentoo-2-a483cbaf2197444a93a9d74db88934cd606e1ecb.tar.gz gentoo-2-a483cbaf2197444a93a9d74db88934cd606e1ecb.tar.bz2 gentoo-2-a483cbaf2197444a93a9d74db88934cd606e1ecb.zip |
Move older versions into SLOTs for easier testing #479574 by Michał Górny.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
Diffstat (limited to 'app-shells')
-rw-r--r-- | app-shells/bash/ChangeLog | 9 | ||||
-rw-r--r-- | app-shells/bash/bash-3.1_p17.ebuild | 198 | ||||
-rw-r--r-- | app-shells/bash/bash-3.2_p51.ebuild | 223 | ||||
-rw-r--r-- | app-shells/bash/bash-4.0_p38.ebuild | 153 | ||||
-rw-r--r-- | app-shells/bash/bash-4.1_p11.ebuild | 159 | ||||
-rw-r--r-- | app-shells/bash/files/autoconf-mktime-2.53.patch | 199 | ||||
-rw-r--r-- | app-shells/bash/files/bash-3.0-configs.patch | 71 | ||||
-rw-r--r-- | app-shells/bash/files/bash-3.0-etc-inputrc.patch | 44 | ||||
-rw-r--r-- | app-shells/bash/files/bash-3.1-bash-logger.patch | 89 | ||||
-rw-r--r-- | app-shells/bash/files/bash-3.1-gentoo.patch | 13 |
10 files changed, 504 insertions, 654 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog index 7f9098690463..9f7a7520c0e2 100644 --- a/app-shells/bash/ChangeLog +++ b/app-shells/bash/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-shells/bash # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.345 2013/06/05 00:13:01 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.346 2013/12/22 13:42:06 vapier Exp $ + + 22 Dec 2013; Mike Frysinger <vapier@gentoo.org> + +files/autoconf-mktime-2.53.patch, -files/bash-3.0-configs.patch, + -files/bash-3.0-etc-inputrc.patch, -files/bash-3.1-bash-logger.patch, + bash-3.1_p17.ebuild, bash-3.2_p51.ebuild, bash-4.0_p38.ebuild, + bash-4.1_p11.ebuild, files/bash-3.1-gentoo.patch: + Move older versions into SLOTs for easier testing #479574 by Michał Górny. 05 Jun 2013; Mike Frysinger <vapier@gentoo.org> metadata.xml: Add upstream CPE tag (security info) from ChromiumOS. diff --git a/app-shells/bash/bash-3.1_p17.ebuild b/app-shells/bash/bash-3.1_p17.ebuild index 53ce6dc494b1..d4ea74bbcbc8 100644 --- a/app-shells/bash/bash-3.1_p17.ebuild +++ b/app-shells/bash/bash-3.1_p17.ebuild @@ -1,6 +1,8 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.1_p17.ebuild,v 1.24 2012/11/19 22:26:11 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.1_p17.ebuild,v 1.25 2013/12/22 13:42:06 vapier Exp $ + +EAPI="4" inherit eutils flag-o-matic toolchain-funcs @@ -8,143 +10,137 @@ inherit eutils flag-o-matic toolchain-funcs # 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} -READLINE_VER=5.1 -READLINE_PLEVEL=1 +[[ ${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" -# Hit the GNU mirrors before hitting Chet's site -# printf 'mirror://gnu/bash/bash-%s-patches/bash%s-%03d\n' \ -# ${MY_PV} ${MY_PV/\.} ${i} -SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz - ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz - $(for ((i=1; i<=PLEVEL; i++)); do - printf 'ftp://ftp.cwru.edu/pub/bash/bash-%s-patches/bash%s-%03d\n' \ - ${MY_PV} ${MY_PV/\.} ${i} - done) - $(for ((i=1; i<=READLINE_PLEVEL; i++)); do - printf 'ftp://ftp.cwru.edu/pub/bash/readline-%s-patches/readline%s-%03d\n' \ - ${READLINE_VER} ${READLINE_VER/\.} ${i} - printf 'mirror://gnu/bash/readline-%s-patches/readline%s-%03d\n' \ - ${READLINE_VER} ${READLINE_VER/\.} ${i} - done)" +SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" LICENSE="GPL-2" -SLOT="0" +SLOT="${MY_PV}" KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger nls vanilla" +IUSE="afs +net nls +readline" DEPEND=">=sys-libs/ncurses-5.2-r2 + readline? ( >=sys-libs/readline-6.2 ) nls? ( virtual/libintl )" -RDEPEND=${DEPEND} +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 - cd "${S}" - epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch +} +src_prepare() { # Include official patches - local i - for ((i=1; i<=PLEVEL; i++)); do - epatch "${DISTDIR}"/${PN}${MY_PV/\.}-$(printf '%03d' ${i}) - done - cd lib/readline - for ((i=1; i<=READLINE_PLEVEL; i++)); do - epatch "${DISTDIR}"/readline${READLINE_VER/\.}-$(printf '%03d' ${i}) - done - cd ../.. - - if ! use vanilla ; then - # Fall back to /etc/inputrc - epatch "${FILESDIR}"/${PN}-3.0-etc-inputrc.patch - # Add more ulimit options (from Fedora) - epatch "${FILESDIR}"/${MY_P}-ulimit.patch - # Fix a memleak in read_builtin (from Fedora) - epatch "${FILESDIR}"/${PN}-3.0-read-memleak.patch - # Don't barf on handled signals in scripts - epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch - # Fix -/bin/bash login shell #118257 - epatch "${FILESDIR}"/bash-3.1-fix-dash-login-shell.patch - # Fix /dev/fd test with FEATURES=userpriv #131875 - epatch "${FILESDIR}"/bash-3.1-dev-fd-test-as-user.patch - # Log bash commands to syslog #91327 - if use bashlogger ; then - echo - 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 - fi + [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s) - epatch "${FILESDIR}"/${PN}-3.0-configs.patch + # 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}-3.1-gentoo.patch + epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040 + 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}"/bash-3.1-fix-dash-login-shell.patch #118257 + epatch "${FILESDIR}"/bash-3.1-dev-fd-test-as-user.patch #131875 + + epatch_user } -src_compile() { - filter-flags -malign-double +src_configure() { + local myconf=() - local myconf= + # Force pgrp synchronization + # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653 + export bash_cv_pgrp_pipe=yes - # 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" + # 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 use with bugs ;). + # don't come crying to us with bugs ;). #use static && export LDFLAGS="${LDFLAGS} -static" - use nls || myconf="${myconf} --disable-nls" + 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 - myconf="${myconf} --with-curses" + # 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 \ - ${myconf} || die - emake -j1 || die "make failed" # see bug 102426 + $(use_enable readline) \ + $(use_enable readline history) \ + $(use_enable readline bang-history) \ + "${myconf[@]}" } -src_install() { - einstall || die +src_compile() { + emake -j1 #102426 +} - dodir /bin - mv "${D}"/usr/bin/bash "${D}"/bin/ - [[ ${USERLAND} != "BSD" ]] && dosym bash /bin/sh - dosym bash /bin/rbash +src_install() { + into / + newbin bash bash-${SLOT} - 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 + newman doc/bash.1 bash-${SLOT}.1 + newman doc/builtins.1 builtins-${SLOT}.1 - 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 + insinto /usr/share/info + newins doc/bashref.info bash-${SLOT}.info + dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info - doman doc/*.1 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO - dosym bash.info.gz /usr/share/info/bashref.info.gz -} - -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 - - # our bash_logout is just a place holder so dont - # force users to go through etc-update all the time - if [[ -e ${ROOT}/etc/bash/bash_logout ]] ; then - rm -f "${D}"/etc/bash/bash_logout - fi } diff --git a/app-shells/bash/bash-3.2_p51.ebuild b/app-shells/bash/bash-3.2_p51.ebuild index 6bc0b582d41b..b09b4f64b088 100644 --- a/app-shells/bash/bash-3.2_p51.ebuild +++ b/app-shells/bash/bash-3.2_p51.ebuild @@ -1,46 +1,46 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.2_p51.ebuild,v 1.5 2012/11/19 22:26:11 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.2_p51.ebuild,v 1.6 2013/12/22 13:42:06 vapier Exp $ -EAPI=1 +EAPI="4" -inherit eutils flag-o-matic toolchain-funcs multilib +inherit eutils 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} -READLINE_VER=5.2 -READLINE_PLEVEL=0 # both readline patches are also released as bash patches +[[ ${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 - ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz - $(for ((i=1; i<=PLEVEL; i++)); do - printf 'ftp://ftp.cwru.edu/pub/bash/bash-%s-patches/bash%s-%03d\n' \ - ${MY_PV} ${MY_PV/\.} ${i} - printf 'mirror://gnu/bash/bash-%s-patches/bash%s-%03d\n' \ - ${MY_PV} ${MY_PV/\.} ${i} - done) - $(for ((i=1; i<=READLINE_PLEVEL; i++)); do - printf 'ftp://ftp.cwru.edu/pub/bash/readline-%s-patches/readline%s-%03d\n' \ - ${READLINE_VER} ${READLINE_VER/\.} ${i} - printf 'mirror://gnu/bash/readline-%s-patches/readline%s-%03d\n' \ - ${READLINE_VER} ${READLINE_VER/\.} ${i} - done)" +SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger +net nls plugins vanilla" +SLOT="${MY_PV}" +KEYWORDS="alpha amd64 arm 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} - !<sys-apps/portage-2.1.5 - !<sys-apps/paludis-0.26.0_alpha5" +RDEPEND="${DEPEND}" S=${WORKDIR}/${MY_P} @@ -54,134 +54,93 @@ pkg_setup() { src_unpack() { unpack ${MY_P}.tar.gz - cd "${S}" +} +src_prepare() { # Include official patches - local i - for ((i=1; i<=PLEVEL; i++)); do - epatch "${DISTDIR}"/${PN}${MY_PV/\.}-$(printf '%03d' ${i}) - done - cd lib/readline - for ((i=1; i<=READLINE_PLEVEL; i++)); do - epatch "${DISTDIR}"/readline${READLINE_VER/\.}-$(printf '%03d' ${i}) - done - cd ../.. - - if ! use vanilla ; then - epatch "${FILESDIR}"/autoconf-mktime-2.59.patch #220040 - epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch - epatch "${FILESDIR}"/${PN}-3.2-loadables.patch - epatch "${FILESDIR}"/${PN}-3.2-protos.patch - epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775 - epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671 - epatch "${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947 - - # Fix process substitution on BSD. - epatch "${FILESDIR}"/${PN}-3.2-process-subst.patch - - epatch "${FILESDIR}"/${PN}-3.2-ulimit.patch - # Don't barf on handled signals in scripts - epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch - epatch "${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875 - # Log bash commands to syslog #91327 - if use bashlogger ; then - echo - 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 - fi - - epatch "${FILESDIR}"/${PN}-3.0-configs.patch + [[ ${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.59.patch #220040 + epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch + epatch "${FILESDIR}"/${PN}-3.2-loadables.patch + epatch "${FILESDIR}"/${PN}-3.2-protos.patch + epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775 + epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671 + 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_user } -src_compile() { - local myconf= +src_configure() { + local myconf=() + + # Force pgrp synchronization + # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653 + export bash_cv_pgrp_pipe=yes - # 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" + # 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 use with bugs ;). + # don't come crying to us with bugs ;). #use static && export LDFLAGS="${LDFLAGS} -static" - use nls || myconf="${myconf} --disable-nls" + use nls || myconf+=( --disable-nls ) - # Force linking with system curses ... the bundled termcap lib - # sucks bad compared to ncurses - myconf="${myconf} --with-curses" + # 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 - # Default path is to use /usr/local/..... regardless. This little - # magic will set the default path to /usr/..... and keep us from - # worrying about the rest of the path getting out of sync with the - # ebuild code. - eval $(echo export $(ac_default_prefix=/usr; eval echo $(grep DEBUGGER_START_FILE= configure))) + # 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 :(. - use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash + tc-export AR #444070 econf \ + --with-installed-readline=. \ + --with-curses \ $(use_with afs) \ $(use_enable net net-redirections) \ --disable-profiling \ --without-gnu-malloc \ - ${myconf} || die - emake || die "make failed" - - if use plugins ; then - emake -C examples/loadables all others || die - fi + $(use_enable readline) \ + $(use_enable readline history) \ + $(use_enable readline bang-history) \ + "${myconf[@]}" } src_install() { - emake install DESTDIR="${D}" || die - - dodir /bin - mv "${D}"/usr/bin/bash "${D}"/bin/ || die - dosym bash /bin/rbash + into / + newbin bash bash-${SLOT} - 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 + newman doc/bash.1 bash-${SLOT}.1 + newman doc/builtins.1 builtins-${SLOT}.1 - 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 + insinto /usr/share/info + newins doc/bashref.info bash-${SLOT}.info + dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info - if use plugins ; then - exeinto /usr/$(get_libdir)/bash - doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die - 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) - local tmp=$(emktemp "${ROOT}"/bin) - ln -sf "${target}" "${tmp}" - mv -f "${tmp}" "${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.0_p38.ebuild b/app-shells/bash/bash-4.0_p38.ebuild index ad597ff476ea..793e0b3e1163 100644 --- a/app-shells/bash/bash-4.0_p38.ebuild +++ b/app-shells/bash/bash-4.0_p38.ebuild @@ -1,19 +1,18 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 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.5 2012/11/19 22:26:11 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.0_p38.ebuild,v 1.6 2013/12/22 13:42:06 vapier Exp $ -EAPI="1" +EAPI="4" -inherit eutils flag-o-matic toolchain-funcs multilib +inherit eutils flag-o-matic toolchain-funcs # Official patchlevel -# See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/ +# 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} [[ ${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 @@ -31,19 +30,17 @@ patches() { 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})" +SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger mem-scramble +net nls plugins vanilla" +SLOT="${MY_PV}" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" +IUSE="afs mem-scramble +net nls +readline" DEPEND=">=sys-libs/ncurses-5.2-r2 + readline? ( >=sys-libs/readline-6.2 ) nls? ( virtual/libintl )" -RDEPEND="${DEPEND} - !<sys-apps/portage-2.1.5 - !<sys-apps/paludis-0.26.0_alpha5" +RDEPEND="${DEPEND}" S=${WORKDIR}/${MY_P} @@ -57,37 +54,31 @@ pkg_setup() { src_unpack() { unpack ${MY_P}.tar.gz - cd "${S}" +} +src_prepare() { # 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 ../.. + + # 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}-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 + 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 + sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613 + + epatch_user } -src_compile() { - local myconf= +src_configure() { + local myconf=() # For descriptions of these, see config-top.h # bashrc/#26952 bash_logout/#90488 ssh/#24762 @@ -99,83 +90,51 @@ src_compile() { -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" + 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 - myconf="${myconf} --with-curses" + # 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 :(. - use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash + 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) \ - ${myconf} || die - emake || die "make failed" - - if use plugins ; then - emake -C examples/loadables all others || die - fi + $(use_enable readline) \ + $(use_enable readline history) \ + $(use_enable readline bang-history) \ + "${myconf[@]}" } src_install() { - emake install DESTDIR="${D}" || die + into / + newbin bash bash-${SLOT} - dodir /bin - mv "${D}"/usr/bin/bash "${D}"/bin/ || die - dosym bash /bin/rbash + newman doc/bash.1 bash-${SLOT}.1 + newman doc/builtins.1 builtins-${SLOT}.1 - 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 + insinto /usr/share/info + newins doc/bashref.info bash-${SLOT}.info + dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info - 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 - - 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) - local tmp=$(emktemp "${ROOT}"/bin) - ln -sf "${target}" "${tmp}" - mv -f "${tmp}" "${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_p11.ebuild b/app-shells/bash/bash-4.1_p11.ebuild index 38f99c06d248..bfb4f47bdb67 100644 --- a/app-shells/bash/bash-4.1_p11.ebuild +++ b/app-shells/bash/bash-4.1_p11.ebuild @@ -1,20 +1,18 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.1_p11.ebuild,v 1.5 2012/11/19 22:26:11 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.1_p11.ebuild,v 1.6 2013/12/22 13:42:06 vapier Exp $ -EAPI="1" +EAPI="4" -inherit eutils flag-o-matic toolchain-funcs multilib +inherit eutils flag-o-matic toolchain-funcs # Official patchlevel -# See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/ +# 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} [[ ${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 @@ -32,19 +30,17 @@ patches() { 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})" +SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla" +SLOT="${MY_PV}" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" +IUSE="afs mem-scramble +net nls +readline" DEPEND=">=sys-libs/ncurses-5.2-r2 + readline? ( >=sys-libs/readline-6.2 ) nls? ( virtual/libintl )" -RDEPEND="${DEPEND} - !<sys-apps/portage-2.1.6.7_p1 - !<sys-apps/paludis-0.26.0_alpha5" +RDEPEND="${DEPEND}" S=${WORKDIR}/${MY_P} @@ -54,32 +50,32 @@ pkg_setup() { 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}" +} +src_prepare() { # 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 ../.. + + # 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}-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 - 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 + epatch_user } -src_compile() { - local myconf= +src_configure() { + local myconf=() + + myconf+=( --without-lispdir ) #335896 # For descriptions of these, see config-top.h # bashrc/#26952 bash_logout/#90488 ssh/#24762 @@ -89,102 +85,53 @@ src_compile() { -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" + -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="${myconf} --disable-nls" + use nls || myconf+=( --disable-nls ) - # Force linking with system curses ... the bundled termcap lib - # sucks bad compared to ncurses - myconf="${myconf} --with-curses" + # 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 - myconf="${myconf} --without-lispdir" #335896 + # 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 :(. - use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash + 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) \ - ${myconf} || die - emake || die "make failed" - - if use plugins ; then - emake -C examples/loadables all others || die - fi + $(use_enable readline) \ + $(use_enable readline history) \ + $(use_enable readline bang-history) \ + "${myconf[@]}" } 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 + into / + newbin bash bash-${SLOT} - 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 + newman doc/bash.1 bash-${SLOT}.1 + newman doc/builtins.1 builtins-${SLOT}.1 - 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 + insinto /usr/share/info + newins doc/bashref.info bash-${SLOT}.info + dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info - 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) - local tmp=$(emktemp "${ROOT}"/bin) - ln -sf "${target}" "${tmp}" - mv -f "${tmp}" "${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/autoconf-mktime-2.53.patch b/app-shells/bash/files/autoconf-mktime-2.53.patch new file mode 100644 index 000000000000..7632b63f4f79 --- /dev/null +++ b/app-shells/bash/files/autoconf-mktime-2.53.patch @@ -0,0 +1,199 @@ +https://bugs.gentoo.org/220040 + +--- a/configure ++++ b/configure +@@ -12393,22 +12393,25 @@ else + #line $LINENO "configure" + #include "confdefs.h" + /* Test program from Paul Eggert and Tony Leneis. */ +-#if TIME_WITH_SYS_TIME ++#ifdef TIME_WITH_SYS_TIME + # include <sys/time.h> + # include <time.h> + #else +-# if HAVE_SYS_TIME_H ++# ifdef HAVE_SYS_TIME_H + # include <sys/time.h> + # else + # include <time.h> + # endif + #endif + +-#if HAVE_UNISTD_H ++#include <limits.h> ++#include <stdlib.h> ++ ++#ifdef HAVE_UNISTD_H + # include <unistd.h> + #endif + +-#if !HAVE_ALARM ++#ifndef HAVE_ALARM + # define alarm(X) /* empty */ + #endif + +@@ -12416,6 +12419,7 @@ else + #undef putenv + + static time_t time_t_max; ++static time_t time_t_min; + + /* Values we'll use to set the TZ environment variable. */ + static const char *const tz_strings[] = { +@@ -12424,9 +12428,9 @@ static const char *const tz_strings[] = { + }; + #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +-/* Fail if mktime fails to convert a date in the spring-forward gap. ++/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +-static void ++static int + spring_forward_gap () + { + /* glibc (up to about 1998-10-07) failed this test. */ +@@ -12445,23 +12449,27 @@ spring_forward_gap () + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; +- if (mktime (&tm) == (time_t)-1) +- exit (1); ++ return mktime (&tm) != (time_t) -1; + } + +-static void +-mktime_test (now) ++static int ++mktime_test1 (now) + time_t now; + { + struct tm *lt; +- if ((lt = localtime (&now)) && mktime (lt) != now) +- exit (1); +- now = time_t_max - now; +- if ((lt = localtime (&now)) && mktime (lt) != now) +- exit (1); ++ return ! (lt = localtime (&now)) || mktime (lt) == now; + } + +-static void ++static int ++mktime_test (now) ++ time_t now; ++{ ++ return (mktime_test1 (now) ++ && mktime_test1 ((time_t) (time_t_max - now)) ++ && mktime_test1 ((time_t) (time_t_min + now))); ++} ++ ++static int + irix_6_4_bug () + { + /* Based on code from Ariel Faigon. */ +@@ -12474,11 +12482,10 @@ irix_6_4_bug () + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); +- if (tm.tm_mon != 2 || tm.tm_mday != 31) +- exit (1); ++ return tm.tm_mon == 2 && tm.tm_mday == 31; + } + +-static void ++static int + bigtime_test (j) + int j; + { +@@ -12500,8 +12507,39 @@ bigtime_test (j) + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) +- exit (1); ++ return 0; + } ++ return 1; ++} ++ ++static int ++year_2050_test () ++{ ++ /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ++ ignoring leap seconds. */ ++ unsigned long int answer = 2527315200UL; ++ ++ struct tm tm; ++ time_t t; ++ tm.tm_year = 2050 - 1900; ++ tm.tm_mon = 2 - 1; ++ tm.tm_mday = 1; ++ tm.tm_hour = tm.tm_min = tm.tm_sec = 0; ++ tm.tm_isdst = -1; ++ ++ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" ++ instead of "TZ=America/Vancouver" in order to detect the bug even ++ on systems that don't support the Olson extension, or don't have the ++ full zoneinfo tables installed. */ ++ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); ++ ++ t = mktime (&tm); ++ ++ /* Check that the result is either a failure, or close enough ++ to the correct answer that we can assume the discrepancy is ++ due to leap seconds. */ ++ return (t == (time_t) -1 ++ || (0 < t && answer - 120 <= t && t <= answer + 120)); + } + + int +@@ -12515,9 +12553,15 @@ main () + isn't worth using anyway. */ + alarm (60); + +- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) +- continue; +- time_t_max--; ++ for (;;) ++ { ++ t = (time_t_max << 1) + 1; ++ if (t <= time_t_max) ++ break; ++ time_t_max = t; ++ } ++ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; ++ + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { +@@ -12525,17 +12569,22 @@ main () + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) +- mktime_test (t); +- mktime_test ((time_t) 60 * 60); +- mktime_test ((time_t) 60 * 60 * 24); +- +- for (j = 1; 0 < j; j *= 2) +- bigtime_test (j); +- bigtime_test (j - 1); ++ if (! mktime_test (t)) ++ return 1; ++ if (! (mktime_test ((time_t) 1) ++ && mktime_test ((time_t) (60 * 60)) ++ && mktime_test ((time_t) (60 * 60 * 24)))) ++ return 1; ++ ++ for (j = 1; ; j <<= 1) ++ if (! bigtime_test (j)) ++ return 1; ++ else if (INT_MAX / 2 < j) ++ break; ++ if (! bigtime_test (INT_MAX)) ++ return 1; + } +- irix_6_4_bug (); +- spring_forward_gap (); +- exit (0); ++ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); + } + _ACEOF + rm -f conftest$ac_exeext diff --git a/app-shells/bash/files/bash-3.0-configs.patch b/app-shells/bash/files/bash-3.0-configs.patch deleted file mode 100644 index 84e96242d845..000000000000 --- a/app-shells/bash/files/bash-3.0-configs.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- 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,18 @@ - /******************************************************************/ - - /* 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 -+ -+/* Force pgrp synchronization -+ * (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) -+ * -+ * The session will hang cases where you 'su' (not 'su -') and -+ * then run a piped command in emacs. -+ * This problem seem to happen due to scheduler changes kernel -+ * side - although reproduceble with later 2.4 kernels, it is -+ * especially easy with 2.6 kernels. -+ */ -+#define PGRP_PIPE 1 ---- bash-3.0/config-top.h -+++ bash-3.0/config-top.h -@@ -52,14 +52,14 @@ - /* The default value of the PATH variable. */ - #ifndef DEFAULT_PATH_VALUE - #define DEFAULT_PATH_VALUE \ -- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:." -+ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - #endif - - /* The value for PATH when invoking `command -p'. This is only used when - the Posix.2 confstr () function, or CS_PATH define are not present. */ - #ifndef STANDARD_UTILS_PATH - #define STANDARD_UTILS_PATH \ -- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" -+ "/bin:/usr/bin:/sbin:/usr/sbin" - #endif - - /* Default primary and secondary prompt strings. */ -@@ -74,14 +74,16 @@ - - /* System-wide .bashrc file for interactive shells. */ - /* #define SYS_BASHRC "/etc/bash.bashrc" */ -+#define SYS_BASHRC "/etc/bash/bashrc" /* #26952 */ - - /* System-wide .bash_logout for login shells. */ - /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ -+#define SYS_BASH_LOGOUT "/etc/bash/bash_logout" /* #90488 */ - - /* Define this to make non-interactive shells begun with argv[0][0] == '-' - run the startup files when not in posix mode. */ --/* #define NON_INTERACTIVE_LOGIN_SHELLS */ -+#define NON_INTERACTIVE_LOGIN_SHELLS - - /* Define this if you want bash to try to check whether it's being run by - sshd and source the .bashrc if so (like the rshd behavior). */ --/* #define SSH_SOURCE_BASHRC */ -+#define SSH_SOURCE_BASHRC /* #24762 */ diff --git a/app-shells/bash/files/bash-3.0-etc-inputrc.patch b/app-shells/bash/files/bash-3.0-etc-inputrc.patch deleted file mode 100644 index 204e7978d3c1..000000000000 --- a/app-shells/bash/files/bash-3.0-etc-inputrc.patch +++ /dev/null @@ -1,44 +0,0 @@ -Patch readline's bind.c so that /etc/inputrc is read as a last resort -following ~/.inputrc. This is better than putting INPUTRC in -the environment because INPUTRC will override even after the -user creates a ~/.inputrc - ---- bash-3.0/lib/readline/bind.c.agriffis 2004-03-03 22:39:32.000000000 -0500 -+++ bash-3.0/lib/readline/bind.c 2004-08-02 13:53:02.365731918 -0400 -@@ -781,6 +781,7 @@ - 1. the filename used for the previous call - 2. the value of the shell variable `INPUTRC' - 3. ~/.inputrc -+ 4. /etc/inputrc - If the file existed and could be opened and read, 0 is returned, - otherwise errno is returned. */ - int -@@ -789,17 +790,20 @@ - { - /* Default the filename. */ - if (filename == 0) -+ filename = last_readline_init_file; -+ if (filename == 0) -+ filename = sh_get_env_value ("INPUTRC"); -+ if (filename == 0 || *filename == 0) - { -- filename = last_readline_init_file; -- if (filename == 0) -- filename = sh_get_env_value ("INPUTRC"); -- if (filename == 0) -- filename = DEFAULT_INPUTRC; -+ /* If there's trouble reading DEFAULT_INPUTRC then fall back to -+ * the system inputrc -+ */ -+ filename = DEFAULT_INPUTRC; -+ if (_rl_read_init_file (filename, 0) == 0) -+ return 0; -+ filename = "/etc/inputrc"; - } - -- if (*filename == 0) -- filename = DEFAULT_INPUTRC; -- - #if defined (__MSDOS__) - if (_rl_read_init_file (filename, 0) == 0) - return 0; diff --git a/app-shells/bash/files/bash-3.1-bash-logger.patch b/app-shells/bash/files/bash-3.1-bash-logger.patch deleted file mode 100644 index 4f6df31c455a..000000000000 --- a/app-shells/bash/files/bash-3.1-bash-logger.patch +++ /dev/null @@ -1,89 +0,0 @@ -Add support for logging bash commands via syslog(). -Useful for deploying in honeypot environments. - -http://bugs.gentoo.org/91327 -http://www.nardware.co.uk/Security/html/bashlogger.htm - ---- bashhist.c -+++ bashhist.c -@@ -705,7 +705,7 @@ - { - hist_last_line_added = 1; - hist_last_line_pushed = 0; -- add_history (line); -+ add_history (line, 1); - history_lines_this_session++; - } - ---- lib/readline/histexpand.c -+++ lib/readline/histexpand.c -@@ -1222,9 +1222,7 @@ - - if (only_printing) - { --#if 0 -- add_history (result); --#endif -+ add_history (result, 1); - return (2); - } - ---- lib/readline/histfile.c -+++ lib/readline/histfile.c -@@ -262,7 +262,7 @@ - { - if (HIST_TIMESTAMP_START(line_start) == 0) - { -- add_history (line_start); -+ add_history (line_start, 0); - if (last_ts) - { - add_history_time (last_ts); ---- lib/readline/history.c -+++ lib/readline/history.c -@@ -31,6 +31,8 @@ - - #include <stdio.h> - -+#include <syslog.h> -+ - #if defined (HAVE_STDLIB_H) - # include <stdlib.h> - #else -@@ -246,10 +250,23 @@ - /* Place STRING at the end of the history list. The data field - is set to NULL. */ - void --add_history (string) -- const char *string; -+add_history (string, logme) -+ const char *string; -+ int logme; /* 0 means no sending history to syslog */ - { - HIST_ENTRY *temp; -+ if (logme) { -+ char trunc[600]; /* arbitrary max size of 600 bytes */ -+ if (strlen(string) < sizeof(trunc)) { -+ syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s", -+ getpid(), getuid(), string); -+ } else { -+ memcpy(trunc, string, sizeof(trunc)); -+ trunc[sizeof(trunc) - 1] = '\0'; -+ syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s(++TRUNC)", -+ getpid(), getuid(), trunc); -+ } -+ } - - if (history_stifled && (history_length == history_max_entries)) - { ---- lib/readline/history.h -+++ lib/readline/history.h -@@ -80,7 +80,7 @@ - - /* Place STRING at the end of the history list. - The associated data field (if any) is set to NULL. */ --extern void add_history PARAMS((const char *)); -+extern void add_history PARAMS((const char *, int )); - - /* Change the timestamp associated with the most recent history entry to - STRING. */ diff --git a/app-shells/bash/files/bash-3.1-gentoo.patch b/app-shells/bash/files/bash-3.1-gentoo.patch index 481bc588a3c9..a3a62d108c58 100644 --- a/app-shells/bash/files/bash-3.1-gentoo.patch +++ b/app-shells/bash/files/bash-3.1-gentoo.patch @@ -11,19 +11,6 @@ Collection of fixes from mandrake -.so bash.1 .SH SEE ALSO bash(1), sh(1) ---- bash-3.1/lib/readline/complete.c -+++ bash-3.1/lib/readline/complete.c -@@ -1544,9 +1544,7 @@ - if (rl_filename_completion_desired) - { - filename = tilde_expand (text); -- s = (nontrivial_match && rl_completion_mark_symlink_dirs == 0) -- ? LSTAT (filename, &finfo) -- : stat (filename, &finfo); -+ s = stat (filename, &finfo); - if (s == 0 && S_ISDIR (finfo.st_mode)) - { - if (_rl_complete_mark_directories /* && rl_completion_suppress_append == 0 */) --- bash-3.1/Makefile.in +++ bash-3.1/Makefile.in @@ -658,7 +658,7 @@ |