SHA256
1
0
forked from pool/grep
OBS User unknown 2009-06-12 15:32:35 +00:00 committed by Git OBS Bridge
parent 38e83c5257
commit c1df53f438
8 changed files with 94 additions and 31 deletions

View File

@ -1,6 +1,8 @@
--- src/dfa.c
Index: src/dfa.c
===================================================================
--- src/dfa.c.orig
+++ src/dfa.c
@@ -1287,7 +1287,14 @@
@@ -1339,7 +1339,14 @@ copytoks (int tindex, int ntokens)
int i;
for (i = 0; i < ntokens; ++i)

View File

@ -1,6 +1,8 @@
--- Makefile.am
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -5,21 +5,7 @@ SUBDIRS = intl po lib doc src tests m4 v
@@ -22,21 +22,7 @@ SUBDIRS = intl po lib doc src tests m4 v
EXTRA_DIST = TODO README README-alpha
@ -23,9 +25,11 @@
# make cvs-clean blatantly stolen from KDE CVS ;)
cvs-clean:
--- lib/Makefile.am
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am.orig
+++ lib/Makefile.am
@@ -15,6 +15,6 @@ libgreputils_a_SOURCES = \
@@ -30,6 +30,6 @@ libgreputils_a_SOURCES = \
libgreputils_a_LIBADD = @LIBOBJS@ @ALLOCA@
noinst_HEADERS = \
closeout.h error.h exclude.h fnmatch.h getopt.h \

33
grep-glibc210.diff Normal file
View File

@ -0,0 +1,33 @@
Index: grep-2.5.4/src/search.c
===================================================================
--- grep-2.5.4.orig/src/search.c
+++ grep-2.5.4/src/search.c
@@ -34,6 +34,8 @@
#include "system.h"
#include "grep.h"
#ifndef FGREP_PROGRAM
+#include <stdio.h>
+#define __USE_GNU
# include <regex.h>
# include "dfa.h"
#endif
@@ -45,6 +47,7 @@
#endif
#include "mbchar.h"
+
#define NCHAR (UCHAR_MAX + 1)
/* For -w, we also consider _ to be word constituent. */
Index: grep-2.5.4/src/dfa.c
===================================================================
--- grep-2.5.4.orig/src/dfa.c
+++ grep-2.5.4/src/dfa.c
@@ -120,6 +120,7 @@ extern void free();
# include <wctype.h>
#endif
+#define __USE_GNU
#include "regex.h"
#include "dfa.h"
#include "hard-locale.h"

View File

