Fix UTF8 case matching with a patch from Debian #76192 by Michael Mauch. Also update...
authorMike Frysinger <vapier@gentoo.org>
Thu, 6 Jan 2005 05:36:21 +0000 (05:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Thu, 6 Jan 2005 05:36:21 +0000 (05:36 +0000)
sys-apps/grep/ChangeLog
sys-apps/grep/Manifest
sys-apps/grep/files/2.5.1-manpage-line-buffering.patch [moved from sys-apps/grep/files/2.5.1-manpage-line-buffering.diff with 81% similarity]
sys-apps/grep/files/2.5.1-tests.patch [new file with mode: 0644]
sys-apps/grep/files/2.5.1-utf8-case.patch [new file with mode: 0644]
sys-apps/grep/files/digest-grep-2.5.1-r7 [new file with mode: 0644]
sys-apps/grep/files/gentoo-sparc32-dfa.patch [deleted file]
sys-apps/grep/files/grep-2.5.1-restrict_arr.patch
sys-apps/grep/grep-2.5.1-r6.ebuild
sys-apps/grep/grep-2.5.1-r7.ebuild [new file with mode: 0644]

index 8a20dd49f294bcbd7bff55900fab01696e2c7400..31e953167807ebaa6cca7bd28d28cee001b4207f 100644 (file)
@@ -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.39 2005/01/02 23:18:23 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/ChangeLog,v 1.40 2005/01/06 05:36:21 vapier Exp $
+
+*grep-2.5.1-r7 (06 Jan 2005)
+
+  06 Jan 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/2.5.1-tests.patch, +files/2.5.1-utf8-case.patch,
+  +grep-2.5.1-r7.ebuild:
+  Fix UTF8 case matching with a patch from Debian #76192 by Michael Mauch.
+  Also update one of the tests to fix #63507 by Daniel Black.
 
   02 Jan 2005; Ciaran McCreesh <ciaranm@gentoo.org> :
   Change encoding to UTF-8 for GLEP 31 compliance
index 1009b3b15b733d26c6e9db7c1c98c83b3c3fa372..041e5da8dd932c0d8492ba4f7a895e092d1467a0 100644 (file)
@@ -1,22 +1,25 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 5b56d66eb5f53e04d8962efbd5dff0e5 ChangeLog 6101
+MD5 c80f207bcb6d007a3d7cc9aa4e627fef ChangeLog 6401
+MD5 7d89d912a4ff159de9a97d0df6a00ae0 grep-2.5.1-r7.ebuild 2072
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 d4c242af376e2d40f28aee9116b88a64 grep-2.5.1-r6.ebuild 2260
+MD5 6986697c96b387013718a4a61d38c121 grep-2.5.1-r6.ebuild 2200
 MD5 41f77ef6693dc91a37b5ec51ce5a3e2d files/2.5.1-manpage.patch 283
-MD5 9b382fe04d2e5d86aea020215ceca879 files/gentoo-sparc32-dfa.patch 383
+MD5 5dcaa51f88b364134a43d60b661870ee files/digest-grep-2.5.1-r7 62
 MD5 b43c763953a7b7d3345fc0dd625f299c files/grep-2.5.1-fgrep.patch.bz2 1678
 MD5 294f8a32ae3036ebbf393610a286d80e files/grep-2.5.1-gofast.patch.bz2 4389
-MD5 0fb1a9dfb2cac7195b12574d85e68901 files/2.5.1-manpage-line-buffering.diff 391
 MD5 5dcaa51f88b364134a43d60b661870ee files/digest-grep-2.5.1-r6 62
+MD5 0f1fff27ddb2ad479129fb130301d035 files/2.5.1-tests.patch 531
 MD5 f2f8cec983dc49b399880ab8eae882cb files/grep-2.5.1-i18n.patch.bz2 2903
 MD5 575345b799197d6c79fe93c757664262 files/grep-2.5.1-oi.patch.bz2 831
-MD5 7fe2377aba625aaed445a12cefa4fb37 files/grep-2.5.1-restrict_arr.patch 495
+MD5 a6f56755c0a2460bc62e7db7d78b7fef files/grep-2.5.1-restrict_arr.patch 549
+MD5 e39e9fd198a2c0a5984f2c7d188b3c49 files/2.5.1-utf8-case.patch 933
+MD5 792f6cb13959979de2b10537067603bb files/2.5.1-manpage-line-buffering.patch 477
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFB3L+droRuSHgZdywRAiKyAJ9MkOzrgEblev5VCEmwr7uMQ/ao/wCgiwpA
-LwcTgZhwdSonE7u28Sbt0cI=
-=j6h1
+iD8DBQFB3M5jroRuSHgZdywRArYlAJ9kD1Phq7aFEB8YZ43EKV6WYIvNsACeNUdR
+kyJizQQHmH+Fp48k2hCXQY8=
+=9N/L
 -----END PGP SIGNATURE-----
similarity index 81%
rename from sys-apps/grep/files/2.5.1-manpage-line-buffering.diff
rename to sys-apps/grep/files/2.5.1-manpage-line-buffering.patch
index 8b32dd2984d7ea88e64bf82405e4669754623758..6a417a9b9b4df7e9dccce056ec3c3d7c1938203d 100644 (file)
@@ -1,3 +1,6 @@
+grep recognizes '--line-buffered' instead of '--line-buffering'
+taviso (20 Aug 2004)
+
 --- doc/grep.1.orig    2004-08-20 09:28:45.857442048 +0100
 +++ doc/grep.1 2004-08-20 09:27:20.959348520 +0100
 @@ -303,7 +303,7 @@
diff --git a/sys-apps/grep/files/2.5.1-tests.patch b/sys-apps/grep/files/2.5.1-tests.patch
new file mode 100644 (file)
index 0000000..c0f9894
--- /dev/null
@@ -0,0 +1,13 @@
+glibc has changed the error code it returns from '1' to '2'.  The 
+included grep regex library returns '1' still though, so spencer 
+test #55 incorrectly fails.  For now, we update the test to match 
+the glibc regex since that is what we're using ;).
+
+http://bugs.gentoo.org/show_bug.cgi?id=76192
+http://linuxfromscratch.org/pipermail/lfs-dev/2003-February/032543.html
+
+--- tests/spencer1.tests.orig  2005-01-06 00:17:34.550645568 -0500
++++ tests/spencer1.tests       2005-01-06 00:18:43.682135984 -0500
+@@ -55 +55 @@
+-1@(*)b@-
++2@(*)b@-
diff --git a/sys-apps/grep/files/2.5.1-utf8-case.patch b/sys-apps/grep/files/2.5.1-utf8-case.patch
new file mode 100644 (file)
index 0000000..c884270
--- /dev/null
@@ -0,0 +1,29 @@
+Grabbed from Debian:
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=249245
+
+To fix Gentoo bug:
+http://bugs.gentoo.org/show_bug.cgi?id=76192
+
+--- grep-2.5.1.orig/src/dfa.c  2004-10-19 02:07:23.000000000 +0900
++++ grep-2.5.1/src/dfa.c       2004-10-19 02:24:28.000000000 +0900
+@@ -652,6 +652,20 @@
+         REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
+                              work_mbc->nchars + 1);
+         work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
++        if (case_fold && (iswlower((wint_t) wc) || iswupper((wint_t) wc)))
++          {
++              wint_t altcase;
++
++              altcase = wc;           /* keeps compiler happy */
++              if (iswlower((wint_t) wc))
++                altcase = towupper((wint_t) wc);
++              else if (iswupper((wint_t) wc))
++                altcase = towlower((wint_t) wc);
++
++              REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
++                             work_mbc->nchars + 1);
++              work_mbc->chars[work_mbc->nchars++] = (wchar_t) altcase;
++          }
+       }
+     }
+   while ((wc = wc1) != L']');
diff --git a/sys-apps/grep/files/digest-grep-2.5.1-r7 b/sys-apps/grep/files/digest-grep-2.5.1-r7
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/gentoo-sparc32-dfa.patch b/sys-apps/grep/files/gentoo-sparc32-dfa.patch
deleted file mode 100644 (file)
index 20295fc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-*** src/dfa.h  Fri Apr 25 01:36:02 2003
---- src/dfa.h.mod      Fri Apr 25 01:36:56 2003
-***************
-*** 428,432 ****
---- 428,433 ----
-  
-  /* dfaerror() is called by the regexp routines whenever an error occurs.  It
-     takes a single argument, a NUL-terminated string describing the error.
-     The user must supply a dfaerror.  */
-  extern void dfaerror PARAMS ((const char *));
-+ 
index aa71bbcb9db0fdffc47f0590a6688af344e7f4e3..54caa355c2fa3b26921833d074ef91b54fa4da8c 100644 (file)
@@ -1,10 +1,11 @@
 --- lib/posix/regex.h.mps      2004-06-09 22:00:00.000000000 +0200
 +++ lib/posix/regex.h  2004-06-09 22:00:40.000000000 +0200
