auto-import grep-2.5.1-17 from grep-2.5.1-17.src.rpm

This commit is contained in:
cvsdist 2004-09-09 05:53:23 +00:00
parent 45a556bf99
commit 438e8dfad3
3 changed files with 95 additions and 86 deletions

View File

@ -1,5 +1,5 @@
--- grep-2.5.1/doc/grep.1.manpage 2002-01-22 13:20:04.000000000 +0000
+++ grep-2.5.1/doc/grep.1 2003-10-08 09:37:32.000000000 +0100
--- grep-2.5.1/doc/grep.1.manpage 2003-06-10 10:04:14.000000000 +0100
+++ grep-2.5.1/doc/grep.1 2003-06-10 10:05:16.000000000 +0100
@@ -191,6 +191,7 @@
.I PATTERN
as a list of fixed strings, separated by newlines,
@ -8,12 +8,3 @@
.BR \-P ", " \-\^\-perl-regexp
Interpret
.I PATTERN
@@ -302,7 +303,7 @@
This is especially useful for tools like zgrep, e.g.
.B "gzip -cd foo.gz |grep --label=foo something"
.TP
-.BR \-\^\-line-buffering
+.BR \-\^\-line-buffered
Use line buffering, it can be a performance penality.
.TP
.BR \-q ", " \-\^\-quiet ", " \-\^\-silent

View File

