Add some more patches from Debian/SuSe/Fedora and add a workaround for UTF8 mishaps...
authorMike Frysinger <vapier@gentoo.org>
Sun, 16 Oct 2005 02:42:28 +0000 (02:42 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 16 Oct 2005 02:42:28 +0000 (02:42 +0000)
Package-Manager: portage-2.0.53_rc5

app-shells/bash/ChangeLog
app-shells/bash/Manifest
app-shells/bash/bash-3.0-r13.ebuild [new file with mode: 0644]
app-shells/bash/files/bash-3.0-prompt.patch [new file with mode: 0644]
app-shells/bash/files/bash-3.0-utf8.patch [new file with mode: 0644]
app-shells/bash/files/digest-bash-3.0-r13 [new file with mode: 0644]

index 9c7a75a0104f66f3ef32a6d4711757cfeef4a29b..eef96f330ce245443f0f9f505eeaa686a4256830 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for app-shells/bash
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.75 2005/10/03 22:23:51 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.76 2005/10/16 02:42:28 vapier Exp $
+
+*bash-3.0-r13 (16 Oct 2005)
+
+  16 Oct 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/bash-3.0-prompt.patch, +files/bash-3.0-utf8.patch,
+  +bash-3.0-r13.ebuild:
+  Add some more patches from Debian/SuSe/Fedora and add a workaround for UTF8
+  mishaps #69407.
 
   03 Oct 2005; Mike Frysinger <vapier@gentoo.org> files/bashrc:
   Add an alias for colored output to global bashrc.
index 2e87464d52d02044b1c126659ffbeabc01be09e9..b7376c9c0531545e6b55789d3bff77f76642960f 100644 (file)
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
 MD5 4eb41e471f0b8475284437703a912f9b ChangeLog 15403
 MD5 3da49e27281cbe16582393239ba5b29b bash-2.05b-r11.ebuild 3715
 MD5 a4df32e089db48d7c99fd6be36368475 bash-2.05b-r9.ebuild 3516
@@ -50,3 +53,10 @@ MD5 7d8a8ef90c1818a0cd66808ac2740638 files/dot-bash_logout 127
 MD5 d76b9aa6b733175df21c2bb6afe8900d files/dot-bash_profile 193
 MD5 6dcc418c7812b5f8ebf2f6562eb2e57c files/dot-bashrc 983
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDUb6dgIKl8Uu19MoRAudKAJ478tUVITF5rszU1F/leVcIjmnx6gCfVLMb
+RpbttIvNYam0uN5doORgqIg=
+=lBTY
+-----END PGP SIGNATURE-----
diff --git a/app-shells/bash/bash-3.0-r13.ebuild b/app-shells/bash/bash-3.0-r13.ebuild
new file mode 100644 (file)
index 0000000..b7830f8
--- /dev/null
@@ -0,0 +1,157 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.0-r13.ebuild,v 1.1 2005/10/16 02:42:28 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+# Official patchlevel
+# See ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/
+PLEVEL=16
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html"
+# Hit the GNU mirrors before hitting Chet's site
+SRC_URI="mirror://gnu/bash/${P}.tar.gz
+       ftp://ftp.cwru.edu/pub/bash/${P}.tar.gz
+       $(for ((i=1; i<=PLEVEL; i++)); do
+               printf 'ftp://ftp.cwru.edu/pub/bash/bash-%s-patches/bash%s-%03d\n' \
+                       ${PV} ${PV/\.} ${i}
+               printf 'mirror://gnu/bash/bash-%s-patches/bash%s-%03d\n' \
+                       ${PV} ${PV/\.} ${i}
+       done)"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="afs nls build bashlogger unicode"
+
+# we link statically with ncurses
+DEPEND=">=sys-libs/ncurses-5.2-r2"
+RDEPEND=""
+
+src_unpack() {
+       unpack ${P}.tar.gz
+       cd "${S}"
+       epatch "${FILESDIR}"/${P}-gentoo.patch
+
+       # Remove autoconf dependency
+       sed -i -e "/&& autoconf/d" Makefile.in
+
+       # Include official patches
+       local i
+       for ((i=1; i<=PLEVEL; i++)); do
+               epatch "${DISTDIR}"/${PN}${PV/\.}-$(printf '%03d' ${i})
+       done
+
+       # Fall back to /etc/inputrc
+       epatch "${FILESDIR}"/${P}-etc-inputrc.patch
+       # Fix network tests on Darwin #79124
+       epatch "${FILESDIR}"/${P}-darwin-conn.patch
+       # read patch headers for more info ... many ripped from Fedora/Debian/SuSe
+       for i in afs crash jobs manpage pwd read-e-segfault ulimit histtimeformat \
+                locale multibyteifs rl-display rl-self-insert
+       do
+               epatch "${FILESDIR}"/${P}-${i}.patch
+       done
+       # Hacks for bugs in unicode support #69407 #108936
+       if use unicode ; then
+               epatch "${FILESDIR}"/${P}-prompt.patch
+               epatch "${FILESDIR}"/${P}-utf8.patch
+       fi
+       # Fix read-builtin and the -u pipe option #87093
+       epatch "${FILESDIR}"/${P}-read-builtin-pipe.patch
+       # Don't barf on handled signals in scripts
+       epatch "${FILESDIR}"/${P}-trap-fg-signals.patch
+       # Fix a problem when using pipes and PGRP_PIPE #92349
+       epatch "${FILESDIR}"/${P}-pgrp-pipe-fix.patch
+       # Make sure static linking always works #100138
+       epatch "${FILESDIR}"/${P}-force-static-linking.patch
+       # Fix parallel builds #87247
+       epatch "${FILESDIR}"/${P}-parallel.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}"/${P}-bash-logger.patch
+       fi
+
+       epatch "${FILESDIR}"/${P}-configs.patch
+
+       sed -i 's:-lcurses:-lncurses:' configure || die "sed configure"
+}
+
+src_compile() {
+       filter-flags -malign-double
+
+       local myconf=
+
+       # Always use the buildin readline, else if we update readline
+       # bash gets borked as readline is usually not binary compadible
+       # between minor versions.
+       #
+       # Martin Schlemmer <azarah@gentoo.org> (1 Sep 2002)
+       #use readline && myconf="--with-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 use with bugs ;).
+       #use static && export LDFLAGS="${LDFLAGS} -static"
+       use nls || myconf="${myconf} --disable-nls"
+
+       echo 'int main(){}' > "${T}"/term-test.c
+       if ! $(tc-getCC) -static -lncurses "${T}"/term-test.c 2> /dev/null ; then
+               export bash_cv_termcap_lib=gnutermcap
+       else
+               export bash_cv_termcap_lib=libcurses
+               myconf="${myconf} --with-ncurses"
+       fi
+
+       econf \
+               $(use_with afs) \
+               --disable-profiling \
+               --without-gnu-malloc \
+               ${myconf} || die
+       # Make sure we always link statically with ncurses
+       sed -i "/^TERMCAP_LIB/s:-lncurses:-Wl,-Bstatic -lncurses -Wl,-Bdynamic:" Makefile || die "sed failed"
+       emake -j1 || die "make failed"  # see bug 102426
+}
+
+src_install() {
+       einstall || die
+
+       dodir /bin
+       mv "${D}"/usr/bin/bash "${D}"/bin/
+       [[ ${USERLAND} != "BSD" ]] && dosym bash /bin/sh
+       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
+
+       if use build ; then
+               rm -rf "${D}"/usr
+       else
+               doman doc/*.1
+               dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
+               dosym bash.info.gz /usr/share/info/bashref.info.gz
+       fi
+}
+
+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/files/bash-3.0-prompt.patch b/app-shells/bash/files/bash-3.0-prompt.patch
new file mode 100644 (file)
index 0000000..11ec1c0
--- /dev/null
@@ -0,0 +1,28 @@
+Hack around this bug:
+
+http://lists.gnu.org/archive/html/bug-bash/2004-10/msg00419.html
+
+not suitable for upstream; need a proper fix
+
+http://bugs.gentoo.org/108936
+http://bugs.gentoo.org/69407
+
+--- lib/readline/display.c
++++ lib/readline/display.c
+@@ -941,6 +941,7 @@
+         /* nleft == number of characters in the line buffer between the
+            start of the line and the cursor position. */
+         nleft = c_pos - pos;
++#if 0
+ 
+         /* Since _rl_backspace() doesn't know about invisible characters in the
+            prompt, and there's no good way to tell it, we compensate for
+@@ -954,6 +955,8 @@
+               _rl_last_c_pos = nleft;
+           }
+ 
++#endif
++
+         if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+           _rl_move_cursor_relative (nleft, &invisible_line[pos]);
+         else if (nleft != _rl_last_c_pos)
diff --git a/app-shells/bash/files/bash-3.0-utf8.patch b/app-shells/bash/files/bash-3.0-utf8.patch
new file mode 100644 (file)
index 0000000..8f10db9
--- /dev/null
@@ -0,0 +1,47 @@
+Hack around this bug:
+
+http://lists.gnu.org/archive/html/bug-bash/2004-10/msg00419.html
+
+not suitable for upstream; need a proper fix
+
+http://bugs.gentoo.org/108936
+http://bugs.gentoo.org/69407
+
+--- bash-3.0/lib/readline/display.c
++++ bash-3.0/lib/readline/display.c
+@@ -1414,7 +1414,7 @@
+             insert_some_chars (nfd, lendiff, col_lendiff);
+             _rl_last_c_pos += col_lendiff;
+           }
+-        else if (*ols == 0 && lendiff > 0)
++        else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && col_lendiff > 0)
+           {
+             /* At the end of a line the characters do not have to
+                be "inserted".  They can just be placed on the screen. */
+--- bash-3.0/lib/readline/histexpand.c
++++ bash-3.0/lib/readline/histexpand.c
+@@ -206,6 +206,7 @@
+ 
+   /* Only a closing `?' or a newline delimit a substring search string. */
+   for (local_index = i; c = string[i]; i++)
++  {
+ #if defined (HANDLE_MULTIBYTE)
+     if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+       {
+@@ -222,7 +223,6 @@
+           continue;
+         }
+       }
+-    else
+ #endif /* HANDLE_MULTIBYTE */
+       if ((!substring_okay && (whitespace (c) || c == ':' ||
+         (history_search_delimiter_chars && member (c, history_search_delimiter_chars)) ||
+@@ -230,7 +230,7 @@
+         string[i] == '\n' ||
+         (substring_okay && string[i] == '?'))
+       break;
+-
++  }
+   which = i - local_index;
+   temp = (char *)xmalloc (1 + which);
+   if (which)
diff --git a/app-shells/bash/files/digest-bash-3.0-r13 b/app-shells/bash/files/digest-bash-3.0-r13
new file mode 100644 (file)
index 0000000..5d6eed5
--- /dev/null
@@ -0,0 +1,17 @@
+MD5 26c4d642e29b3533d8d754995bc277b3 bash-3.0.tar.gz 2418293
+MD5 24a83f78a44a6029024371f02da174dd bash30-001 4999
+MD5 6f4cf2aa975a1fcc0cb43a406bd47ca5 bash30-002 2119
+MD5 c8bf41e78cda16d391b9099eeba01386 bash30-003 4669
+MD5 c069dffbb3f442aac3660b883ddd97f5 bash30-004 3372
+MD5 ad06309c623ff8e1b9f039d3b7eb97c2 bash30-005 1776
+MD5 f162bf93a76759bab37b29509a4a6e20 bash30-006 4258
+MD5 89903d92ca620921aecb3f1f30c05ebe bash30-007 1808
+MD5 9a295c02f46bc867fc096862c7380a88 bash30-008 1220
+MD5 786c7e2af1dca5104af92bbdc60f7474 bash30-009 2828
+MD5 f2d90d06ed445a285c8406016e9d9c13 bash30-010 3193
+MD5 9506c56968c58332489986633319a186 bash30-011 2635
+MD5 2753d4de0b57fc8890488463c5e86d3f bash30-012 1395
+MD5 5de5be8289764c11a3206b06351d81a6 bash30-013 1963
+MD5 d4b531e02b6a0287cffdbf527134ca29 bash30-014 1165
+MD5 adc1ab952b42ed0c0f53d1c308a32101 bash30-015 1480
+MD5 a3bb09a185e4c6a813227f3e84e4f6e5 bash30-016 2453