-@@ -533,7 +533,9 @@ extern int re_exec _RE_ARGS ((const char
+@@ -533,7 +533,10 @@ 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.  */
-+#ifndef __restrict_arr
++#include <features.h>
++#if !defined(__UCLIBC__) || !defined(__restrict_arr)
  #define __restrict_arr
 +#endif
  
index da21e4e3c6de36ab7a520313aa2d60cd376de600..443e4a084fb5f774e695d2c801826b593599b9b0 100644 (file)
@@ -1,6 +1,6 @@
 # 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-r6.ebuild,v 1.10 2005/01/02 23:18:23 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/grep/grep-2.5.1-r6.ebuild,v 1.11 2005/01/06 05:36:21 vapier Exp $
 
 inherit gnuconfig flag-o-matic eutils
 
@@ -24,15 +24,14 @@ DEPEND="${RDEPEND}
 src_unpack() {
        unpack ${A} && cd ${S} || die
 
-       if [ "${ARCH}" = "sparc" -a "${PROFILE_ARCH}" = "sparc" ] ; then
-               epatch "${FILESDIR}/gentoo-sparc32-dfa.patch"
-       fi
+       # Fix a weird sparc32 compiler bug
+       echo "" >> src/dfa.h
        epatch "${FILESDIR}/${PV}-manpage.patch"
 
        # man page describes a --line-buffering option, where as
        # grep recognises --line-buffered.
        #       -taviso (20 Aug 2004)
-       epatch ${FILESDIR}/${PV}-manpage-line-buffering.diff
+       epatch ${FILESDIR}/${PV}-manpage-line-buffering.patch
 
        use uclibc && epatch ${FILESDIR}/grep-2.5.1-restrict_arr.patch
 
diff --git a/sys-apps/grep/grep-2.5.1-r7.ebuild b/sys-apps/grep/grep-2.5.1-r7.ebuild
new file mode 100644 (file)
index 0000000..f5d13a3
--- /dev/null
@@ -0,0 +1,84 @@
+# 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-r7.ebuild,v 1.1 2005/01/06 05:36:21 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 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="build nls pcre static uclibc"
+
+RDEPEND="virtual/libc"
+DEPEND="${RDEPEND}
+       pcre? (
+               >=sys-apps/sed-4
+               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}"/${PV}-tests.patch
+}
+
+src_compile() {
+       if use static ; then
+               append-flags -static
+               append-ldflags -static
+       fi
+
+       local myconf
+       if use uclibc ; then
+               myconf="${myconf} --without-included-regex"
+       else
+               myconf="${myconf} $(use_enable pcre perl-regexp)"
+       fi
+       econf \
+               --bindir=/bin \
+               $(use_enable nls) \
+               ${myconf} \
+               || die "econf failed"
+
+       if use pcre && ! use uclibc ; then
+               sed -i \
+                       -e 's:-lpcre:/usr/lib/libpcre.a:g' \
+                       {lib,src}/Makefile \
+                       || die "sed Makefile failed"
+       fi
+
+       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
+}