@ -1,48 +1,42 @@
--- grep-2.5.1/lib/posix/regex.h.oi 2004-01-05 12:09:12.984391131 +0000
+++ grep-2.5.1/lib/posix/regex.h 2004-01-05 12:09:24.717990622 +0000
@@ -109,6 +109,10 @@
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=72641 (sent upstream)
--- grep-2.5.1/src/grep.c.oi 2002-10-13 20:58:55.000000000 +0100
+++ grep-2.5.1/src/grep.c 2002-10-13 21:02:43.000000000 +0100
@@ -533,6 +533,37 @@
{
size_t match_size;
size_t match_offset;
+ if(match_icase)
+ {
+ char *buf = (char*) xmalloc (lim - beg);
+ char *ibeg = buf;
+ char *ilim = ibeg + (lim - beg);
+ int i;
+ for (i = 0; i < lim - beg; i++)
+ ibeg[i] = tolower (beg[i]);
+
/* If this bit is set, +, ? and | aren't recognized as operators.
If not set, they are. */
#define RE_LIMITED_OPS (RE_INTERVALS << 1)
--- grep-2.5.1/src/search.c.oi 2004-01-05 12:07:00.550199415 +0000
+++ grep-2.5.1/src/search.c 2004-01-05 12:07:00.566197505 +0000
@@ -31,7 +31,7 @@
#include "system.h"
#include "grep.h"
-#include "regex.h"
+#include <regex.h>
#include "dfa.h"
#include "kwset.h"
#include "error.h"
@@ -190,7 +190,7 @@
size_t total = size;
char const *motif = pattern;
- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
/* For GNU regex compiler we have to pass the patterns separately to detect
@@ -268,12 +268,12 @@
if (strcmp (matcher, "awk") == 0)
{
- re_set_syntax (RE_SYNTAX_AWK);
+ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
}
else
{
- re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
}
+ while ((match_offset = (*execute) (ibeg, lim - beg, &match_size, 1))
+ != (size_t) -1)
+ {
+ char const *b = ibeg + match_offset;
+ if (b == lim)
+ break;
+ if (match_size == 0)
+ break;
+ if(color_option)
+ printf("\33[%sm", grep_color);
+ fwrite(b, sizeof (char), match_size, stdout);
+ if(color_option)
+ fputs("\33[00m", stdout);
+ fputs("\n", stdout);
+ ibeg = b + match_size;
+ }
+ free (buf);
+ lastout = lim;
+ if(line_buffered)
+ fflush(stdout);
+ return;
+ }
while ((match_offset = (*execute) (beg, lim - beg, &match_size, 1))
!= (size_t) -1)
{

View File

@ -1,20 +1,22 @@
%define beta %nil
%define rel 7.8
%define rel 17
Summary: The GNU versions of grep pattern matching utilities.
Name: grep
Version: 2.5.1
%if "%{beta}" != ""
Release: 3.%{beta}.%{rel}
Release: 4.%{beta}.%{rel}
%else
Release: %{rel}
%endif
License: GPL
Group: Applications/Text
Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}%{beta}.tar.bz2
Patch0: grep-2.5-i18n.patch
Patch1: grep-2.5.1-oi.patch
Patch2: grep-2.5.1-gofast.patch
Patch3: grep-2.5.1-manpage.patch
Patch0: grep-2.5.1-oi.patch
Patch1: grep-2.5-i18n.patch
Patch2: grep-2.5.1-manpage.patch
# This patch isn't applied; it doesn't work (but shows where the problem is.)
Patch3: grep-2.5.1-gofast.patch
Patch4: grep-2.5.1-efgrep.patch
Prefix: %{_prefix}
Prereq: /sbin/install-info
Buildroot: %{_tmppath}/%{name}-%{version}-root
@ -32,10 +34,11 @@ utility for searching through text.
%prep
%setup -q -n %{name}-%{version}%{beta}
%patch0 -p1 -b .i18n
%patch1 -p1 -b .oi
%patch2 -p1 -b .gofast
%patch3 -p1 -b .manpage
%patch0 -p1 -b .oi
%patch1 -p1 -b .i18n
%patch2 -p1 -b .manpage
#%patch3 -p1 -b .gofast
%patch4 -p1 -b .efgrep
%build
[ ! -e configure ] && ./autogen.sh
@ -79,37 +82,58 @@ fi
%{_mandir}/*/*
%changelog
* Mon Jan 5 2004 Tim Waugh <twaugh@redhat.com> 2.5.1-7.8
- Fixed -o -i properly in a way that avoids glibc bug #112869.
* Thu Sep 18 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-17
- Use symlinks for egrep/fgrep, rather than shell script wrappers.
* Wed Dec 10 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.7
- Another multibyte efficiency bug-fix (bug #111800).
* Fri Jun 27 2003 Tim Waugh <twaugh@redhat.com>
- Fix debuginfo package.
* Mon Dec 8 2003 Tim Waugh <twaugh@redhat.com>
- Fixed -o -i properly (bug #111489).
* Fri Jun 27 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-16.1
- Rebuilt.
* Sat Dec 6 2003 Tim Waugh <twaugh@redhat.com>
- Another bug-fix for UTF-8 speed-up patch (bug #111614).
* Fri Jun 27 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-16
- Finally give up on making grep go fast. :-(
* Fri Nov 21 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.6
- Fixed man page (bug #106267).
- Fixed another three multibyte efficiency bugs.
- Fixed debuginfo package.
* Thu Jun 26 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-15.1
- Rebuilt.
* Thu Jun 26 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.5
* Thu Jun 26 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-15
- Fixed grep -i bug introduced by cache.
* Mon Jun 23 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.4
* Mon Jun 23 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-14.1
- Rebuilt.
* Mon Jun 23 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-14
- Redo the gofast patch (bug #97785).
* Thu Jun 12 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.3
- Fixed a bug in the gofast patch (bug #97226).
* Thu Jun 12 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-13.1
- Rebuilt.
* Tue Jun 10 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.2
* Thu Jun 12 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-13
- Fixed a bug in the gofast patch (bug #97266).
* Tue Jun 10 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-12.1
- Rebuilt.
* Tue Jun 10 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-12
- Go faster (bug #69900).
- Fix man page.
* Thu May 29 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-7.1
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Thu May 29 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-10.1
- Rebuilt.
* Thu May 29 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-10
- Use system regex again.
* Thu May 29 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-9
- Fixed bug in go-fast patch.
* Wed May 28 2003 Tim Waugh <twaugh@redhat.com> 2.5.1-8
- Go fast (bug #69900).
- Run test suite.
* Wed Jan 22 2003 Tim Powers <timp@redhat.com> 2.5.1-7
- rebuilt