[gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/, sys-apps/grep/files/

2024-04-28 Thread Sam James
commit: bad1434434e66744b2c660546374f8574ed9d8a0
Author: Sam James  gentoo  org>
AuthorDate: Sun Apr 28 23:04:03 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr 28 23:05:49 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bad14344

sys-apps/grep: fix operation on large directories

While I did backport the test itself, it's not run by default as
it's marked as expensive. We may want to run those in future though.

Closes: https://bugs.gentoo.org/930825
Signed-off-by: Sam James  gentoo.org>

 sys-apps/grep/files/grep-3.11-100k-files-dir.patch | 143 +
 sys-apps/grep/grep-3.11-r1.ebuild  | 122 ++
 2 files changed, 265 insertions(+)

diff --git a/sys-apps/grep/files/grep-3.11-100k-files-dir.patch 
b/sys-apps/grep/files/grep-3.11-100k-files-dir.patch
new file mode 100644
index ..2862fef02efd
--- /dev/null
+++ b/sys-apps/grep/files/grep-3.11-100k-files-dir.patch
@@ -0,0 +1,143 @@
+https://bugs.gentoo.org/930825
+https://debbugs.gnu.org/64773
+https://bugs.debian.org/1041588
+https://bugs.debian.org/1041588#105
+
+We backport the following:
+* the fix 
(https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=d4d8abb39eb02c555f062b1f83ffcfac999c582f)
+* a test 
(https://git.savannah.gnu.org/cgit/grep.git/commit/?id=d1c3fbe7722662b449bae23130b644c726473fe3)
+* a fixup commit for the test 
(https://git.savannah.gnu.org/cgit/grep.git/commit/?id=180e8dd674ede48727c03647dd36c1f8c3379667)
+
+From d4d8abb39eb02c555f062b1f83ffcfac999c582f Mon Sep 17 00:00:00 2001
+From: Bruno Haible 
+Date: Fri, 5 May 2023 12:02:49 +0200
+Subject: [PATCH] dirfd: Fix bogus override (regression 2023-04-26).
+
+Reported by Bjarni Ingi Gislason  in
+.
+
+* m4/dirfd.m4 (gl_FUNC_DIRFD): Fix mistake in last change.
+--- a/m4/dirfd.m4
 b/m4/dirfd.m4
+@@ -1,4 +1,4 @@
+-# serial 27   -*- Autoconf -*-
++# serial 28   -*- Autoconf -*-
+ 
+ dnl Find out how to get the file descriptor associated with an open DIR*.
+ 
+@@ -40,10 +40,6 @@ AC_DEFUN([gl_FUNC_DIRFD],
+ HAVE_DIRFD=0
+   else
+ HAVE_DIRFD=1
+-dnl Replace only if the system declares dirfd already.
+-if test $ac_cv_have_decl_dirfd = yes; then
+-  REPLACE_DIRFD=1
+-fi
+ dnl Replace dirfd() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
+--- a/configure
 b/configure
+@@ -31438,9 +31438,6 @@ printf "%s\n" "$gl_cv_func_dirfd_macro" >&6; }
+ HAVE_DIRFD=0
+   else
+ HAVE_DIRFD=1
+-if test $ac_cv_have_decl_dirfd = yes; then
+-  REPLACE_DIRFD=1
+-fi
+ 
+ if test $DIR_HAS_FD_MEMBER = 0; then
+   REPLACE_DIRFD=1
+From d1c3fbe7722662b449bae23130b644c726473fe3 Mon Sep 17 00:00:00 2001
+From: Jim Meyering 
+Date: Fri, 21 Jul 2023 17:42:23 -0700
+Subject: doc: mention the 100,000-entry ENOTSUP bug
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* NEWS: document the fixed bug.
+* tests/100k-entries: New file, to test for this.
+Reported by Vincent Lefevre via Santiago Ruano Rincón in
+https://bugs.gnu.org/64773
+Fixed by gnulib commit v0.1-6175-gd4d8abb39e.
+---
+ tests/100k-entries | 15 +++
+ 2 files changed, 24 insertions(+)
+ create mode 100755 tests/100k-entries
+
+diff --git a/tests/100k-entries b/tests/100k-entries
+new file mode 100755
+index 000..382ab3c
+--- /dev/null
 b/tests/100k-entries
+@@ -0,0 +1,15 @@
++#!/bin/sh
++# This would make grep-3.11 fail with ENOTSUP and exit 2.
++. "${srcdir=.}/init.sh"; path_prepend_ ../src
++expensive_
++
++fail=0
++
++mkdir t || framework_failure_
++(cd t && seq 10|xargs touch) || framework_failure_
++
++returns_ 1 grep -r x t > out 2> err
++compare /dev/null out || fail=1
++compare /dev/null err || fail=1
++
++Exit $fail
+-- 
+cgit v1.1
+
+From 180e8dd674ede48727c03647dd36c1f8c3379667 Mon Sep 17 00:00:00 2001
+From: Jim Meyering 
+Date: Sun, 20 Aug 2023 12:42:14 -0700
+Subject: tests: actually package and run the new 100k-entries test
+
+* tests/Makefile.am (TESTS): Include the new test file name,
+100k-entries.
+---
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index d566445..94430a9 100644
+--- a/tests/Makefile.am
 b/tests/Makefile.am
+@@ -71,6 +71,7 @@ else
+ endif
+ 
+ TESTS =   \
++  100k-entries\
+   backref \
+   backref-alt \
+   backref-multibyte-slow  \
+-- 
+cgit v1.1
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 8ae7bb4..0007f8d 100644
+--- a/tests/Makefile.in
 b/tests/Makefile.in
+@@ -1953,6 +1953,7 @@ XFAIL_TESTS = triple-backref glibc-infloop 
$(am__append_1)
+ # If you're using older glibc you can 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/, sys-apps/grep/files/

2021-11-16 Thread Georgy Yakovlev
commit: e4bc420f6f7ad5d52e43f2ae7541a991f516949e
Author: Georgy Yakovlev  gentoo  org>
AuthorDate: Wed Nov 17 02:30:26 2021 +
Commit: Georgy Yakovlev  gentoo  org>
CommitDate: Wed Nov 17 02:39:07 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4bc420f

sys-apps/grep: add ppc32 musl patch

Signed-off-by: Georgy Yakovlev  gentoo.org>

 sys-apps/grep/files/ppc-musl.patch | 14 ++
 sys-apps/grep/grep-3.7.ebuild  |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/sys-apps/grep/files/ppc-musl.patch 
b/sys-apps/grep/files/ppc-musl.patch
new file mode 100644
index ..6ba37f233591
--- /dev/null
+++ b/sys-apps/grep/files/ppc-musl.patch
@@ -0,0 +1,14 @@
+--- a/lib/sigsegv.c
 b/lib/sigsegv.c
+@@ -221,8 +221,10 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
+ /* both should be equivalent */
+ #   if 0
+ #define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) 
ucp)->uc_mcontext.regs->gpr[1]
+-#   else
++#   elif defined(__GLIBC__)
+ #define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) 
ucp)->uc_mcontext.uc_regs->gregs[1]
++#   else
++#define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) 
ucp)->uc_mcontext.gregs[1]
+ #   endif
+ #  endif
+ 

