From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EB40C1581E7 for ; Sun, 28 Apr 2024 23:06:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC1B7E2A1B; Sun, 28 Apr 2024 23:06:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7704E2A1B for ; Sun, 28 Apr 2024 23:06:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D646B34302B for ; Sun, 28 Apr 2024 23:06:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CF9C616C0 for ; Sun, 28 Apr 2024 23:06:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1714345549.bad1434434e66744b2c660546374f8574ed9d8a0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/, sys-apps/grep/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/grep/files/grep-3.11-100k-files-dir.patch sys-apps/grep/grep-3.11-r1.ebuild X-VCS-Directories: sys-apps/grep/ sys-apps/grep/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: bad1434434e66744b2c660546374f8574ed9d8a0 X-VCS-Branch: master Date: Sun, 28 Apr 2024 23:06:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c5e8ddbb-0e2e-4d30-a152-6a6dd9b77397 X-Archives-Hash: 1e5c399ab71771f98573cbf7b6ea539d commit: bad1434434e66744b2c660546374f8574ed9d8a0 Author: Sam James gentoo org> AuthorDate: Sun Apr 28 23:04:03 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Apr 28 23:05:49 2024 +0000 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 000000000000..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 0000000..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 100000|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 upgrade to glibc 2.28 or later, + # configure --with-included-regex, or ignore the test failure. + TESTS = \ ++ 100k-entries \ + backref \ + backref-alt \ + backref-multibyte-slow \ +@@ -2430,6 +2431,13 @@ recheck: all $(check_PROGRAMS) + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? ++100k-entries.log: 100k-entries ++ @p='100k-entries'; \ ++ b='100k-entries'; \ ++ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ ++ --log-file $$b.log --trs-file $$b.trs \ ++ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ ++ "$$tst" $(AM_TESTS_FD_REDIRECT) + backref.log: backref + @p='backref'; \ + b='backref'; \ diff --git a/sys-apps/grep/grep-3.11-r1.ebuild b/sys-apps/grep/grep-3.11-r1.ebuild new file mode 100644 index 000000000000..4341f860771e --- /dev/null +++ b/sys-apps/grep/grep-3.11-r1.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/grep.asc +inherit flag-o-matic verify-sig + +DESCRIPTION="GNU regular expression matcher" +HOMEPAGE="https://www.gnu.org/software/grep/" + +if [[ ${PV} == *_p* ]] ; then + # Subscribe to the 'platform-testers' ML to find these. + # Useful to test on our especially more niche arches and report issues upstream. + MY_COMMIT="19-2ea9" + MY_P=${PN}-$(ver_cut 1-2).${MY_COMMIT} + SRC_URI="https://meyering.net/${PN}/${MY_P}.tar.xz" + SRC_URI+=" verify-sig? ( https://meyering.net/${PN}/${MY_P}.tar.xz.sig )" + S="${WORKDIR}"/${MY_P} +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +fi + +LICENSE="GPL-3+" +SLOT="0" +IUSE="+egrep-fgrep nls pcre static" + +# We lack dev-libs/libsigsegv[static-libs] for now +REQUIRED_USE="static? ( !sparc )" + +LIB_DEPEND=" + pcre? ( >=dev-libs/libpcre2-10.42-r1[static-libs(+)] ) + sparc? ( dev-libs/libsigsegv ) +" +RDEPEND=" + !static? ( ${LIB_DEPEND//\[static-libs(+)]} ) + nls? ( virtual/libintl ) + virtual/libiconv +" +DEPEND=" + ${RDEPEND} + static? ( ${LIB_DEPEND} ) +" +BDEPEND=" + virtual/pkgconfig + nls? ( sys-devel/gettext ) + verify-sig? ( sec-keys/openpgp-keys-grep ) +" + +DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) + +QA_CONFIG_IMPL_DECL_SKIP=( + # Either gnulib FPs or fixed in newer autoconf, not worth autoreconf here for now? + MIN + alignof + static_assert +) + +PATCHES=( + "${FILESDIR}"/${P}-100k-files-dir.patch +) + +src_prepare() { + default + + # bug #523898 + sed -i \ + -e "s:@SHELL@:${EPREFIX}/bin/sh:g" \ + -e "s:@grep@:${EPREFIX}/bin/grep:" \ + src/egrep.sh || die + + # Drop when grep-3.11-100k-files-dir.patch is gone + touch aclocal.m4 config.hin configure {,doc/,gnulib-tests/,lib/,src/,tests/}Makefile.in || die +} + +src_configure() { + use static && append-ldflags -static + + # We used to turn this off unconditionally (bug #673524) but we now + # allow it for cases where libsigsegv is better for userspace handling + # of stack overflows. + # In particular, it's necessary for sparc: bug #768135 + export ac_cv_libsigsegv=$(usex sparc) + + local myeconfargs=( + --bindir="${EPREFIX}"/bin + $(use_enable nls) + $(use_enable pcre perl-regexp) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if use egrep-fgrep ; then + # Delete the upstream wrapper variants which warn on egrep+fgrep use + rm "${ED}"/bin/{egrep,fgrep} || die + + into / + # Install egrep, fgrep which don't warn. + # + # We do this by default to avoid breakage in old scripts + # and such which don't expect unexpected output on stderr, + # we've had examples of builds failing because foo-config + # starts returning a warning. + # + # https://lists.gnu.org/archive/html/bug-grep/2022-10/msg00000.html + newbin - egrep <<-EOF + #!/usr/bin/env sh + exec "${EPREFIX}/bin/grep" -E "\$@" + EOF + + newbin - fgrep <<-EOF + #!/usr/bin/env sh + exec "${EPREFIX}/bin/grep" -F "\$@" + EOF + fi +}