From 45a6f0b34cf576fa092195fa455a4708fba2d075 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Tue, 14 Jun 2022 14:13:04 +0200 Subject: [PATCH] initial package creation Signed-off-by: Toshaan Bharvani --- SOURCES/GREP_COLORS | 4 + SOURCES/colorgrep.csh | 11 + SOURCES/colorgrep.sh | 7 + SOURCES/grep-3.5-help-align.patch | 23 + SOURCES/grep-3.5-man-fix-gs.patch | 61 ++ SOURCES/grep-3.6-gnulib-c-stack-fix.patch | 686 ++++++++++++++++++ SOURCES/grepconf.sh | 11 + SPECS/grep.spec | 841 ++++++++++++++++++++++ 8 files changed, 1644 insertions(+) create mode 100644 SOURCES/GREP_COLORS create mode 100644 SOURCES/colorgrep.csh create mode 100644 SOURCES/colorgrep.sh create mode 100644 SOURCES/grep-3.5-help-align.patch create mode 100644 SOURCES/grep-3.5-man-fix-gs.patch create mode 100644 SOURCES/grep-3.6-gnulib-c-stack-fix.patch create mode 100644 SOURCES/grepconf.sh create mode 100644 SPECS/grep.spec diff --git a/SOURCES/GREP_COLORS b/SOURCES/GREP_COLORS new file mode 100644 index 0000000..1ef53a6 --- /dev/null +++ b/SOURCES/GREP_COLORS @@ -0,0 +1,4 @@ +# Configuration file for the color grep utility + +# 'none' shuts colorization off. +#COLOR none diff --git a/SOURCES/colorgrep.csh b/SOURCES/colorgrep.csh new file mode 100644 index 0000000..b3152a6 --- /dev/null +++ b/SOURCES/colorgrep.csh @@ -0,0 +1,11 @@ + +# color-grep initialization + +/usr/libexec/grepconf.sh -c +if ( $status == 1 ) then + exit +endif + +alias grep 'grep --color=auto' +alias egrep 'egrep --color=auto' +alias fgrep 'fgrep --color=auto' diff --git a/SOURCES/colorgrep.sh b/SOURCES/colorgrep.sh new file mode 100644 index 0000000..cd0539c --- /dev/null +++ b/SOURCES/colorgrep.sh @@ -0,0 +1,7 @@ +# color-grep initialization + +/usr/libexec/grepconf.sh -c || return + +alias grep='grep --color=auto' 2>/dev/null +alias egrep='egrep --color=auto' 2>/dev/null +alias fgrep='fgrep --color=auto' 2>/dev/null diff --git a/SOURCES/grep-3.5-help-align.patch b/SOURCES/grep-3.5-help-align.patch new file mode 100644 index 0000000..a2268b9 --- /dev/null +++ b/SOURCES/grep-3.5-help-align.patch @@ -0,0 +1,23 @@ +diff --git a/src/grep.c b/src/grep.c +index a530988..b6f6ee3 100644 +--- a/src/grep.c ++++ b/src/grep.c +@@ -2023,7 +2023,8 @@ Output control:\n\ + -D, --devices=ACTION how to handle devices, FIFOs and sockets;\n\ + ACTION is 'read' or 'skip'\n\ + -r, --recursive like --directories=recurse\n\ +- -R, --dereference-recursive likewise, but follow all symlinks\n\ ++ -R, --dereference-recursive\n\ ++ likewise, but follow all symlinks\n\ + ")); + printf (_("\ + --include=GLOB search only files that match GLOB (a file pattern)" +@@ -2033,7 +2034,7 @@ Output control:\n\ + --exclude-dir=GLOB skip directories that match GLOB\n\ + ")); + printf (_("\ +- -L, --files-without-match print only names of FILEs with no selected lines\n\ ++ -L, --files-without-match print only names of FILEs with no selected lines\n\ + -l, --files-with-matches print only names of FILEs with selected lines\n\ + -c, --count print only a count of selected lines per FILE\n\ + -T, --initial-tab make tabs line up (if needed)\n\ diff --git a/SOURCES/grep-3.5-man-fix-gs.patch b/SOURCES/grep-3.5-man-fix-gs.patch new file mode 100644 index 0000000..425aae9 --- /dev/null +++ b/SOURCES/grep-3.5-man-fix-gs.patch @@ -0,0 +1,61 @@ +diff --git a/doc/grep.in.1 b/doc/grep.in.1 +index 91c0bca..d2cf00a 100644 +--- a/doc/grep.in.1 ++++ b/doc/grep.in.1 +@@ -464,7 +464,7 @@ Print + .I NUM + lines of trailing context after matching lines. + Places a line containing a group separator +-.RB ( \-\^\- ) ++.RB "(described under " \-\^\-group\-separator ) + between contiguous groups of matches. + With the + .B \-o +@@ -477,7 +477,7 @@ Print + .I NUM + lines of leading context before matching lines. + Places a line containing a group separator +-.RB ( \-\^\- ) ++.RB "(described under " \-\^\-group\-separator ) + between contiguous groups of matches. + With the + .B \-o +@@ -490,13 +490,24 @@ Print + .I NUM + lines of output context. + Places a line containing a group separator +-.RB ( \-\^\- ) ++.RB "(described under " \-\^\-group\-separator ) + between contiguous groups of matches. + With the + .B \-o + or + .B \-\^\-only\-matching + option, this has no effect and a warning is given. ++.TP ++.BI \-\^\-group\-separator= SEP ++Use ++.I SEP ++as a group separator. By default ++.I SEP ++is double hyphen ++.RB ( \-\^\- ). ++.TP ++.B \-\^\-no\-group-separator ++Use empty string as a group separator. + .SS "File and Directory Selection" + .TP + .BR \-a ", " \-\^\-text +diff --git a/src/grep.c b/src/grep.c +index de7616a..a530988 100644 +--- a/src/grep.c ++++ b/src/grep.c +@@ -2047,6 +2047,8 @@ Context control:\n\ + ")); + printf (_("\ + -NUM same as --context=NUM\n\ ++ --group-separator=SEP use SEP as a group separator\n\ ++ --no-group-separator use empty string as a group separator\n\ + --color[=WHEN],\n\ + --colour[=WHEN] use markers to highlight the matching strings;\n\ + WHEN is 'always', 'never', or 'auto'\n\ diff --git a/SOURCES/grep-3.6-gnulib-c-stack-fix.patch b/SOURCES/grep-3.6-gnulib-c-stack-fix.patch new file mode 100644 index 0000000..e494b88 --- /dev/null +++ b/SOURCES/grep-3.6-gnulib-c-stack-fix.patch @@ -0,0 +1,686 @@ +diff --git a/gnulib-tests/Makefile.in b/gnulib-tests/Makefile.in +index aa979f4..194cc7d 100644 +--- a/gnulib-tests/Makefile.in ++++ b/gnulib-tests/Makefile.in +@@ -3100,7 +3100,7 @@ test_argmatch_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC) + test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) + test_btowc_LDADD = $(LDADD) $(LIB_SETLOCALE) + test_c_ctype_LDADD = $(LDADD) $(LIB_SETLOCALE) +-test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@ ++test_c_stack_LDADD = $(LDADD) -lsigsegv @LIBINTL@ + test_c_strcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) + test_c_strncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) + test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB) +diff --git a/gnulib-tests/gnulib.mk b/gnulib-tests/gnulib.mk +index b1dc6f9..ba0594e 100644 +--- a/gnulib-tests/gnulib.mk ++++ b/gnulib-tests/gnulib.mk +@@ -209,7 +209,7 @@ EXTRA_DIST += test-c-ctype.c macros.h + TESTS += test-c-stack.sh test-c-stack2.sh + TESTS_ENVIRONMENT += LIBSIGSEGV='@LIBSIGSEGV@' + check_PROGRAMS += test-c-stack +-test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@ ++test_c_stack_LDADD = $(LDADD) -lsigsegv @LIBINTL@ + MOSTLYCLEANFILES += t-c-stack.tmp t-c-stack2.tmp + EXTRA_DIST += test-c-stack.c test-c-stack.sh test-c-stack2.sh macros.h + +diff --git a/lib/c-stack.c b/lib/c-stack.c +index 3aea16a..b0e5cb1 100644 +--- a/lib/c-stack.c ++++ b/lib/c-stack.c +@@ -1,6 +1,6 @@ + /* Stack overflow handling. + +- Copyright (C) 2002, 2004, 2006, 2008-2020 Free Software Foundation, Inc. ++ Copyright (C) 2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -37,54 +37,28 @@ + + #include "c-stack.h" + +-#include "gettext.h" +-#define _(msgid) gettext (msgid) +- + #include + #include +- + #include +-#if ! HAVE_STACK_T && ! defined stack_t +-typedef struct sigaltstack stack_t; +-#endif +- +-#include + #include + #include + #include +- +-/* Pre-2008 POSIX declared ucontext_t in ucontext.h instead of signal.h. */ +-#if HAVE_UCONTEXT_H +-# include +-#endif +- + #include + + #if DEBUG + # include + #endif + +-/* Use libsigsegv only if needed; kernels like Solaris can detect +- stack overflow without the overhead of an external library. */ +-#define USE_LIBSIGSEGV (!HAVE_XSI_STACK_OVERFLOW_HEURISTIC && HAVE_LIBSIGSEGV) +- +-#if USE_LIBSIGSEGV +-# include +-#endif ++#include + + #include "exitfail.h" +-#include "ignore-value.h" +-#include "intprops.h" + #include "getprogname.h" ++#include "ignore-value.h" + +-#if defined SA_ONSTACK && defined SA_SIGINFO +-# define SIGINFO_WORKS 1 +-#else +-# define SIGINFO_WORKS 0 +-# ifndef SA_ONSTACK +-# define SA_ONSTACK 0 +-# endif +-#endif ++#include "gettext.h" ++#define _(msgid) gettext (msgid) ++ ++#if HAVE_STACK_OVERFLOW_RECOVERY + + /* Storage for the alternate signal stack. + 64 KiB is not too large for Gnulib-using apps, and is large enough +@@ -106,9 +80,6 @@ static _GL_ASYNC_SAFE void (* volatile segv_action) (int); + static char const * volatile program_error_message; + static char const * volatile stack_overflow_message; + +-#if (USE_LIBSIGSEGV \ +- || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING)) +- + /* Output an error message, then exit with status EXIT_FAILURE if it + appears to have been a stack overflow, or with a core dump + otherwise. This function is async-signal-safe. */ +@@ -118,12 +89,6 @@ static char const * volatile progname; + static _GL_ASYNC_SAFE _Noreturn void + die (int signo) + { +-# if !SIGINFO_WORKS && !USE_LIBSIGSEGV +- /* We can't easily determine whether it is a stack overflow; so +- assume that the rest of our program is perfect (!) and that +- this segmentation violation is a stack overflow. */ +- signo = 0; +-# endif + segv_action (signo); + char const *message = signo ? program_error_message : stack_overflow_message; + +@@ -164,12 +129,8 @@ null_action (int signo _GL_UNUSED) + { + } + +-#endif /* SIGALTSTACK || LIBSIGSEGV */ +- +-#if USE_LIBSIGSEGV +- + /* Pacify GCC 9.3.1, which otherwise would complain about segv_handler. */ +-# if __GNUC_PREREQ (4, 6) ++# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) + # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" + # endif + +@@ -240,132 +201,7 @@ c_stack_action (_GL_ASYNC_SAFE void (*action) (int)) + return 0; + } + +-#elif HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING +- +-# if SIGINFO_WORKS +- +-static size_t volatile page_size; +- +-/* Handle a segmentation violation and exit. This function is +- async-signal-safe. */ +- +-static _GL_ASYNC_SAFE _Noreturn void +-segv_handler (int signo, siginfo_t *info, void *context _GL_UNUSED) +-{ +- /* Clear SIGNO if it seems to have been a stack overflow. */ +- +- /* If si_code is nonpositive, something like raise (SIGSEGV) occurred +- so it cannot be a stack overflow. */ +- bool cannot_be_stack_overflow = info->si_code <= 0; +- +- /* An unaligned address cannot be a stack overflow. */ +-# if FAULT_YIELDS_SIGBUS +- cannot_be_stack_overflow |= signo == SIGBUS && info->si_code == BUS_ADRALN; +-# endif +- +- /* If we can't easily determine that it is not a stack overflow, +- assume that the rest of our program is perfect (!) and that +- this segmentation violation is a stack overflow. +- +- Note that although both Linux and Solaris provide +- sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only +- Solaris satisfies the XSI heuristic. This is because +- Solaris populates uc_stack with the details of the +- interrupted stack, while Linux populates it with the details +- of the current stack. */ +- if (!cannot_be_stack_overflow) +- { +- /* If the faulting address is within the stack, or within one +- page of the stack, assume that it is a stack overflow. */ +- uintptr_t faulting_address = (uintptr_t) info->si_addr; +- +- /* On all platforms we know of, the first page is not in the +- stack to catch null pointer dereferening. However, all other +- pages might be in the stack. */ +- void *stack_base = (void *) (uintptr_t) page_size; +- uintptr_t stack_size = 0; stack_size -= page_size; +-# if HAVE_XSI_STACK_OVERFLOW_HEURISTIC +- /* Tighten the stack bounds via the XSI heuristic. */ +- ucontext_t const *user_context = context; +- stack_base = user_context->uc_stack.ss_sp; +- stack_size = user_context->uc_stack.ss_size; +-# endif +- uintptr_t base = (uintptr_t) stack_base, +- lo = (INT_SUBTRACT_WRAPV (base, page_size, &lo) || lo < page_size +- ? page_size : lo), +- hi = ((INT_ADD_WRAPV (base, stack_size, &hi) +- || INT_ADD_WRAPV (hi, page_size - 1, &hi)) +- ? UINTPTR_MAX : hi); +- if (lo <= faulting_address && faulting_address <= hi) +- signo = 0; +- +-# if DEBUG +- { +- char buf[1024]; +- ignore_value (write (STDERR_FILENO, buf, +- sprintf (buf, +- ("segv_handler code=%d fault=%p base=%p" +- " size=0x%zx page=0x%zx signo=%d\n"), +- info->si_code, info->si_addr, stack_base, +- stack_size, page_size, signo))); +- } +-# endif +- } +- +- die (signo); +-} +-# endif +- +-int +-c_stack_action (_GL_ASYNC_SAFE void (*action) (int)) +-{ +- stack_t st; +- st.ss_flags = 0; +- st.ss_sp = alternate_signal_stack; +- st.ss_size = sizeof alternate_signal_stack; +-# if SIGALTSTACK_SS_REVERSED +- /* Irix mistakenly treats ss_sp as the upper bound, rather than +- lower bound, of the alternate stack. */ +- st.ss_size -= sizeof (void *); +- char *ss_sp = st.ss_sp; +- st.ss_sp = ss_sp + st.ss_size; +-# endif +- int r = sigaltstack (&st, NULL); +- if (r != 0) +- return r; +- +- segv_action = action ? action : null_action; +- program_error_message = _("program error"); +- stack_overflow_message = _("stack overflow"); +- progname = getprogname (); +- +-# if SIGINFO_WORKS +- page_size = sysconf (_SC_PAGESIZE); +-# endif +- +- struct sigaction act; +- sigemptyset (&act.sa_mask); +- +-# if SIGINFO_WORKS +- /* POSIX 1003.1-2001 says SA_RESETHAND implies SA_NODEFER, but +- this is not true on Solaris 8 at least. It doesn't hurt to use +- SA_NODEFER here, so leave it in. */ +- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; +- act.sa_sigaction = segv_handler; +-# else +- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; +- act.sa_handler = die; +-# endif +- +-# if FAULT_YIELDS_SIGBUS +- if (sigaction (SIGBUS, &act, NULL) < 0) +- return -1; +-# endif +- return sigaction (SIGSEGV, &act, NULL); +-} +- +-#else /* ! (USE_LIBSIGSEGV +- || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING)) */ ++#else /* !HAVE_STACK_OVERFLOW_RECOVERY */ + + int + c_stack_action (_GL_ASYNC_SAFE void (*action) (int) _GL_UNUSED) +diff --git a/m4/c-stack.m4 b/m4/c-stack.m4 +index 85107f4..7cccb06 100644 +--- a/m4/c-stack.m4 ++++ b/m4/c-stack.m4 +@@ -1,376 +1,21 @@ + # Check prerequisites for compiling lib/c-stack.c. + +-# Copyright (C) 2002-2004, 2008-2020 Free Software Foundation, Inc. ++# Copyright (C) 2002-2004, 2008-2021 Free Software Foundation, Inc. + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # Written by Paul Eggert. + +-# serial 20 +- +-AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], +- [ +- AC_REQUIRE([AC_CANONICAL_HOST]) +- AC_CHECK_FUNCS_ONCE([setrlimit]) +- AC_CHECK_HEADERS_ONCE([ucontext.h]) +- +- dnl List of signals that are sent when an invalid virtual memory address +- dnl is accessed, or when the stack overflows. +- dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }. +- case "$host_os" in +- sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems +- FAULT_YIELDS_SIGBUS=1 ;; +- hpux*) # HP-UX +- FAULT_YIELDS_SIGBUS=1 ;; +- macos* | darwin*) # Mac OS X +- FAULT_YIELDS_SIGBUS=1 ;; +- gnu*) # Hurd +- FAULT_YIELDS_SIGBUS=1 ;; +- *) +- FAULT_YIELDS_SIGBUS=0 ;; +- esac +- AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS], +- [Define to 1 if an invalid memory address access may yield a SIGBUS.]) +- +- AC_CACHE_CHECK([for working C stack overflow detection], +- [gl_cv_sys_stack_overflow_works], +- [AC_RUN_IFELSE([AC_LANG_SOURCE( +- [[ +- #include +- #include +- #if HAVE_SETRLIMIT +- # include +- # include +- # include +- #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif +- +- static union +- { +- char buffer[2 * SIGSTKSZ]; +- long double ld; +- long u; +- void *p; +- } alternate_signal_stack; +- +- static void +- segv_handler (int signo) +- { +- _exit (0); +- } +- +- static int +- c_stack_action () +- { +- stack_t st; +- struct sigaction act; +- int r; +- +- st.ss_flags = 0; +- /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; +- r = sigaltstack (&st, 0); +- if (r != 0) +- return 1; +- +- sigemptyset (&act.sa_mask); +- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; +- act.sa_handler = segv_handler; +- #if FAULT_YIELDS_SIGBUS +- if (sigaction (SIGBUS, &act, 0) < 0) +- return 2; +- #endif +- if (sigaction (SIGSEGV, &act, 0) < 0) +- return 3; +- return 0; +- } +- static volatile int * +- recurse_1 (volatile int n, volatile int *p) +- { +- if (n >= 0) +- *recurse_1 (n + 1, p) += n; +- return p; +- } +- static int +- recurse (volatile int n) +- { +- int sum = 0; +- return *recurse_1 (n, &sum); +- } +- int +- main () +- { +- int result; +- #if HAVE_SETRLIMIT && defined RLIMIT_STACK +- /* Before starting the endless recursion, try to be friendly +- to the user's machine. On some Linux 2.2.x systems, there +- is no stack limit for user processes at all. We don't want +- to kill such systems. */ +- struct rlimit rl; +- rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ +- setrlimit (RLIMIT_STACK, &rl); +- #endif +- +- result = c_stack_action (); +- if (result != 0) +- return result; +- return recurse (0); +- } +- ]])], +- [gl_cv_sys_stack_overflow_works=yes], +- [gl_cv_sys_stack_overflow_works=no], +- [case "$host_os" in +- # Guess no on native Windows. +- mingw*) gl_cv_sys_stack_overflow_works="guessing no" ;; +- *) gl_cv_sys_stack_overflow_works=cross-compiling ;; +- esac +- ]) +- ]) +- +- if test "$gl_cv_sys_stack_overflow_works" = yes; then +- AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1], +- [Define to 1 if extending the stack slightly past the limit causes +- a SIGSEGV which can be handled on an alternate stack established +- with sigaltstack.]) +- +- dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address +- dnl of the memory block designated as an alternate stack. But IRIX 5.3 +- dnl interprets it as the highest address! +- AC_CACHE_CHECK([for correct stack_t interpretation], +- [gl_cv_sigaltstack_low_base], [ +- AC_RUN_IFELSE([ +- AC_LANG_SOURCE([[ +-#include +-#include +-#if HAVE_SYS_SIGNAL_H +-# include +-#endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif +-volatile char *stack_lower_bound; +-volatile char *stack_upper_bound; +-static void check_stack_location (volatile char *addr) +-{ +- if (addr >= stack_lower_bound && addr <= stack_upper_bound) +- exit (0); +- else +- exit (1); +-} +-static void stackoverflow_handler (int sig) +-{ +- char dummy; +- check_stack_location (&dummy); +-} +-int main () +-{ +- char mystack[2 * SIGSTKSZ]; +- stack_t altstack; +- struct sigaction action; +- /* Install the alternate stack. */ +- altstack.ss_sp = mystack + SIGSTKSZ; +- altstack.ss_size = SIGSTKSZ; +- stack_lower_bound = (char *) altstack.ss_sp; +- stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; +- altstack.ss_flags = 0; /* no SS_DISABLE */ +- if (sigaltstack (&altstack, NULL) < 0) +- exit (2); +- /* Install the SIGSEGV handler. */ +- sigemptyset (&action.sa_mask); +- action.sa_handler = &stackoverflow_handler; +- action.sa_flags = SA_ONSTACK; +- if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0) +- exit(3); +- /* Provoke a SIGSEGV. */ +- raise (SIGSEGV); +- exit (4); +-}]])], +- [gl_cv_sigaltstack_low_base=yes], +- [gl_cv_sigaltstack_low_base=no], +- [gl_cv_sigaltstack_low_base=cross-compiling])]) +- if test "$gl_cv_sigaltstack_low_base" = no; then +- AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1], +- [Define if sigaltstack() interprets the stack_t.ss_sp field +- incorrectly, as the highest address of the alternate stack range +- rather than as the lowest address.]) +- fi +- +- AC_CACHE_CHECK([for precise C stack overflow detection], +- [gl_cv_sys_xsi_stack_overflow_heuristic], +- [dnl On Linux/sparc64 (both in 32-bit and 64-bit mode), it would be wrong +- dnl to set HAVE_XSI_STACK_OVERFLOW_HEURISTIC to 1, because the third +- dnl argument passed to the segv_handler is a 'struct sigcontext *', not +- dnl an 'ucontext_t *'. It would lead to a failure of test-c-stack2.sh. +- case "${host_os}--${host_cpu}" in +- linux*--sparc*) +- gl_cv_sys_xsi_stack_overflow_heuristic=no +- ;; +- *) +- AC_RUN_IFELSE( +- [AC_LANG_SOURCE( +- [[ +- #include +- #include +- #if HAVE_UCONTEXT_H +- # include +- #endif +- #if HAVE_SETRLIMIT +- # include +- # include +- # include +- #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif +- +- static union +- { +- char buffer[2 * SIGSTKSZ]; +- long double ld; +- long u; +- void *p; +- } alternate_signal_stack; +- +- #if STACK_DIRECTION +- # define find_stack_direction(ptr) STACK_DIRECTION +- #else +- static int +- find_stack_direction (char const *addr) +- { +- char dummy; +- return (! addr ? find_stack_direction (&dummy) +- : addr < &dummy ? 1 : -1); +- } +- #endif +- +- static void +- segv_handler (int signo, siginfo_t *info, void *context) +- { +- if (0 < info->si_code) +- { +- /* For XSI heuristics to work, we need uc_stack to +- describe the interrupted stack (as on Solaris), and +- not the currently executing stack (as on Linux). */ +- ucontext_t const *user_context = context; +- char const *stack_min = user_context->uc_stack.ss_sp; +- size_t stack_size = user_context->uc_stack.ss_size; +- char const *faulting_address = info->si_addr; +- size_t s = faulting_address - stack_min; +- size_t page_size = sysconf (_SC_PAGESIZE); +- if (find_stack_direction (0) < 0) +- s += page_size; +- if (s < stack_size + page_size) +- _exit (0); +- _exit (4); +- } +- _exit (5); +- } +- +- static int +- c_stack_action () +- { +- stack_t st; +- struct sigaction act; +- int r; +- +- st.ss_flags = 0; +- /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; +- r = sigaltstack (&st, 0); +- if (r != 0) +- return 1; +- +- sigemptyset (&act.sa_mask); +- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; +- act.sa_sigaction = segv_handler; +- #if FAULT_YIELDS_SIGBUS +- if (sigaction (SIGBUS, &act, 0) < 0) +- return 2; +- #endif +- if (sigaction (SIGSEGV, &act, 0) < 0) +- return 3; +- return 0; +- } +- static volatile int * +- recurse_1 (volatile int n, volatile int *p) +- { +- if (n >= 0) +- *recurse_1 (n + 1, p) += n; +- return p; +- } +- static int +- recurse (volatile int n) +- { +- int sum = 0; +- return *recurse_1 (n, &sum); +- } +- int +- main () +- { +- int result; +- #if HAVE_SETRLIMIT && defined RLIMIT_STACK +- /* Before starting the endless recursion, try to be friendly +- to the user's machine. On some Linux 2.2.x systems, there +- is no stack limit for user processes at all. We don't want +- to kill such systems. */ +- struct rlimit rl; +- rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */ +- setrlimit (RLIMIT_STACK, &rl); +- #endif +- +- result = c_stack_action (); +- if (result != 0) +- return result; +- return recurse (0); +- } +- ]])], +- [gl_cv_sys_xsi_stack_overflow_heuristic=yes], +- [gl_cv_sys_xsi_stack_overflow_heuristic=no], +- [gl_cv_sys_xsi_stack_overflow_heuristic=cross-compiling]) +- ;; +- esac +- ]) +- +- if test "$gl_cv_sys_xsi_stack_overflow_heuristic" = yes; then +- AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1], +- [Define to 1 if extending the stack slightly past the limit causes +- a SIGSEGV, and an alternate stack can be established with sigaltstack, +- and the signal handler is passed a context that specifies the +- run time stack. This behavior is defined by POSIX 1003.1-2001 +- with the X/Open System Interface (XSI) option +- and is a standardized way to implement a SEGV-based stack +- overflow detection heuristic.]) +- fi +- fi]) +- +- +-AC_DEFUN([gl_PREREQ_C_STACK], +- [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC]) +- +- AC_CHECK_FUNCS_ONCE([sigaltstack]) +- AC_CHECK_DECLS([sigaltstack], , , [[#include ]]) +- +- AC_CHECK_HEADERS_ONCE([ucontext.h]) +- +- AC_CHECK_TYPES([stack_t], , , [[#include ]]) +- +- dnl c-stack does not need -lsigsegv if the system has XSI heuristics. +- if test "$gl_cv_sys_xsi_stack_overflow_heuristic" != yes; then +- gl_LIBSIGSEGV +- if test "$gl_cv_lib_sigsegv" = yes; then +- AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) +- AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) +- fi +- fi +-]) ++# serial 23 + + AC_DEFUN([gl_C_STACK], + [ +- dnl Prerequisites of lib/c-stack.c. +- gl_PREREQ_C_STACK ++ dnl 'c-stack' needs -lsigsegv if and only if the 'sigsegv' module needs it. ++ if test "$with_libsigsegv" = yes; then ++ if test "$gl_cv_lib_sigsegv" = yes; then ++ AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) ++ AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) ++ fi ++ fi + ]) +diff --git a/src/Makefile.am b/src/Makefile.am +index 1aebcf7..055ee17 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -45,7 +45,7 @@ LDADD = \ + ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a $(LIBICONV) \ + $(LIBTHREAD) + +-grep_LDADD = $(LDADD) $(PCRE_LIBS) $(LIBCSTACK) ++grep_LDADD = $(LDADD) $(PCRE_LIBS) -lsigsegv + localedir = $(datadir)/locale + AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib + +diff --git a/src/Makefile.in b/src/Makefile.in +index 20c43b5..a276db8 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1541,7 +1541,7 @@ LDADD = \ + ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a $(LIBICONV) \ + $(LIBTHREAD) + +-grep_LDADD = $(LDADD) $(PCRE_LIBS) $(LIBCSTACK) ++grep_LDADD = $(LDADD) $(PCRE_LIBS) -lsigsegv + AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib + EXTRA_DIST = egrep.sh + CLEANFILES = egrep fgrep *-t diff --git a/SOURCES/grepconf.sh b/SOURCES/grepconf.sh new file mode 100644 index 0000000..418af0b --- /dev/null +++ b/SOURCES/grepconf.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +case "$1" in + -c | --interactive-color) + ! grep -qsi "^COLOR.*none" /etc/GREP_COLORS + ;; + *) + echo >&2 "Invalid / no option passed, so far only -c | --interactive-color is supported." + exit 1 + ;; +esac diff --git a/SPECS/grep.spec b/SPECS/grep.spec new file mode 100644 index 0000000..63797a5 --- /dev/null +++ b/SPECS/grep.spec @@ -0,0 +1,841 @@ +Summary: Pattern matching utilities +Name: grep +Version: 3.6 +Release: 5%{?dist} +License: GPLv3+ +URL: https://www.gnu.org/software/grep/ + +Source: https://ftp.gnu.org/pub/gnu/grep/grep-%{version}.tar.xz +Source1: colorgrep.sh +Source2: colorgrep.csh +Source3: GREP_COLORS +Source4: grepconf.sh +# upstream ticket 39444 +Patch0: grep-3.5-man-fix-gs.patch +# upstream ticket 39445 +Patch1: grep-3.5-help-align.patch +# backported from upstream +Patch2: grep-3.6-gnulib-c-stack-fix.patch + +BuildRequires: gcc +BuildRequires: pcre-devel >= 3.9-10, texinfo, gettext +BuildRequires: autoconf automake glibc-all-langpacks +BuildRequires: perl-FileHandle +BuildRequires: make +BuildRequires: libsigsegv-devel +# https://fedorahosted.org/fpc/ticket/174 +Provides: bundled(gnulib) +# for backward compatibility (rhbz#1540485) +Provides: /bin/grep +Provides: /bin/fgrep +Provides: /bin/egrep + +%description +The GNU versions of commonly used grep utilities. Grep searches through +textual input for lines which contain a match to a specified pattern and then +prints the matching lines. GNU's grep utilities include grep, egrep and fgrep. + +GNU grep is needed by many scripts, so it shall be installed on every system. + +%prep +%setup -q +%patch0 -p1 -b .man-fix-gs +%patch1 -p1 -b .help-align +%patch2 -p1 -b .gnulib-c-stack-fix.patch + +%build +%global BUILD_FLAGS $RPM_OPT_FLAGS + +# Currently gcc on ppc uses double-double arithmetic for long double and it +# does not conform to the IEEE floating-point standard. Thus force +# long double to be double and conformant. +%ifarch ppc ppc64 +%global BUILD_FLAGS %{BUILD_FLAGS} -mlong-double-64 +%endif + +%configure --without-included-regex --disable-silent-rules \ + CPPFLAGS="-I%{_includedir}/pcre" CFLAGS="%{BUILD_FLAGS}" +%make_build + +%install +%make_install +gzip $RPM_BUILD_ROOT%{_infodir}/grep* +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d +install -pm 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d +install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir} +install -Dpm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/grepconf.sh + +%find_lang %name + +%check +make check + +%files -f %{name}.lang +%doc AUTHORS THANKS TODO NEWS README +%license COPYING + +%{_bindir}/* +%config(noreplace) %{_sysconfdir}/profile.d/colorgrep.*sh +%config(noreplace) %{_sysconfdir}/GREP_COLORS +%{_infodir}/*.info*.gz +%{_mandir}/*/* +%{_libexecdir}/grepconf.sh + +%changelog +* Mon Aug 09 2021 Mohan Boddu - 3.6-5 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Mon Jun 28 2021 Jaroslav Škarvada - 3.6-4 +- Fixed stack overflow detection + Resolves: rhbz#1975156 + +* Thu Apr 15 2021 Mohan Boddu - 3.6-3 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 3.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Nov 9 2020 Jaroslav Škarvada - 3.6-1 +- New version + Resolves: rhbz#1895797 + +* Wed Sep 30 2020 Jaroslav Škarvada - 3.5-1 +- New version + Resolves: rhbz#1883086 + +* Wed Aug 26 2020 Adam Williamson - 3.4-5 +- Backport fix for upstream #28105 to fix zgrep + Resolves: rhbz#1872913 +- Remove some non-portable tests that fail on armv7hl (Paul Eggert) + Resolves: rhbz#1863830 + +* Sat Aug 01 2020 Fedora Release Engineering - 3.4-4 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 3.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 13 2020 Tom Stellard - 3.4-2 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Wed Apr 1 2020 Jaroslav Škarvada - 3.4-1 +- New version + Resolves: rhbz#1818417 +- Added all glibc langpacks to allow more locale sensitive tests to run +- Added perl-FileHandle requirement for the filename-lineno.pl test + +* Wed Jan 29 2020 Fedora Release Engineering - 3.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 3.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Apr 24 2019 Björn Esser - 3.3-2 +- Remove hardcoded gzip suffix from GNU info pages + +* Wed Apr 10 2019 Jaroslav Škarvada - 3.3-1 +- New version + Resolves: rhbz#1698044 +- Updated patches +- Dropped glibc-2.28-fix patch (not needed) + +* Fri Feb 01 2019 Fedora Release Engineering - 3.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Aug 9 2018 Jaroslav Škarvada - 3.1-8 +- Fixed FTBFS with glibc-2.28 + Resolves: rhbz#1604263 + +* Fri Jul 13 2018 Fedora Release Engineering - 3.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Jaroslav Škarvada - 3.1-6 +- Dropped install-info + +* Wed Feb 07 2018 Fedora Release Engineering - 3.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Feb 2 2018 Jaroslav Škarvada - 3.1-4 +- Moved binaries to /usr/bin + Resolves: rhbz#1540485 + +* Wed Aug 02 2017 Fedora Release Engineering - 3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 3 2017 Jaroslav Škarvada - 3.1-1 +- New version + Related: rhbz#1421129 +- Updated patches + +* Fri Feb 10 2017 Jaroslav Škarvada - 3.0-1 +- New version + Resolves: rhbz#1421129 + +* Wed Feb 8 2017 Jaroslav Škarvada - 2.28-1 +- New version + Resolves: rhbz#1419921 +- De-fuzzified patches + +* Wed Dec 7 2016 Jaroslav Škarvada - 2.27-1 +- New version + Resolves: rhbz#1402379 +- De-fuzzified patches + +* Wed Oct 5 2016 Jaroslav Škarvada - 2.26-2 +- Re-enabled 'make check', glibc seems fixed + +* Mon Oct 3 2016 Jaroslav Škarvada - 2.26-1 +- New version + Resolves: rhbz#1381203 +- Disabled 'make check' due to glibc bug rhbz#1381582 + +* Fri Apr 22 2016 Jaroslav Škarvada - 2.25-1 +- New version + Resolves: rhbz#1329627 +- De-fuzzified patches + +* Fri Mar 11 2016 Jaroslav Škarvada - 2.24-1 +- New version + Resolves: rhbz#1316890 + +* Fri Feb 5 2016 Jaroslav Škarvada - 2.23-1 +- New version + Resolves: rhbz#1305035 +- Dropped disable-performance-related-tests, better-encoding-errors-handling, + Pc-consistent-results, and test-pcre-count-fix patches (all upstreamed) +- De-fuzzified man-fx-gs, and help-align patches + +* Wed Feb 03 2016 Fedora Release Engineering - 2.22-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 12 2016 Jaroslav Škarvada - 2.22-6 +- Fixed pcre-count test on secondary architectures + (byt test-pcre-count-fix patch) + Resolves: rhbz#1296842 + +* Wed Jan 6 2016 Jaroslav Škarvada - 2.22-5 +- Used latest upstream patch for bug 1269014 to fix regression, + fixed order of patches + Resolves: rhbz#1269014 + +* Tue Jan 5 2016 Jaroslav Škarvada - 2.22-4 +- Improved encoding errors handling (by better-encoding-errors-handling patch) + Resolves: rhbz#1219141 +- kwset-abuse test no longer needs to be explicitly set executable + +* Tue Dec 1 2015 Jaroslav Škarvada - 2.22-3 +- Fixed grep to be consistent in 'grep -Pc' and 'grep -P | wc -l' + Resolves: rhbz#1269014 + +* Thu Nov 5 2015 Jaroslav Škarvada - 2.22-2 +- Disabled performance related tests + (by disable-performance-related-tests patch), patch backported from upstream +- Dropped disable-long-pattern-perf-test patch (not needed, covered by + previous patch) + Resolves: rhbz#1278428 + +* Mon Nov 2 2015 Jaroslav Škarvada - 2.22-1 +- New version + Resolves: rhbz#1277113 +- Dropped buf-overrun-fix, recurse-behaviour-change-doc, gnulib + patches (all upstreamed) +- Minor spec cleanup to be consistent with whitespaces + +* Sun Aug 2 2015 Peter Robinson 2.21-7 +- Minor spec cleanups and modifications +- Drop Changelog, details in NEWS +- Add gnulib patch to fix FTBFS with perl 5.22 + +* Wed Jun 17 2015 Fedora Release Engineering - 2.21-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Apr 7 2015 Jaroslav Škarvada - 2.21-5 +- Documented change in behaviour of recurse option + Resolves: rhbz#1178305 + +* Sat Feb 21 2015 Till Maas - 2.21-4 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Jan 20 2015 Jaroslav Škarvada - 2.21-3 +- Fixed buffer overrun for grep -F + Resolves: rhbz#1183653 + +* Tue Dec 9 2014 Jaroslav Škarvada - 2.21-2 +- Disable silent rules to make the build process more verbose + +* Tue Nov 25 2014 Jaroslav Škarvada - 2.21-1 +- New version + Resolves: rhbz#1167657 +- De-fuzzified patches +- Dropped pcre-backported-fixes patch (not needed) + +* Fri Nov 14 2014 Jaroslav Škarvada - 2.20-7 +- Backported more PCRE fixes (by pcre-backported-fixes patch) +- Dropped pcre-invalid-utf8-fix patch, handled by pcre-backported-fixes patch + +* Tue Nov 11 2014 Jaroslav Škarvada - 2.20-6 +- Fixed invalid UTF-8 byte sequence error in PCRE mode + (by pcre-invalid-utf8-fix patch) + Resolves: rhbz#1161832 + +* Wed Aug 20 2014 Jaroslav Škarvada - 2.20-5 +- Added script to check whether grep is coloured + Resolves: rhbz#1034631 + +* Sat Aug 16 2014 Fedora Release Engineering - 2.20-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway - 2.20-3 +- fix license handling . + +* Sat Jun 07 2014 Fedora Release Engineering - 2.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Jun 4 2014 Jaroslav Škarvada - 2.20-1 +- New version + Resolves: rhbz#1104508 +- De-fuzzified patches + +* Fri May 23 2014 Jaroslav Škarvada - 2.19-1 +- New version + Resolves: rhbz#1100653 + +* Wed Feb 26 2014 Jaroslav Škarvada - 2.18-1 +- New version + Resolves: rhbz#1070127 +- De-fuzzified patches + +* Tue Feb 18 2014 Jaroslav Škarvada - 2.17-1 +- New version + Resolves: rhbz#1066310 +- De-fuzzified patches + +* Thu Jan 2 2014 Jaroslav Škarvada - 2.16-1 +- New version + Resolves: rhbz#1047813 +- De-fuzzified patches + +* Tue Nov 26 2013 Jaroslav Škarvada - 2.15-2 +- Removed coloring restriction for interactive shells + Resolves: rhbz#1034631 + +* Tue Oct 29 2013 Jaroslav Škarvada - 2.15-1 +- New version + Resolves: rhbz#1023698 +- Fixed bogus date in the changelog +- Dropped gnulib-tests-rm-f patch, rejected upstream and not + needed for Fedora build system +- Dropped man-fix-R patch, upstreamed +- De-fuzzified other patches + +* Sat Aug 03 2013 Fedora Release Engineering - 2.14-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jul 9 2013 Jaroslav Škarvada - 2.14-4 +- Added group-separator, no-group-separator options decription +- Aligned output of built-in help +- Defuzzified gnulib-tests-rm-f patch + +* Thu Feb 14 2013 Fedora Release Engineering - 2.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Oct 3 2012 Jaroslav Škarvada - 2.14-2 +- Fixed -R option placement + Resolves: rhbz#861937 + +* Mon Aug 20 2012 Jaroslav Škarvada - 2.14-1 +- New version + Resolves: rhbz#849594 + +* Thu Jul 19 2012 Fedora Release Engineering - 2.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 10 2012 Jaroslav Škarvada - 2.13-1 +- New version + Resolves: rhbz#837749 +- Fixed -i option + Resolves: rhbz#828844 +- Added virtual provide and FPC ticket link for bundled gnulib + Resolves: rhbz#821759 + +* Tue Apr 24 2012 Jaroslav Škarvada - 2.12-1 +- New version + Resolves: rhbz#815705 + +* Fri Mar 2 2012 Jaroslav Škarvada - 2.11-1 +- New version + +* Fri Feb 10 2012 Petr Pisar - 2.10-3 +- Rebuild against PCRE 8.30 + +* Fri Jan 13 2012 Fedora Release Engineering - 2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Nov 16 2011 Jaroslav Škarvada - 2.10-1 +- New version + +* Mon Jul 11 2011 Jaroslav Škarvada - 2.9-3 +- Use rm -f in gnulib-tests (gnulib-tests-rm-f patch) + Resolves: rhbz#716330 + +* Mon Jul 04 2011 Jaroslav Škarvada - 2.9-2 +- Fixed build failure on ppc - long double forced to double on ppc + +* Wed Jun 22 2011 Jaroslav Škarvada - 2.9-1 +- New version: grep-2.9 +- Removed dfa-buffer-overrun-fix patch + +* Mon Jun 20 2011 Jaroslav Škarvada - 2.8-4 +- dfa: don't overrun a malloc'd buffer for certain regexps + (patch dfa-buffer-overrun-fix) + Resolves: rhbz#713328 + +* Mon May 16 2011 Jaroslav Škarvada - 2.8-3 +- Added coloring aliases to csh script as well + +* Mon May 16 2011 Jaroslav Škarvada - 2.8-2 +- Added coloring to egrep and fgrep + Resolves: rhbz#697895 + +* Mon May 16 2011 Jaroslav Škarvada - 2.8-1 +- New version: grep-2.8 + Resolves: rhbz#704710 +- Removed const-range-exp patch (upstreamed) + +* Mon Apr 04 2011 Jaroslav Škarvada - 2.7-5 +- colorgrep scripts no longer overwrites COLORS envvar (#693058), + thanks to Ville Skyttä + +* Wed Feb 09 2011 Fedora Release Engineering - 2.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Oct 01 2010 Jaroslav Škarvada - 2.7-3 +- Fixed inconsistency with range expressions, const-range-exp patch (#583011) + +* Wed Sep 29 2010 jkeating - 2.7-2 +- Rebuilt for gcc bug 634757 + +* Tue Sep 21 2010 Jaroslav Škarvada - 2.7-1 +- New version: grep-2.7 +- Removed patches (already in upstream): dfa-optimize-period, + glibc-matcher-fallback, mmap-option-fix, dfa-convert-to-wide-char, + dfa-speedup-digit-xdigit + +* Fri Jun 11 2010 Jaroslav Škarvada - 2.6.3-4 +- Colors can be globally disabled via /etc/GREP_COLORS (#602867) +- Fixed indentation in spec +- Fixed defattr in spec + +* Mon Jun 07 2010 Jaroslav Škarvada - 2.6.3-3 +- Added auto-color profile.d scripts (thanks to Ville Skyttä #600832) +- Removed description macro from changelog + +* Thu May 06 2010 Jaroslav Škarvada - 2.6.3-2 +- Added dfa-optimize-period patch (speedup for . patterns in UTF-8) +- Added glibc-matcher-fallback patch (speedup for [a-z] patterns in UTF-8) +- Added mmap-option-fix patch +- Added dfa-convert-to-wide-char patch (speedup for -m and remove quadratic + complexity when going to glibc) +- Added dfa-speedup-digit-xdigit patch (speedup for [[:digit:]] [:xdigit:]]) + +* Sun Apr 04 2010 Jaroslav Škarvada - 2.6.3-1 +- New version: grep-2.6.3 +- make check is not silent now + +* Fri Mar 26 2010 Jaroslav Škarvada - 2.6.1-1 +- New version: grep-2.6.1 +- Dropped sigsegv patch (integrated upstream) + +* Tue Mar 23 2010 Jaroslav Škarvada - 2.6-1 +- New version: grep-2.6 +- Added sigsegv patch (after release patch from upstream) +- Dropped obsoleted patches: fedora-tests, pcrewrap, case, egf-speedup, + bz460641, utf8, dfa-optional, w + +* Fri Mar 05 2010 Jaroslav Škarvada - 2.5.4-2 +- Added w patch to fix -w switch behaviour broken by dfa-optional patch + +* Wed Feb 10 2010 Jaroslav Škarvada - 2.5.4-1 +- New version: grep-2.5.4 +- Fixed typos in description +- Updated utf-8 patch +- Added dfa-optional patch (#538423) + +* Tue Aug 11 2009 Lubomir Rintel 2.5.3-6 +- Silence possible scriptlets errors + +* Fri Jul 24 2009 Fedora Release Engineering - 2.5.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Feb 24 2009 Fedora Release Engineering - 2.5.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jan 27 2009 Stepan Kasal 2.5.3-3 +- remove grep-mem-exhausted.patch (#481765, #198165) + +* Thu Jan 8 2009 Stepan Kasal 2.5.3-2 +- fix bug #460641 (a.k.a. 479152) + +* Thu Nov 20 2008 Lubomir Rintel 2.5.3-1 +- Update to latest upstream version +- Drop upstreamed patches +- Add a couple of regression tests +- Temporarily disable tests +- Minor cleanup + +* Wed Oct 1 2008 Lubomir Rintel 2.5.1a-61 +- Fix pcre-mode (-P) line wrapping (bug #324781) +- Match the version with upstream +- Recode AUTHORS to utf8 + +* Fri Jul 25 2008 Tom "spot" Callaway - 2.5.1-60 +- fix license tag + +* Tue Feb 19 2008 Fedora Release Engineering - 2.5.1-59 +- Autorebuild for GCC 4.3 + +* Fri Apr 20 2007 Stepan Kasal - 2.5.1-58 +- Adhere to packaging guidelines. +- Resolves: #225857 +- Use CPPFLAGS= argument to configure to add an -I option. +- Do not set LDFLAGS=-s for "make install". + +* Mon Jan 22 2007 Tim Waugh 2.5.1-57 +- Make preun scriptlet unconditionally succeed (bug #223697). + +* Wed Nov 22 2006 Tim Waugh 2.5.1-56 +- Fixed count of patterns when the last is an empty string (bug #204255). + +* Wed Nov 22 2006 Tim Waugh 2.5.1-55 +- Fix 'memory exhausted' errors by limiting in-memory buffer (bug #198165). + +* Wed Jul 12 2006 Jesse Keating - 2.5.1-54.1 +- rebuild + +* Wed May 31 2006 Tim Waugh 2.5.1-54 +- Applied upstream patch to fix '-D skip' (bug #189580). + +* Mon Feb 20 2006 Tim Waugh 2.5.1-53 +- Applied Tim Robbins' patch for 'grep -w' (bug #179698). + +* Fri Feb 10 2006 Jesse Keating - 2.5.1-52.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.5.1-52.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Feb 3 2006 Tim Waugh 2.5.1-52 +- Prevent 'grep -P' from segfaulting (bug #171379). + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Sep 29 2005 Tim Waugh 2.5.1-51 +- Prevent 'grep -Fw ""' from busy-looping (bug #169524). + +* Tue Jun 28 2005 Tim Waugh 2.5.1-50 +- Further fixing for bug #161700. + +* Mon Jun 27 2005 Tim Waugh 2.5.1-49 +- Fix 'grep -Fw' for encodings other than UTF-8 (bug #161700). + +* Wed Apr 13 2005 Tim Waugh +- Build requires recent pcre-devel (bug #154626). + +* Wed Mar 2 2005 Tim Waugh 2.5.1-48 +- Rebuild for new GCC. + +* Fri Jan 7 2005 Tim Waugh 2.5.1-47 +- Run 'make check'. +- Fixed -w handling for EGexecute. Now 'make check' passes. +- Cache MB_CUR_MAX value in egf-speedup patch. +- Fixed variable shadowing in egf-speedup patch. +- Removed redundant (and incorrect) code in prline. + +* Fri Jan 7 2005 Tim Waugh 2.5.1-46 +- More -w tests from Jakub Jelinek. +- Rebased on 2.5.1a. + +* Fri Dec 31 2004 Tim Waugh 2.5.1-45 +- More tests (Jakub Jelinek). +- Jakub Jelinek's much improved -Fi algorithm. +- Removed bogus part of grep-2.5.1-fgrep patch. + +* Tue Dec 21 2004 Tim Waugh 2.5.1-44 +- Fixed -Fi for multibyte input (bug #143079). + +* Thu Dec 16 2004 Tim Waugh 2.5.1-43 +- Bypass kwset matching when ignoring case and processing multibyte input + (bug #143079). + +* Tue Dec 14 2004 Tim Waugh 2.5.1-42 +- Further UTF-8 processing avoided since a '\n' byte is always an + end-of-line character in that encoding. + +* Fri Dec 3 2004 Tim Waugh 2.5.1-41 +- Fixed a busy loop in the egf-speedup patch (bug #140781). + +* Thu Nov 18 2004 Tim Waugh 2.5.1-40 +- Fixed a bug in the fgrep patch, exposed by the dfa-optional patch + (bug #138558). + +* Tue Nov 16 2004 Tim Waugh 2.5.1-39 +- Fixed last patch. + +* Tue Nov 16 2004 Tim Waugh 2.5.1-38 +- Applied patch from Karsten Hopp to fix background colour problems with + --color output (bug #138913). + +* Wed Nov 10 2004 Tim Waugh 2.5.1-37 +- Prevent false matches when DFA is disabled (bug #138558). + +* Mon Nov 8 2004 Tim Waugh 2.5.1-36 +- Automatically disable DFA when processing multibyte input. GREP_USE_DFA + environment variable overrides. + +* Fri Nov 5 2004 Tim Waugh 2.5.1-35 +- Fixes to egf-speedup patch: now it does not change any functionality, + as intended. +- GREP_NO_DFA now turns off the DFA engine, for performance testing. + +* Thu Nov 4 2004 Tim Waugh 2.5.1-34 +- More improvements to egf-speedup patch (bug #138076). + +* Thu Nov 4 2004 Tim Waugh 2.5.1-33 +- Small improvements to egf-speedup patch. + +* Wed Nov 3 2004 Tim Waugh 2.5.1-32 +- Remove mb-caching hack. +- Better multibyte handling in EGexecute() and Fexecute(). +- Don't need regex.c changes in grep-2.5-i18n.patch. + +* Wed Oct 13 2004 Tim Waugh 2.5.1-31 +- Make 'grep -F' avoid UTF-8 processing if the pattern contains no + multibyte characters (bug #133932). + +* Mon Oct 11 2004 Tim Waugh 2.5.1-30 +- Applied patch from Robert Scheck to tidy spec file and add a URL + tag (bug #135185). + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Jun 4 2004 Tim Waugh +- More build requirements (bug #125323). + +* Tue May 18 2004 Jeremy Katz 2.5.1-28 +- rebuild + +* Tue May 18 2004 Tim Waugh 2.5.1-27 +- Fix dfa multibyte character class matching when -i is used (bug #123363). +- Use bracket patch before i18n patch to make it clear that the bug exists + upstream. + +* Thu Feb 26 2004 Tim Waugh 2.5.1-26 +- Fix fgrep (bug #116909). + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Mon Jan 5 2004 Tim Waugh 2.5.1-24 +- Work around glibc bug #112869 (segfault in re_compile_pattern). +- Avoid patching Makefile.am, to avoid automake/autoconf weirdness. + +* Wed Dec 10 2003 Tim Waugh 2.5.1-23 +- Another multibyte efficiency bug-fix (bug #111800). + +* Mon Dec 8 2003 Tim Waugh 2.5.1-22 +- Fixed [:alpha:]-type character classes (bug #108484). +- Fixed -o -i properly (bug #111489). + +* Sat Dec 6 2003 Tim Waugh 2.5.1-21 +- Fixed 'fgrep -i' (bug #111614). + +* Fri Nov 21 2003 Tim Waugh 2.5.1-20 +- Another two multibyte efficiency bug-fixes (bug #110524). + +* Thu Nov 6 2003 Tim Waugh 2.5.1-19 +- Fixed a multibyte efficiency bug. + +* Thu Nov 6 2003 Tim Waugh 2.5.1-18 +- Turn on multibyte efficiency patch again to shake out bugs. + +* Wed Oct 8 2003 Tim Waugh +- Fixed man page bug (bug #106267). + +* Thu Sep 18 2003 Tim Waugh 2.5.1-17 +- Use symlinks for egrep/fgrep, rather than shell script wrappers. + +* Fri Jun 27 2003 Tim Waugh +- Fix debuginfo package. + +* Fri Jun 27 2003 Tim Waugh 2.5.1-16.1 +- Rebuilt. + +* Fri Jun 27 2003 Tim Waugh 2.5.1-16 +- Finally give up on making grep go fast. :-( + +* Thu Jun 26 2003 Tim Waugh 2.5.1-15.1 +- Rebuilt. + +* Thu Jun 26 2003 Tim Waugh 2.5.1-15 +- Fixed grep -i bug introduced by cache. + +* Mon Jun 23 2003 Tim Waugh 2.5.1-14.1 +- Rebuilt. + +* Mon Jun 23 2003 Tim Waugh 2.5.1-14 +- Redo the gofast patch (bug #97785). + +* Thu Jun 12 2003 Tim Waugh 2.5.1-13.1 +- Rebuilt. + +* Thu Jun 12 2003 Tim Waugh 2.5.1-13 +- Fixed a bug in the gofast patch (bug #97266). + +* Tue Jun 10 2003 Tim Waugh 2.5.1-12.1 +- Rebuilt. + +* Tue Jun 10 2003 Tim Waugh 2.5.1-12 +- Go faster (bug #69900). +- Fix man page. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Thu May 29 2003 Tim Waugh 2.5.1-10.1 +- Rebuilt. + +* Thu May 29 2003 Tim Waugh 2.5.1-10 +- Use system regex again. + +* Thu May 29 2003 Tim Waugh 2.5.1-9 +- Fixed bug in go-fast patch. + +* Wed May 28 2003 Tim Waugh 2.5.1-8 +- Go fast (bug #69900). +- Run test suite. + +* Wed Jan 22 2003 Tim Powers 2.5.1-7 +- rebuilt + +* Tue Nov 19 2002 Tim Waugh 2.5.1-6 +- i18n patch. + +* Mon Oct 21 2002 Tim Waugh 2.5.1-5 +- Don't install /usr/share/info/dir. +- Fix -o -i (bug #72641). + +* Sat Jul 20 2002 Florian La Roche +- install all info files #69204 + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Tue Mar 26 2002 Bernhard Rosenkraenzer 2.5.1-1 +- 2.5.1 + +* Wed Mar 13 2002 Bernhard Rosenkraenzer 2.5-1 +- 2.5 final + +* Wed Jan 23 2002 Bernhard Rosenkraenzer 2.5-0.g.1 +- 2.5g + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Mon Nov 19 2001 Bernhard Rosenkraenzer 2.5-0.f.4 +- Update CVS to reduce bloat + +* Thu Nov 8 2001 Bernhard Rosenkraenzer 2.5-0.f.3 +- Don't fail %%post with --excludedocs + +* Wed Sep 26 2001 Bernhard Rosenkraenzer 2.5-0.f.2 +- Fix up echo A |grep '[A-Z0-9]' in locales other than C + +* Tue Sep 25 2001 Bernhard Rosenkraenzer 2.5-0.f.1 +- 2.5f, fixes #53603 + +* Wed Jul 18 2001 Bernhard Rosenkraenzer 2.4.2-7 +- Fix up the i18n patch - it used to break "grep '[]a]'" (#49003) +- revert to 2.4.2 (latest official release) for now + +* Mon May 28 2001 Bernhard Rosenkraenzer 2.5e-4 +- Fix "echo Linux forever |grep -D skip Linux" + +* Mon May 21 2001 Bernhard Rosenkraenzer 2.5e-3 +- Add new -D, --devices option +- Fix a bug with "directories" being uninitialized + +* Sun May 13 2001 Bernhard Rosenkraenzer 2.5e-2 +- Fix up the --color option to behave like the one from ls (--color=auto) + Sooner or later, some people will alias grep="grep --color" and wonder why + their scripts break. +- Update docs accordingly +- Get rid of the annoying blinking in grep --color + +* Sun May 13 2001 Bernhard Rosenkraenzer 2.5e-1 +- 2.5e + +* Tue Feb 27 2001 Trond Eivind Glomsrød +- use %%{_tmppath} +- langify + +* Sun Aug 20 2000 Jakub Jelinek +- i18n character ranges patch from Ulrich Drepper + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Mon Jun 19 2000 Bernhard Rosenkraenzer +- FHSify + +* Tue Mar 21 2000 Florian La Roche +- update to 2.4.2 +- fix download URL + +* Thu Feb 03 2000 Bernhard Rosenkraenzer +- gzip info pages (Bug #9035) + +* Wed Feb 02 2000 Cristian Gafton +- fix description + +* Wed Dec 22 1999 Jeff Johnson +- update to 2.4. + +* Wed Oct 20 1999 Bill Nottingham +- prereq install-info + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 2) + +* Mon Mar 08 1999 Preston Brown +- upgraded to grep 2.3, added install-info %%post/%%preun for info + +* Wed Feb 24 1999 Preston Brown +- Injected new description and group. + +* Sat May 09 1998 Prospector System +- translations modified for de, fr, tr + +* Fri May 01 1998 Cristian Gafton +- updated to 2.2 + +* Thu Oct 16 1997 Donnie Barnes +- updated from 2.0 to 2.1 +- spec file cleanups +- added BuildRoot + +* Mon Jun 02 1997 Erik Troan +- built against glibc