diff --git a/sys-apps/grep/grep-3.7.ebuild b/sys-apps/grep/grep-3.7.ebuild
index 7b142e4d63d8..2a4b293b29e0 100644
--- a/sys-apps/grep/grep-3.7.ebuild
+++ b/sys-apps/grep/grep-3.7.ebuild
@@ -29,6 +29,8 @@ BDEPEND="
nls? ( sys-devel/gettext )
 "
 
+PATCHES=( "${FILESDIR}/ppc-musl.patch" )
+
 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
 
 src_prepare() {



[gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/, sys-apps/grep/files/

2018-09-28 Thread Mikle Kolyada
commit: 7a182b78abf97a3b936aff9fb4facf13b7ed8b4e
Author: Mikle Kolyada  gentoo  org>
AuthorDate: Fri Sep 28 14:26:11 2018 +
Commit: Mikle Kolyada  gentoo  org>
CommitDate: Fri Sep 28 14:26:11 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a182b78

sys-apps/grep: Drop old

Package-Manager: Portage-2.3.49, Repoman-2.3.10

 sys-apps/grep/Manifest |  1 -
 sys-apps/grep/files/grep-2.27-splice.patch | 60 --
 sys-apps/grep/grep-2.27-r1.ebuild  | 46 ---
 3 files changed, 107 deletions(-)

diff --git a/sys-apps/grep/Manifest b/sys-apps/grep/Manifest
index a90650adb75..d9491ea9585 100644
--- a/sys-apps/grep/Manifest
+++ b/sys-apps/grep/Manifest
@@ -1,3 +1,2 @@
-DIST grep-2.27.tar.xz 1360388 BLAKE2B 
ed750fa7a6aea389c8f096acc9ac9cdebc9561c4b0cedfd5415ef033dd90076d5b9a42fa97c97207474b250ac0c4e4ed3c2ff216fe4462ac80baa6e47a2b90eb
 SHA512 
d67f16cc5f931a455d5287badbaf080967da573d290430f440e578a563cff4f4c0c2668f60dbb8bc71eaed289f075957006c10c6827f0da1a49df49efd3f0781
 DIST grep-3.0.tar.xz 1375156 BLAKE2B 
19f5441ed3fe5bb16d9d8327e76f0beb7eb837b727f6da99844dc9c74eb4def9eab857059c527e651758fa224a6f4079ec5939806645806f2db341ed0cb727e4
 SHA512 
0e9a00df9d492f399230bae0264942edaf64bb926f93edb7922f27b075a86ba0a78698f54996cc522b6261aa01a8ecbeadeb68523d4470a9941f242c3ae24c58
 DIST grep-3.1.tar.xz 1370880 BLAKE2B 
d71a09d8bfd2c15b6d393d3ca4e22a2b2724632034a6d35d6e269a3c639d76ecaa5ae989a3d8466ee4bcf45e5d08862b0ef19194d6ec7ac6c250e6f60fc61031
 SHA512 
05494381c7dd8aad7e2ee4c17450de8d7b969a99dcfe17747db60df3475bf02d5323d091e896e8343e4f3251c29dc7f0b7a9f93c575c9d58ee2a57014c2c9d26

diff --git a/sys-apps/grep/files/grep-2.27-splice.patch 
b/sys-apps/grep/files/grep-2.27-splice.patch
deleted file mode 100644
index 6c36fe07fd2..000
--- a/sys-apps/grep/files/grep-2.27-splice.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-http://lists.gnu.org/archive/html/bug-grep/2016-12/msg00036.html
-
-From 7ad47abbcb070946000771a829b51224720b8cef Mon Sep 17 00:00:00 2001
-From: Paul Eggert 
-Date: Tue, 27 Dec 2016 11:16:32 -0800
-Subject: [PATCH] grep: fix bug with '... | grep pat >> /dev/null'
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Problem reported by Benno Fünfstück (Bug#25283).
-* NEWS: Document this.
-* src/grep.c (drain_input) [SPLICE_F_MOVE]:
-Don't assume /dev/null is always acceptable output to splice.
-* tests/grep-dev-null-out: Test for the bug.

- NEWS|  7 ---
- src/grep.c  | 14 +-
- tests/grep-dev-null-out |  2 ++
- 3 files changed, 15 insertions(+), 8 deletions(-)
-
-diff --git a/src/grep.c b/src/grep.c
-index f28f3c287609..aebab2060308 100644
 a/src/grep.c
-+++ b/src/grep.c
-@@ -1728,11 +1728,15 @@ drain_input (int fd, struct stat const *st)
- {
- #ifdef SPLICE_F_MOVE
-   /* Should be faster, since it need not copy data to user space.  */
--  while ((nbytes = splice (fd, NULL, STDOUT_FILENO, NULL,
--   INITIAL_BUFSIZE, SPLICE_F_MOVE)))
--if (nbytes < 0)
--  return false;
--  return true;
-+  nbytes = splice (fd, NULL, STDOUT_FILENO, NULL,
-+   INITIAL_BUFSIZE, SPLICE_F_MOVE);
-+  if (0 <= nbytes || errno != EINVAL)
-+{
-+  while (0 < nbytes)
-+nbytes = splice (fd, NULL, STDOUT_FILENO, NULL,
-+ INITIAL_BUFSIZE, SPLICE_F_MOVE);
-+  return nbytes == 0;
-+}
- #endif
- }
-   while ((nbytes = safe_read (fd, buffer, bufalloc)))
-diff --git a/tests/grep-dev-null-out b/tests/grep-dev-null-out
-index 13a4843957a6..c8128d5cc6a4 100755
 a/tests/grep-dev-null-out
-+++ b/tests/grep-dev-null-out
-@@ -8,4 +8,6 @@ require_timeout_
- ${AWK-awk} 'BEGIN {while (1) print "x"}' /dev/null || fail=1
- 
-+echo abc | grep b >>/dev/null || fail=1
-+
- Exit $fail
--- 
-2.11.0
-

diff --git a/sys-apps/grep/grep-2.27-r1.ebuild 
b/sys-apps/grep/grep-2.27-r1.ebuild
deleted file mode 100644
index b2e9b385835..000
--- a/sys-apps/grep/grep-2.27-r1.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils flag-o-matic toolchain-funcs
-
-DESCRIPTION="GNU regular expression matcher"
-HOMEPAGE="https://www.gnu.org/software/grep/;
-SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
-   mirror://gentoo/${P}.tar.xz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh 
sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos 
~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris 
~x86-solaris"
-IUSE="nls pcre static"
-
-LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
-   nls? ( virtual/libintl )
- 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/, sys-apps/grep/files/

2017-02-11 Thread Lars Wendler
commit: e2a11e4705ce1f1c47cb097dbdf1f6da6df67c3f
Author: Lars Wendler  gentoo  org>
AuthorDate: Sat Feb 11 14:01:21 2017 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Sat Feb 11 14:01:52 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2a11e47

sys-apps/grep: Removed old.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sys-apps/grep/Manifest |  1 -
 .../files/grep-2.28-multiple_pattern_fix.patch | 97 --
 sys-apps/grep/grep-2.28-r1.ebuild  | 51 
 3 files changed, 149 deletions(-)

diff --git a/sys-apps/grep/Manifest b/sys-apps/grep/Manifest
index 9de6005058..64d215a3f0 100644
--- a/sys-apps/grep/Manifest
+++ b/sys-apps/grep/Manifest
@@ -1,4 +1,3 @@
 DIST grep-2.25.tar.xz 1327856 SHA256 
e21e83bac50450e0d0d61a42c154ee0dceaacdbf4f604ef6e79071cb8e596830 SHA512 
7a738f938dde350ae71eb87083586e25768ba392113cba973a4e567b476c788ca66e0736d63f5e0e12a7847fa70379dc0b6568ec92431ea4604acd2cbedd66c1
 WHIRLPOOL 
af46fb0fdf2f271dc31a4902271881aab571d9705a18625c247920f82894b0358a2788e6c7625405c968ea717397ea52802073e4b4fa871121f8f77edc62e748
 DIST grep-2.27.tar.xz 1360388 SHA256 
ad4cc44d23074a1c3a8baae8fbafff2a8c60f38a9a6108f985eef6fbee6dcaeb SHA512 
d67f16cc5f931a455d5287badbaf080967da573d290430f440e578a563cff4f4c0c2668f60dbb8bc71eaed289f075957006c10c6827f0da1a49df49efd3f0781
 WHIRLPOOL 
f1bd591f60998a5515f661ddd576593a3f24f8ea2e7c2ae5a94699da53cf98ba3bc422c3577ea6c05be48544ac6c2382d3da000e52aeb2affa05d75ef0617af9
-DIST grep-2.28.tar.xz 1374532 SHA256 
3bad4c23eeb8dfa2fa84cdbe368398f75fdcd54bde411db83b9ef7fba5b60185 SHA512 
7c1f054cf6a483fc43df51597b0b54df692169dbb6ff1f34918cc418786a8987e1dbeed00a5c08cc849fb74ae1c65b8e4dd9663ff1425dfb36bc636c312ad189
 WHIRLPOOL 
1003b1046a56e728e0d3790bbcd08eb1a93c72575cb35bfedfb7286c11a6b79b4dca695a683b32f6dee1c58583e0930c7a54025a6f603532e7e1d8acf2dfbd10
 DIST grep-3.0.tar.xz 1375156 SHA256 
e2c81db5056e3e8c5995f0bb5d0d0e1cad1f6f45c3b2fc77b6e81435aed48ab5 SHA512 
0e9a00df9d492f399230bae0264942edaf64bb926f93edb7922f27b075a86ba0a78698f54996cc522b6261aa01a8ecbeadeb68523d4470a9941f242c3ae24c58
 WHIRLPOOL 
656271228bbbc3550560d2f4ec80031a8b0d9c662447afeea6e3c65c859dadde244af8c32ce03681495b3e86913468344fc29a5a52a53aa04eb5963b3a8a9529

diff --git a/sys-apps/grep/files/grep-2.28-multiple_pattern_fix.patch 
b/sys-apps/grep/files/grep-2.28-multiple_pattern_fix.patch
deleted file mode 100644
index f6cf64d383..00
--- a/sys-apps/grep/files/grep-2.28-multiple_pattern_fix.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 6e4c8728f0e75af57f839625d0bd51b0a02d091e Mon Sep 17 00:00:00 2001
-From: Paul Eggert 
-Date: Wed, 8 Feb 2017 13:00:11 -0800
-Subject: grep: do not mishandle \. in multiple patterns
-
-Problem reported by Lars Wendler (Bug#25655).
-* NEWS: Document this.
-* src/grep.c (try_fgrep_pattern): Fix typo that prevented
-keys from being properly updated.
-* tests/foad1: Test for the bug.

- src/grep.c  | 15 ---
- tests/foad1 |  7 +++
- 3 files changed, 20 insertions(+), 7 deletions(-)
-
-diff --git a/src/grep.c b/src/grep.c
-index 81654c3..74acb0b 100644
 a/src/grep.c
-+++ b/src/grep.c
-@@ -2361,11 +2361,12 @@ try_fgrep_pattern (int matcher, char *keys, size_t 
*len_p)
-   size_t len = *len_p;
-   char *new_keys = xmalloc (len + 1);
-   char *p = new_keys;
-+  char const *q = keys;
-   mbstate_t mb_state = { 0 };
- 
-   while (len != 0)
- {
--  switch (*keys)
-+  switch (*q)
- {
- case '$': case '*': case '.': case '[': case '^':
-   goto fail;
-@@ -2377,7 +2378,7 @@ try_fgrep_pattern (int matcher, char *keys, size_t 
*len_p)
- 
- case '\\':
-   if (1 < len)
--switch (keys[1])
-+switch (q[1])
-   {
-   case '\n':
-   case 'B': case 'S': case 'W': case'\'': case '<':
-@@ -2391,7 +2392,7 @@ try_fgrep_pattern (int matcher, char *keys, size_t 
*len_p)
-   goto fail;
- /* Fall through.  */
-   default:
--keys++, len--;
-+q++, len--;
- break;
-   }
-   break;
-@@ -2401,20 +2402,20 @@ try_fgrep_pattern (int matcher, char *keys, size_t 
*len_p)
- size_t n;
- if (match_icase)
-   {
--int ni = fgrep_icase_charlen (keys, len, _state);
-+int ni = fgrep_icase_charlen (q, len, _state);
- if (ni < 0)
-   goto fail;
- n = ni;
-   }
- else
-   {
--n = mb_clen (keys, len, _state);
-+n = mb_clen (q, len, _state);
- if (MB_LEN_MAX < n)
-   goto fail;
-   }
- 
--p = mempcpy (p, keys, n);
--keys += n;
-+p = mempcpy (p, q, n);
-+q += n;
- len -= n;
-   }
- }
-diff --git a/tests/foad1 b/tests/foad1
-index 286c449..0163f1a