- New version: grep-2.5.4 (#502931)
- Fixed typos in %description - Updated utf-8 patch - Added dfa-optional patch (#538423)
This commit is contained in:
		
							parent
							
								
									62da4974b5
								
							
						
					
					
						commit
						d612644be3
					
				| @ -1 +1 @@ | |||||||
| grep-2.5.3.tar.bz2 | grep-2.5.4.tar.bz2 | ||||||
|  | |||||||
							
								
								
									
										68
									
								
								grep-2.5.4-dfa-optional.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								grep-2.5.4-dfa-optional.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,68 @@ | |||||||
|  | --- ./src/search.c.old	2010-02-12 14:29:01.000000000 +0100
 | ||||||
|  | +++ ./src/search.c	2010-02-12 14:29:18.207410166 +0100
 | ||||||
|  | @@ -278,6 +278,8 @@
 | ||||||
|  |    char eol = eolbyte; | ||||||
|  |    int backref, start, len, best_len; | ||||||
|  |    struct kwsmatch kwsm; | ||||||
|  | +  static int use_dfa;
 | ||||||
|  | +  static int use_dfa_checked = 0;
 | ||||||
|  |    size_t i, ret_val; | ||||||
|  |  #ifdef MBS_SUPPORT | ||||||
|  |    int mb_cur_max = MB_CUR_MAX; | ||||||
|  | @@ -285,6 +287,26 @@
 | ||||||
|  |    memset (&mbs, '\0', sizeof (mbstate_t)); | ||||||
|  |  #endif /* MBS_SUPPORT */ | ||||||
|  |   | ||||||
|  | +  if (!use_dfa_checked)
 | ||||||
|  | +    {
 | ||||||
|  | +      char *grep_use_dfa = getenv ("GREP_USE_DFA");
 | ||||||
|  | +      if (!grep_use_dfa)
 | ||||||
|  | +	{
 | ||||||
|  | +#ifdef MBS_SUPPORT
 | ||||||
|  | +	  /* Turn off DFA when processing multibyte input. */
 | ||||||
|  | +	  use_dfa = (MB_CUR_MAX == 1);
 | ||||||
|  | +#else
 | ||||||
|  | +	  use_dfa = 1;
 | ||||||
|  | +#endif /* MBS_SUPPORT */
 | ||||||
|  | +	}
 | ||||||
|  | +      else
 | ||||||
|  | +	{
 | ||||||
|  | +	  use_dfa = atoi (grep_use_dfa);
 | ||||||
|  | +	}
 | ||||||
|  | +
 | ||||||
|  | +      use_dfa_checked = 1;
 | ||||||
|  | +    }
 | ||||||
|  | +
 | ||||||
|  |    buflim = buf + size; | ||||||
|  |   | ||||||
|  |    for (beg = end = buf; end < buflim; beg = end) | ||||||
|  | @@ -353,7 +375,8 @@
 | ||||||
|  |  #endif /* MBS_SUPPORT */ | ||||||
|  |  		  (kwsm.index < kwset_exact_matches)) | ||||||
|  |  		goto success; | ||||||
|  | -	      if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
 | ||||||
|  | +	      if (use_dfa &&
 | ||||||
|  | +		  dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
 | ||||||
|  |  		continue; | ||||||
|  |  	    } | ||||||
|  |  	  else | ||||||
|  | @@ -362,7 +385,9 @@
 | ||||||
|  |  #ifdef MBS_SUPPORT | ||||||
|  |  	      size_t bytes_left = 0; | ||||||
|  |  #endif /* MBS_SUPPORT */ | ||||||
|  | -	      size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
 | ||||||
|  | +	      size_t offset = 0;
 | ||||||
|  | +	      if (use_dfa)
 | ||||||
|  | +		offset = dfaexec (&dfa, beg, buflim - beg, &backref);
 | ||||||
|  |  	      if (offset == (size_t) -1) | ||||||
|  |  		break; | ||||||
|  |  	      /* Narrow down to the line we've found. */ | ||||||
|  | @@ -404,7 +429,7 @@
 | ||||||
|  |  		--beg; | ||||||
|  |  	    } | ||||||
|  |  	  /* Successful, no backreferences encountered! */ | ||||||
|  | -	  if (!backref)
 | ||||||
|  | +	  if (use_dfa && !backref)
 | ||||||
|  |  	    goto success; | ||||||
|  |  	} | ||||||
|  |        else | ||||||
| @ -1,6 +1,6 @@ | |||||||
| From latin1 to utf8 | From latin1 to utf8 | ||||||
| 
 | 
 | ||||||
| diff -up grep-2.5.1a/AUTHORS.utf8 grep-2.5.1a/AUTHORS
 | diff -up grep-2.5.4/AUTHORS.utf8 grep-2.5.4/AUTHORS
 | ||||||
| --- grep-2.5.1a/AUTHORS.utf8	2008-10-01 18:42:53.000000000 +0200
 | --- grep-2.5.1a/AUTHORS.utf8	2008-10-01 18:42:53.000000000 +0200
 | ||||||
| +++ grep-2.5.1a/AUTHORS	2008-10-01 18:43:12.000000000 +0200
 | +++ grep-2.5.1a/AUTHORS	2008-10-01 18:43:12.000000000 +0200
 | ||||||
