diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-06-12 22:23:17 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-06-12 22:23:17 +0000 |
commit | 5be45339eb0d9e477759c5cfb10b338f21077351 (patch) | |
tree | e7e423c266419dd02ab65a395fedfbd9d4a51ce8 /sys-apps/grep | |
parent | Add ~alpha keyword. (diff) | |
download | gentoo-2-5be45339eb0d9e477759c5cfb10b338f21077351.tar.gz gentoo-2-5be45339eb0d9e477759c5cfb10b338f21077351.tar.bz2 gentoo-2-5be45339eb0d9e477759c5cfb10b338f21077351.zip |
Fix segfault with perl regex usage #95495 by emanuele.giaquinta@gmail.com and update the restrict_arr to be portable #92586.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-apps/grep')
-rw-r--r-- | sys-apps/grep/ChangeLog | 12 | ||||
-rw-r--r-- | sys-apps/grep/files/digest-grep-2.5.1-r8 | 1 | ||||
-rw-r--r-- | sys-apps/grep/files/grep-2.5.1-perl-segv.patch | 19 | ||||
-rw-r--r-- | sys-apps/grep/files/grep-2.5.1-restrict_arr.patch | 8 | ||||
-rw-r--r-- | sys-apps/grep/grep-2.5.1-r8.ebuild | 76 |
5 files changed, 108 insertions, 8 deletions
diff --git a/sys-apps/grep/ChangeLog b/sys-apps/grep/ChangeLog index fc34f7c1d136..55d6efdc72e6 100644 --- a/sys-apps/grep/ChangeLog +++ b/sys-apps/grep/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-apps/grep -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/ChangeLog,v 1.45 2005/05/30 02:41:07 solar Exp $ +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/ChangeLog,v 1.46 2005/06/12 22:23:17 vapier Exp $ + +*grep-2.5.1-r8 (12 Jun 2005) + + 12 Jun 2005; Mike Frysinger <vapier@gentoo.org> + +files/grep-2.5.1-perl-segv.patch, files/grep-2.5.1-restrict_arr.patch, + +grep-2.5.1-r8.ebuild: + Fix segfault with perl regex usage #95495 by emanuele.giaquinta@gmail.com + and update the restrict_arr to be portable #92586. 29 May 2005; <solar@gentoo.org> grep-2.5.1-r6.ebuild, grep-2.5.1-r7.ebuild: - update sys-apps/grep to use libc expanded variable elibc_uclibc vs uclibc so diff --git a/sys-apps/grep/files/digest-grep-2.5.1-r8 b/sys-apps/grep/files/digest-grep-2.5.1-r8 new file mode 100644 index 000000000000..ef03a032aa20 --- /dev/null +++ b/sys-apps/grep/files/digest-grep-2.5.1-r8 @@ -0,0 +1 @@ +MD5 85df024edc9f9689035f6b3de28c7731 grep-2.5.1.tar.gz 683093 diff --git a/sys-apps/grep/files/grep-2.5.1-perl-segv.patch b/sys-apps/grep/files/grep-2.5.1-perl-segv.patch new file mode 100644 index 000000000000..46218a1f4614 --- /dev/null +++ b/sys-apps/grep/files/grep-2.5.1-perl-segv.patch @@ -0,0 +1,19 @@ +Fix from upstream to fix a corner case segfault. + +http://bugs.gentoo.org/95495 + +--- grep-2.5.1/src/search.c ++++ grep-2.5.1/src/search.c +@@ -701,8 +701,10 @@ + char eol = eolbyte; + if (!exact) + { +- end = memchr (end, eol, buflim - end); +- end++; ++ if (!(end = memchr (end, eol, buflim - end))) ++ end = buflim; ++ else ++ end++; + while (buf < beg && beg[-1] != eol) + --beg; + } diff --git a/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch b/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch index b60a3c2aa971..2294e9c2372a 100644 --- a/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch +++ b/sys-apps/grep/files/grep-2.5.1-restrict_arr.patch @@ -1,15 +1,11 @@ --- lib/posix/regex.h +++ lib/posix/regex.h -@@ -533,7 +533,12 @@ extern int re_exec _RE_ARGS ((const char +@@ -533,7 +533,8 @@ extern int re_exec _RE_ARGS ((const char /* For now unconditionally define __restrict_arr to expand to nothing. Ideally we would have a test for the compiler which allows defining it to restrict. */ -+#if !defined(sun) -+# include <features.h> -+#endif -+#if !defined(__UCLIBC__) || !defined(__restrict_arr) ++#undef __restrict_arr #define __restrict_arr -+#endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *__restrict __preg, diff --git a/sys-apps/grep/grep-2.5.1-r8.ebuild b/sys-apps/grep/grep-2.5.1-r8.ebuild new file mode 100644 index 000000000000..bde3182758cc --- /dev/null +++ b/sys-apps/grep/grep-2.5.1-r8.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/grep-2.5.1-r8.ebuild,v 1.1 2005/06/12 22:23:17 vapier Exp $ + +inherit flag-o-matic eutils + +DESCRIPTION="GNU regular expression matcher" +HOMEPAGE="http://www.gnu.org/software/grep/grep.html" +SRC_URI="mirror://gnu/${PN}/${P}.tar.gz + mirror://gentoo/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="build nls pcre static" + +RDEPEND="" +DEPEND="${RDEPEND} + pcre? ( dev-libs/libpcre ) + nls? ( sys-devel/gettext )" + +src_unpack() { + unpack ${A} + cd "${S}" + + # Fix a weird sparc32 compiler bug + echo "" >> src/dfa.h + + epatch "${FILESDIR}"/${PV}-manpage.patch + epatch "${FILESDIR}"/${PV}-manpage-line-buffering.patch + epatch "${FILESDIR}"/${P}-fgrep.patch.bz2 + epatch "${FILESDIR}"/${P}-i18n.patch.bz2 + epatch "${FILESDIR}"/${P}-gofast.patch.bz2 + epatch "${FILESDIR}"/${P}-oi.patch.bz2 + epatch "${FILESDIR}"/${P}-restrict_arr.patch + epatch "${FILESDIR}"/${PV}-utf8-case.patch + epatch "${FILESDIR}"/${P}-perl-segv.patch #95495 + + # uclibc does not suffer from this glibc bug. + use elibc_uclibc || epatch "${FILESDIR}"/${PV}-tests.patch +} + +src_compile() { + if use static ; then + append-flags -static + append-ldflags -static + fi + + econf \ + --bindir=/bin \ + $(use_enable nls) \ + $(use_enable pcre perl-regexp) \ + || die "econf failed" + + # force static linking so we dont have to move it into / + sed -i \ + -e 's:-lpcre:-Wl,-Bstatic -lpcre -Wl,-Bdynamic:g' \ + src/Makefile || die "sed static pcre failed" + + emake || die "emake failed" +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # Override the default shell scripts... grep knows how to act + # based on how it's called + ln -sfn grep "${D}"/bin/egrep || die "ln egrep failed" + ln -sfn grep "${D}"/bin/fgrep || die "ln fgrep failed" + + if use build ; then + rm -r "${D}"/usr/share + else + dodoc AUTHORS ChangeLog NEWS README THANKS TODO + fi +} |