Add patch upstream to fix handling of --devices and fifos #113640 by Ingo van Lil.
authorMike Frysinger <vapier@gentoo.org>
Sat, 26 Nov 2005 20:09:20 +0000 (20:09 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 26 Nov 2005 20:09:20 +0000 (20:09 +0000)
Package-Manager: portage-2.0.53_rc7

sys-apps/grep/ChangeLog
sys-apps/grep/Manifest
sys-apps/grep/files/digest-grep-2.5.1-r9 [new file with mode: 0644]
sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch [new file with mode: 0644]
sys-apps/grep/grep-2.5.1-r9.ebuild [new file with mode: 0644]

index ff533ad01fb5634c11e729bb794b49c53a5cf998..2e92a5b446b996b7cf57a7a5887bc25abf53663e 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for sys-apps/grep
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/ChangeLog,v 1.53 2005/09/17 00:29:20 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/ChangeLog,v 1.54 2005/11/26 20:09:20 vapier Exp $
+
+*grep-2.5.1-r9 (26 Nov 2005)
+
+  26 Nov 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/grep-2.5.1-fix-devices-skip.patch, +grep-2.5.1-r9.ebuild:
+  Add patch upstream to fix handling of --devices and fifos #113640 by Ingo
+  van Lil.
 
   17 Sep 2005; Ciaran McCreesh <ciaranm@gentoo.org> ChangeLog:
   Converted to UTF-8, fixed encoding screwups
index 60d6d00514c4ad2c1df82c343d39ad34e109f236..48a6da28299a4a0d6b1dcd7aab5210b2e7133df8 100644 (file)
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
 MD5 a6b713632ad06779ad521eb06562edf8 ChangeLog 8405
 MD5 792f6cb13959979de2b10537067603bb files/2.5.1-manpage-line-buffering.patch 477
 MD5 41f77ef6693dc91a37b5ec51ce5a3e2d files/2.5.1-manpage.patch 283
@@ -18,3 +21,10 @@ MD5 d2f3ae97c78e82789156a70976b35a39 grep-2.5.1-r6.ebuild 2237
 MD5 ff75e5df1dad1b337c9aed5313bc07be grep-2.5.1-r8.ebuild 2085
 MD5 e853cf278bda1dc5f46c743c9f3fe197 grep-2.5.1-r9.ebuild 2156
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDiMFvgIKl8Uu19MoRArKWAJ9OB3FtXhT/DQUFqchc4JC/jAwOxACcC3BY
+V8WDyu5nfq2rhFnfHYdwJ9g=
+=4N/o
+-----END PGP SIGNATURE-----
diff --git a/sys-apps/grep/files/digest-grep-2.5.1-r9 b/sys-apps/grep/files/digest-grep-2.5.1-r9
new file mode 100644 (file)
index 0000000..ef03a03
--- /dev/null
@@ -0,0 +1 @@
+MD5 85df024edc9f9689035f6b3de28c7731 grep-2.5.1.tar.gz 683093
diff --git a/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch b/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch
new file mode 100644 (file)
index 0000000..aff800c
--- /dev/null
@@ -0,0 +1,55 @@
+http://bugs.gentoo.org/113640
+
+2004-11-20  Benno Schulenberg  <benno@nietvergeten.nl>  (tiny change)
+
+       * src/grep.c (reset): Move the stat check ...
+       (grepfile): ... here, and also check for a fifo.
+
+Index: src/grep.c
+===================================================================
+RCS file: /cvsroot/grep/grep/src/grep.c,v
+retrieving revision 1.83
+retrieving revision 1.84
+diff -u -p -r1.83 -r1.84
+--- src/grep.c 20 Nov 2004 16:15:57 -0000      1.83
++++ src/grep.c 20 Nov 2004 16:20:38 -0000      1.84
+@@ -255,19 +255,6 @@ reset (int fd, char const *file, struct 
+   bufbeg[-1] = eolbyte;
+   bufdesc = fd;
+ 
+-  if (fstat (fd, &stats->stat) != 0)
+-    {
+-      error (0, errno, "fstat");
+-      return 0;
+-    }
+-  if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+-    return 0;
+-#ifndef DJGPP
+-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
+-#else
+-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+-#endif
+-    return 0;
+   if (S_ISREG (stats->stat.st_mode))
+     {
+       if (file)
+@@ -928,6 +915,19 @@ grepfile (char const *file, struct stats
+     }
+   else
+     {
++      if (stat (file, &stats->stat) != 0)
++        {
++          suppressible_error (file, errno);
++          return 1;
++        }
++      if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
++        return 1;
++#ifndef DJGPP
++      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
++#else
++      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
++#endif
++        return 1;
+       while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
+       continue;
+ 
diff --git a/sys-apps/grep/grep-2.5.1-r9.ebuild b/sys-apps/grep/grep-2.5.1-r9.ebuild
new file mode 100644 (file)
index 0000000..65aebe4
--- /dev/null
@@ -0,0 +1,78 @@
+# 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-r9.ebuild,v 1.1 2005/11/26 20:09:20 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
+       epatch "${FILESDIR}"/${P}-restrict_arr.patch
+       epatch "${FILESDIR}"/${PV}-utf8-case.patch
+       epatch "${FILESDIR}"/${P}-perl-segv.patch #95495
+       epatch "${FILESDIR}"/${P}-libintl.patch #92586
+       epatch "${FILESDIR}"/${P}-fix-devices-skip.patch #113640
+
+       # 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
+}