@ -1,6 +1,8 @@
--- lib/Makefile.am
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am.orig
+++ lib/Makefile.am
@@ -9,12 +9,12 @@ INCLUDES = -I.. -I$(srcdir) -I../intl
@@ -24,12 +24,12 @@ INCLUDES = -I.. -I$(srcdir) -I../intl
DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
libgreputils_a_SOURCES = \
@ -15,7 +17,9 @@
hard-locale.h obstack.h quotearg.h savedir.h xalloc.h xstrtol.h
EXTRA_DIST = strtol.c malloc.c realloc.c
--- lib/mbchar.c
Index: lib/mbchar.c
===================================================================
--- /dev/null
+++ lib/mbchar.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
@ -53,7 +57,9 @@
+};
+
+#endif /* IS_BASIC_ASCII */
--- lib/mbchar.h
Index: lib/mbchar.h
===================================================================
--- /dev/null
+++ lib/mbchar.h
@@ -0,0 +1,350 @@
+/* Multibyte character data type.
@ -406,9 +412,11 @@
+#endif
+
+#endif /* _MBCHAR_H */
--- src/dfa.c
Index: src/dfa.c
===================================================================
--- src/dfa.c.orig
+++ src/dfa.c
@@ -122,6 +122,7 @@ extern void free();
@@ -123,6 +123,7 @@ extern void free();
#include "regex.h"
#include "dfa.h"
#include "hard-locale.h"
@ -416,7 +424,7 @@
/* HPUX, define those as macros in sys/param.h */
#ifdef setbit
@@ -378,6 +379,7 @@ static int hard_LC_COLLATE; /* Nonzero i
@@ -379,6 +380,7 @@ static int hard_LC_COLLATE; /* Nonzero i
#ifdef MBS_SUPPORT
/* These variables are used only if (MB_CUR_MAX > 1). */
static mbstate_t mbs; /* Mbstate for mbrlen(). */
@ -424,7 +432,7 @@
static int cur_mb_len; /* Byte length of the current scanning
multibyte character. */
static int cur_mb_index; /* Byte index of the current scanning multibyte
@@ -426,7 +428,14 @@ update_mb_len_index (unsigned char const
@@ -427,7 +429,14 @@ update_mb_len_index (char const *p, int
next character is a multibyte character or not. */
if (! cur_mb_index)
{
@ -440,7 +448,7 @@
if (cur_mb_len > 1)
/* It is a multibyte character.
cur_mb_len was already set by mbrlen(). */
@@ -472,12 +481,22 @@ fetch_wc (char const *eoferr)
@@ -473,12 +482,22 @@ fetch_wc (char const *eoferr)
return WEOF;
}
@ -466,7 +474,7 @@
lexptr += cur_mb_len;
lexleft -= cur_mb_len;
return wc;
@@ -1429,6 +1448,7 @@ dfaparse (char const *s, size_t len, str
@@ -1430,6 +1449,7 @@ dfaparse (char const *s, size_t len, str
{
cur_mb_index = 0;
cur_mb_len = 0;
@ -474,7 +482,7 @@
memset(&mbs, 0, sizeof(mbstate_t));
}
#endif /* MBS_SUPPORT */
@@ -2839,6 +2859,7 @@ dfaexec (struct dfa *d, char const *begi
@@ -2838,6 +2858,7 @@ dfaexec (struct dfa *d, char const *begi
if (MB_CUR_MAX > 1)
{
int remain_bytes, i;
@ -482,7 +490,7 @@
buf_begin = (unsigned char const *) begin;
buf_end = end;
@@ -2851,9 +2872,16 @@ dfaexec (struct dfa *d, char const *begi
@@ -2850,9 +2871,16 @@ dfaexec (struct dfa *d, char const *begi
{
if (remain_bytes == 0)
{
@ -502,7 +510,9 @@
if (remain_bytes <= 1)
{
remain_bytes = 0;
--- src/search.c
Index: src/search.c
===================================================================
--- src/search.c.orig
+++ src/search.c
@@ -43,6 +43,7 @@
#ifdef HAVE_LIBPCRE
@ -641,7 +651,7 @@
#endif /* MBS_SUPPORT */
beg += offset;
len = kwsmatch.size[0];
@@ -595,7 +616,7 @@ EXECUTE_FCT(Fexecute)
@@ -594,7 +615,7 @@ EXECUTE_FCT(Fexecute)
{
if (match_icase)
free((char*)buf);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 11 21:46:26 CEST 2009 - coolo@novell.com
- rediff to avoid fuzz
- fix build with glibc 2.10
-------------------------------------------------------------------
Thu Jun 4 17:41:19 CEST 2009 - crrodriguez@suse.de

View File

@ -26,7 +26,7 @@ Provides: base:/usr/bin/grep
AutoReqProv: on
PreReq: %{install_info_prereq}
Version: 2.5.4
Release: 2
Release: 3
Summary: Print lines matching a pattern
Source: grep-%{version}.tar.bz2
Patch: grep-%{version}.diff
@ -34,6 +34,7 @@ Patch1: pcre-static.patch
Patch2: grep-2.5.1a-mbcset.diff
Patch3: icase.diff
Patch4: grep-i18n-speedup.diff
Patch5: grep-glibc210.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -58,6 +59,7 @@ Authors:
%patch2
%patch3
%patch4
%patch5 -p1
rm -f lib/regex.h
rm -f m4/header.m4 m4/install.m4 m4/isc-posix.m4 m4/largefile.m4 m4/missing.m4 m4/sanity.m4
@ -92,6 +94,9 @@ ln -sf ../../bin/grep $RPM_BUILD_ROOT/usr/bin/grep
%doc %{_infodir}/*.gz
%changelog
* Thu Jun 11 2009 coolo@novell.com
- rediff to avoid fuzz
- fix build with glibc 2.10
* Thu Jun 04 2009 crrodriguez@suse.de
- link pcre library dynamically
* Wed Feb 11 2009 schwab@suse.de

View File

@ -1,4 +1,6 @@
--- src/grep.c
Index: src/grep.c
===================================================================
--- src/grep.c.orig
+++ src/grep.c
@@ -789,28 +789,10 @@ print_line_middle (const char *beg, cons
size_t match_offset;
@ -41,7 +43,9 @@
if (only_matching)
cur = lim;
else if (mid)
--- src/search.c
Index: src/search.c
===================================================================
--- src/search.c.orig
+++ src/search.c
@@ -193,10 +193,8 @@ GEAcompile (char const *pattern, size_t
size_t total = size;

View File

@ -1,14 +1,13 @@
--- configure.ac
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -136,9 +136,9 @@
if test x"$testpcre" = x"yes"; then
if pcre-config --cflags >/dev/null 2>&1; then
@@ -157,7 +157,7 @@ if test x"$testpcre" = x"yes"; then
CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
- LIBS="$LIBS `pcre-config --libs`"
+ LIBS="$LIBS `pcre-config --libs`"
LIBS="$LIBS `pcre-config --libs`"
fi
- AC_CHECK_LIB(pcre, pcre_exec)
+ AC_SEARCH_LIBS(pcre_exec, pcre, [AC_DEFINE(HAVE_LIBPCRE, 1, [Define to 1 if you have the `pcre' library (-lpcre).])])
fi
AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
AC_CONFIG_FILES([Makefile