| @@ -40,7 +40,7 @@ send me email.
 | @@ -40,7 +40,7 @@ send me email.
 | ||||||
| @ -11,4 +11,4 @@ diff -up grep-2.5.1a/AUTHORS.utf8 grep-2.5.1a/AUTHORS | |||||||
| +Bernhard "Bero" Rosenkränzer <bero@arklinux.org> maintained GNU grep until
 | +Bernhard "Bero" Rosenkränzer <bero@arklinux.org> maintained GNU grep until
 | ||||||
|  version 2.5.1, ie. from Sep 2001 till 2003. |  version 2.5.1, ie. from Sep 2001 till 2003. | ||||||
|   |   | ||||||
|  Stepan Kasal <kasal@ucw.cz> maintains GNU grep since Feb 2004. |  Stepan Kasal <kasal@ucw.cz> maintained GNU grep since Feb 2004. | ||||||
							
								
								
									
										19
									
								
								grep.spec
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								grep.spec
									
									
									
									
									
								
							| @ -2,8 +2,8 @@ | |||||||
| 
 | 
 | ||||||
| Summary: Pattern matching utilities | Summary: Pattern matching utilities | ||||||
| Name: grep | Name: grep | ||||||
| Version: 2.5.3 | Version: 2.5.4 | ||||||
| Release: 6%{?dist} | Release: 1%{?dist} | ||||||
| License: GPLv3+ | License: GPLv3+ | ||||||
| Group: Applications/Text | Group: Applications/Text | ||||||
| Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}.tar.bz2 | Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}.tar.bz2 | ||||||
| @ -13,7 +13,8 @@ Patch3: grep-2.5.3-case.patch | |||||||
| Patch4: grep-2.5.3-egf-speedup.patch | Patch4: grep-2.5.3-egf-speedup.patch | ||||||
| # bug #460641 (a.k.a. 479152) | # bug #460641 (a.k.a. 479152) | ||||||
| Patch40: grep-bz460641.patch | Patch40: grep-bz460641.patch | ||||||
| Patch5: grep-2.5.1a-utf8.patch | Patch5: grep-2.5.4-utf8.patch | ||||||
|  | Patch6: grep-2.5.4-dfa-optional.patch | ||||||
| URL: http://www.gnu.org/software/grep/ | URL: http://www.gnu.org/software/grep/ | ||||||
| Requires(post): /sbin/install-info | Requires(post): /sbin/install-info | ||||||
| Requires(preun): /sbin/install-info | Requires(preun): /sbin/install-info | ||||||
| @ -36,9 +37,9 @@ GNU grep is needed by many scripts, so it shall be installed on every system. | |||||||
| %patch4 -p1 -b .egf-speedup | %patch4 -p1 -b .egf-speedup | ||||||
| %patch40 -p1 -b .bz460641 | %patch40 -p1 -b .bz460641 | ||||||
| %patch5 -p1 -b .utf8 | %patch5 -p1 -b .utf8 | ||||||
|  | %patch6 -p1 -b .dfa-optional | ||||||
| 
 | 
 | ||||||
| %build | %build | ||||||
| ./autogen.sh |  | ||||||
| %configure --without-included-regex CPPFLAGS="-I%{_includedir}/pcre" | %configure --without-included-regex CPPFLAGS="-I%{_includedir}/pcre" | ||||||
| make %{?_smp_mflags} | make %{?_smp_mflags} | ||||||
| 
 | 
 | ||||||
| @ -58,11 +59,11 @@ make check ||: | |||||||
| rm -rf ${RPM_BUILD_ROOT} | rm -rf ${RPM_BUILD_ROOT} | ||||||
| 
 | 
 | ||||||
| %post | %post | ||||||
| exec >/dev/null 2>&1 | #exec >/dev/null 2>&1 | ||||||
| /sbin/install-info --quiet --info-dir=%{_infodir} %{_infodir}/grep.info.gz || : | /sbin/install-info --quiet --info-dir=%{_infodir} %{_infodir}/grep.info.gz || : | ||||||
| 
 | 
 | ||||||
| %preun | %preun | ||||||
| exec >/dev/null 2>&1 | #exec >/dev/null 2>&1 | ||||||
| if [ $1 = 0 ]; then | if [ $1 = 0 ]; then | ||||||
| 	/sbin/install-info --quiet --info-dir=%{_infodir} --delete %{_infodir}/grep.info.gz || : | 	/sbin/install-info --quiet --info-dir=%{_infodir} --delete %{_infodir}/grep.info.gz || : | ||||||
| fi | fi | ||||||
| @ -76,6 +77,12 @@ fi | |||||||
| %{_mandir}/*/* | %{_mandir}/*/* | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Wed Feb 10 2010 Jaroslav Škarvada <jskarvad@redhat.com> - 2.5.4-1 | ||||||
|  | - New version: grep-2.5.4 (#502931) | ||||||
|  | - Fixed typos in %description | ||||||
|  | - Updated utf-8 patch | ||||||
|  | - Added dfa-optional patch (#538423) | ||||||
|  | 
 | ||||||
| * Tue Aug 11 2009 Lubomir Rintel <lkundrak@v3.sk> 2.5.3-6 | * Tue Aug 11 2009 Lubomir Rintel <lkundrak@v3.sk> 2.5.3-6 | ||||||
| - Silence possible scriptlets errors | - Silence possible scriptlets errors | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user