diff --git a/0001-Revert-L-exit-status-change-introduced-in-grep-3.2.patch b/0001-Revert-L-exit-status-change-introduced-in-grep-3.2.patch deleted file mode 100644 index 8bfeaa4..0000000 --- a/0001-Revert-L-exit-status-change-introduced-in-grep-3.2.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 0435ebca64fbafcd62008c991dd9377d8a792dfc Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Sat, 22 Aug 2020 14:06:26 -0700 -Subject: [PATCH] Revert -L exit status change introduced in grep 3.2 - -Problems reported by Antonio Diaz Diaz in: -https://bugs.gnu.org/28105#29 -* NEWS, doc/grep.texi (Exit Status), src/grep.c (usage): -Adjust documentation accordingly. -* src/grep.c (grepdesc, main): Go back to old behavior. -* tests/skip-read: Adjust tests accordingly. ---- - doc/grep.texi | 3 --- - src/grep.c | 10 +++++----- - tests/skip-read | 4 ++-- - 4 files changed, 7 insertions(+), 10 deletions(-) - -diff --git a/doc/grep.texi b/doc/grep.texi -index 4b26f9d..02b1968 100644 ---- a/doc/grep.texi -+++ b/doc/grep.texi -@@ -1112,9 +1112,6 @@ and only when @env{POSIXLY_CORRECT} is not set. - - Normally the exit status is 0 if a line is selected, 1 if no lines - were selected, and 2 if an error occurred. However, if the --@option{-L} or @option{--files-without-match} is used, the exit status --is 0 if a file is listed, 1 if no files were listed, and 2 if an error --occurred. Also, if the - @option{-q} or @option{--quiet} or @option{--silent} option is used - and a line is selected, the exit status is 0 even if an error - occurred. Other @command{grep} implementations may exit with status -diff --git a/src/grep.c b/src/grep.c -index 7ba602d..5764b2a 100644 ---- a/src/grep.c -+++ b/src/grep.c -@@ -1864,11 +1864,11 @@ grepdesc (int desc, bool command_line) - fflush_errno (); - } - -- status = !count == !(list_files == LISTFILES_NONMATCHING); -+ status = !count; - -- if (list_files == LISTFILES_NONE || dev_null_output) -+ if (list_files == LISTFILES_NONE) - finalize_input (desc, &st, ineof); -- else if (status == 0) -+ else if (list_files == (status ? LISTFILES_NONMATCHING : LISTFILES_MATCHING)) - { - print_filename (); - putchar_errno ('\n' & filename_mask); -@@ -1997,7 +1997,7 @@ Context control:\n\ - printf (_("\ - When FILE is '-', read standard input. With no FILE, read '.' if\n\ - recursive, '-' otherwise. With fewer than two FILEs, assume -h.\n\ --Exit status is 0 if any line (or file if -L) is selected, 1 otherwise;\n\ -+Exit status is 0 if any line is selected, 1 otherwise;\n\ - if any error occurs and -q is not given, the exit status is 2.\n")); - emit_bug_reporting_address (); - } -@@ -2835,7 +2835,7 @@ main (int argc, char **argv) - - /* POSIX says -c, -l and -q are mutually exclusive. In this - implementation, -q overrides -l and -L, which in turn override -c. */ -- if (exit_on_match) -+ if (exit_on_match | dev_null_output) - list_files = LISTFILES_NONE; - if ((exit_on_match | dev_null_output) || list_files != LISTFILES_NONE) - { -diff --git a/tests/skip-read b/tests/skip-read -index 2a17334..1e9e718 100755 ---- a/tests/skip-read -+++ b/tests/skip-read -@@ -15,9 +15,9 @@ for opts in '-m0 y' '-f /dev/null' '-v ""'; do - eval returns_ 1 grep -l $opts $matcher /dev/null > out || fail=1 - compare /dev/null out || fail=1 - done -- eval grep -L $opts $matcher /dev/null > out || fail=1 -+ eval returns_ 1 grep -L $opts $matcher /dev/null > out || fail=1 - compare exp out || fail=1 -- eval grep -L $opts $matcher /dev/null > /dev/null || fail=1 -+ eval returns_ 1 grep -L $opts $matcher /dev/null > /dev/null || fail=1 - done - done - --- -2.28.0 - diff --git a/0001-perror-strerror_r-remove-unportable-tests.patch b/0001-perror-strerror_r-remove-unportable-tests.patch deleted file mode 100644 index 1b7aa42..0000000 --- a/0001-perror-strerror_r-remove-unportable-tests.patch +++ /dev/null @@ -1,45 +0,0 @@ ->From 175e0bc72808d564074c4adcc72aeadb74adfcc6 Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Thu, 27 Aug 2020 17:52:58 -0700 -Subject: [PATCH] perror, strerror_r: remove unportable tests - -Problem reported by Florian Weimer in: -https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html -* tests/test-perror2.c (main): -* tests/test-strerror_r.c (main): Omit unportable tests. ---- - gnulib-tests/test-perror2.c | 3 --- - gnulib-tests/test-strerror_r.c | 3 --- - 2 files changed, 6 deletions(-) - -diff --git a/gnulib-tests/test-perror2.c b/gnulib-tests/test-perror2.c -index 1d14eda7b..c6214dd25 100644 ---- a/gnulib-tests/test-perror2.c -+++ b/gnulib-tests/test-perror2.c -@@ -79,9 +79,6 @@ main (void) - errno = -5; - perror (""); - ASSERT (!ferror (stderr)); -- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); -- ASSERT (msg2 == msg4 || STREQ (msg2, str2)); -- ASSERT (msg3 == msg4 || STREQ (msg3, str3)); - ASSERT (STREQ (msg4, str4)); - - free (str1); -diff --git a/gnulib-tests/test-strerror_r.c b/gnulib-tests/test-strerror_r.c -index b11d6fd9f..c1dbcf837 100644 ---- a/gnulib-tests/test-strerror_r.c -+++ b/gnulib-tests/test-strerror_r.c -@@ -165,9 +165,6 @@ main (void) - - strerror_r (EACCES, buf, sizeof buf); - strerror_r (-5, buf, sizeof buf); -- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); -- ASSERT (msg2 == msg4 || STREQ (msg2, str2)); -- ASSERT (msg3 == msg4 || STREQ (msg3, str3)); - ASSERT (STREQ (msg4, str4)); - - free (str1); --- -2.17.1 - diff --git a/grep-3.4-help-align.patch b/grep-3.4-help-align.patch deleted file mode 100644 index ca8e0f0..0000000 --- a/grep-3.4-help-align.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/grep.c b/src/grep.c -index 9c0532d..caeece1 100644 ---- a/src/grep.c -+++ b/src/grep.c -@@ -1965,7 +1965,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)" -@@ -1975,7 +1976,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/grep-3.4-man-fix-gs.patch b/grep-3.4-man-fix-gs.patch deleted file mode 100644 index c229c27..0000000 --- a/grep-3.4-man-fix-gs.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 7ba602d..9c0532d 100644 ---- a/src/grep.c -+++ b/src/grep.c -@@ -1989,6 +1989,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/grep-3.5-help-align.patch b/grep-3.5-help-align.patch new file mode 100644 index 0000000..a2268b9 --- /dev/null +++ b/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/grep-3.5-man-fix-gs.patch b/grep-3.5-man-fix-gs.patch new file mode 100644 index 0000000..425aae9 --- /dev/null +++ b/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/grep.spec b/grep.spec index 0298049..dafca6e 100644 --- a/grep.spec +++ b/grep.spec @@ -1,7 +1,7 @@ Summary: Pattern matching utilities Name: grep -Version: 3.4 -Release: 5%{?dist} +Version: 3.5 +Release: 1%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/grep/ @@ -11,16 +11,9 @@ Source2: colorgrep.csh Source3: GREP_COLORS Source4: grepconf.sh # upstream ticket 39444 -Patch0: grep-3.4-man-fix-gs.patch +Patch0: grep-3.5-man-fix-gs.patch # upstream ticket 39445 -Patch1: grep-3.4-help-align.patch -# upstream ticket 28105 -Patch2: 0001-Revert-L-exit-status-change-introduced-in-grep-3.2.patch -# https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00220.html -# https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00225.html -# removes some tests that fail on armv7hl, by Paul Eggert -# re-diffed to apply to 3.4 -Patch3: 0001-perror-strerror_r-remove-unportable-tests.patch +Patch1: grep-3.5-help-align.patch BuildRequires: gcc BuildRequires: pcre-devel >= 3.9-10, texinfo, gettext @@ -44,8 +37,6 @@ GNU grep is needed by many scripts, so it shall be installed on every system. %setup -q %patch0 -p1 -b .man-fix-gs %patch1 -p1 -b .help-align -%patch2 -p1 -b .zgrep-fix -%patch3 -p1 -b .remove-broken-tests %build %global BUILD_FLAGS $RPM_OPT_FLAGS @@ -88,6 +79,10 @@ make check %{_libexecdir}/grepconf.sh %changelog +* 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 diff --git a/sources b/sources index 21737e4..5726d9d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (grep-3.4.tar.xz) = 0f1506bd19971fbdcb47a111277ca63e8ad045456f096980852fd0a61c860f29f4b369bbaaa5cbce4b0a81718e3e3274d9a078b491f2109baa9a02ce600ee206 +SHA512 (grep-3.5.tar.xz) = 8367aa930ecf7fa5c07153666bf7991097648bd7bf4ca672e6b14e0bb806c89991ec55d2880812877761cbde1d33562f22803835d74bfcd293c2246e274306c4