backport two patches

(cherry picked from commit 34b8091eaf4a40ec882a32043589232a5e1b5a14)
This commit is contained in:
guojunding 2024-08-26 15:29:55 +08:00 committed by openeuler-sync-bot
parent 1a3b683cf3
commit f642eeecd8
3 changed files with 103 additions and 2 deletions

View File

@ -0,0 +1,42 @@
From eda769be72def8a14098af968e04cc6952fc53a3 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Mon, 8 Jul 2024 14:06:16 +0200
Subject: tests: Fix recognition of cs_CZ.UTF-8 locale on FreeBSD.
* tests/fmbtest: Use 'locale charmap' to determine the locale's encoding.
* tests/foad1: Likewise.
---
tests/fmbtest | 2 +-
tests/foad1 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/fmbtest b/tests/fmbtest
index e64b6ba..ddc25d9 100644
--- a/tests/fmbtest
+++ b/tests/fmbtest
@@ -10,7 +10,7 @@
cz=cs_CZ.UTF-8
# If cs_CZ.UTF-8 locale doesn't work, skip this test.
-LC_ALL=$cz locale -k LC_CTYPE 2>/dev/null | grep -q charmap.*UTF-8 \
+test "`LC_ALL=$cz locale charmap 2>/dev/null`" = UTF-8 \
|| skip_ this system lacks the $cz locale
# If matching is done in single-byte mode, skip this test too
diff --git a/tests/foad1 b/tests/foad1
index f10c1d7..3e87656 100644
--- a/tests/foad1
+++ b/tests/foad1
@@ -150,7 +150,7 @@ Exit $failures
# The rest of this file is meant to be executed under this locale.
LC_ALL=cs_CZ.UTF-8; export LC_ALL
# If the UTF-8 locale doesn't work, skip these tests silently.
-locale -k LC_CTYPE 2>/dev/null | grep -q "charmap.*UTF-8" || Exit $failures
+test "`locale charmap 2>/dev/null`" = UTF-8 || Exit $failures
# Test character class erroneously matching a '[' character.
grep_test "[/" "" "[[:alpha:]]" -E
--
2.9.3.windows.1

View File

@ -0,0 +1,53 @@
From 53b889155f5ee53404a9873f48300fe5b50321d9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 21 May 2024 09:50:43 -0700
Subject: doc: fix troff typos
* doc/grep.in.1: Fix troff typos found by mandoc and groff.
Problem reported by Bjarni Ingi Gislason (bug#71087).
---
doc/grep.in.1 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 236791e..eb6a5d9 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -23,6 +23,7 @@
. \}
.\}
.
+.as la
.if !\w|\*(la| \{\
.\" groff an-ext.tmac does not seem to be in use, so define the parts of
.\" it that are used below. For a copy of groff an-ext.tmac, please see:
@@ -245,7 +246,7 @@ If this option is used multiple times or is combined with the
option, search for all patterns given.
The empty file contains zero patterns, and therefore matches nothing.
If
-.IR FILE
+.I FILE
is
.B \-
, read patterns from standard input.
@@ -674,7 +675,7 @@ whose base name matches
Ignore any redundant trailing slashes in
.IR GLOB .
.TP
-.BR \-I
+.B \-I
Process a binary file as if it did not contain matching data; this is
equivalent to the
.B \-\^\-binary\-files=without\-match
@@ -749,7 +750,7 @@ Like the
or
.B \-\^\-null
option, this option can be used with commands like
-.B sort -z
+.B "sort \-z"
to process arbitrary file names.
.
.SH "REGULAR EXPRESSIONS"
--
2.9.3.windows.1

View File

@ -1,8 +1,8 @@
Name: grep Name: grep
Version: 3.11 Version: 3.11
Release: 3 Release: 4
Summary: A string search utility Summary: A string search utility
License: GPL-3.0-or-later AND LGPL-3.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.3-no-invariants-or-later License: GPLv3+
URL: https://www.gnu.org/software/grep URL: https://www.gnu.org/software/grep
Source0: https://ftp.gnu.org/gnu/grep/grep-%{version}.tar.xz Source0: https://ftp.gnu.org/gnu/grep/grep-%{version}.tar.xz
Source1: color_grep.sh Source1: color_grep.sh
@ -10,6 +10,8 @@ Source2: colorgrep.csh
Source3: grepconf.sh Source3: grepconf.sh
Patch0001: fix-grep-m2-pattern.patch Patch0001: fix-grep-m2-pattern.patch
Patch0002: backport-Fix-troff-typos-found-by-mandoc-and-groff.patch
Patch0003: backport-Fix-recognition-of-cs_CZ.UTF-8-locale-on-FreeBSD.patch
BuildRequires: gcc pcre2-devel texinfo gettext automake BuildRequires: gcc pcre2-devel texinfo gettext automake
Provides: /bin/egrep /bin/fgrep /bin/grep bundled(gnulib) Provides: /bin/egrep /bin/fgrep /bin/grep bundled(gnulib)
@ -50,6 +52,10 @@ install -Dpm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/grepconf.sh
%{_mandir}/man1/*grep.1* %{_mandir}/man1/*grep.1*
%changelog %changelog
* Mon Aug 26 2024 guojunding <guojunding@kylinos.cn> - 3.11-4
- fix troff typos
- fix recognition of cs_CZ.UTF-8 locale on FreeBSD
* Tue Jul 30 2024 Funda Wang <fundawang@yeah.net> - 3.11-3 * Tue Jul 30 2024 Funda Wang <fundawang@yeah.net> - 3.11-3
- fix lang file declaration - fix lang file declaration