From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E80F2158B20 for ; Wed, 05 Feb 2025 16:51:54 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (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) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id D1540342FB6 for ; Wed, 05 Feb 2025 16:51:54 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id D67251103CB; Wed, 05 Feb 2025 16:51:53 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 bobolink.gentoo.org (Postfix) with ESMTPS id C646D1103CB for ; Wed, 05 Feb 2025 16:51:53 +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 7A28A342FEF for ; Wed, 05 Feb 2025 16:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D742B1ABE for ; Wed, 05 Feb 2025 16:51:51 +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: <1738774268.26a8a019b6665b80a970188bba49846554797b4b.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/patch/, sys-devel/patch/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/patch/files/patch-2.7.6-configure-mkdir-spruced-up.patch sys-devel/patch/files/patch-2.7.6-ndebug-assert-hash-table.patch sys-devel/patch/patch-2.7.6-r7.ebuild X-VCS-Directories: sys-devel/patch/ sys-devel/patch/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 26a8a019b6665b80a970188bba49846554797b4b X-VCS-Branch: master Date: Wed, 05 Feb 2025 16:51:51 +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: 2dcf5c3c-956b-4d7c-ab71-7317799b509e X-Archives-Hash: 95d20ca6e8c286ae92ef58e9ef1a5603 commit: 26a8a019b6665b80a970188bba49846554797b4b Author: Sam James gentoo org> AuthorDate: Wed Feb 5 16:24:46 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Feb 5 16:51:08 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26a8a019 sys-devel/patch: refine mkdir configure patch; fix test failure with -DNDEBUG * Add another hunk for another configure test (that only fires in some cases) and also add a hunk for Android (which might be needed for people doing Prefix). Noticed this whlie looking into something that ended up being related. * Fix test failure with -DNDEBUG, reported by Michał Górny gentoo.org> at https://github.com/conda-forge/patch-feedstock/issues/11. Closes: https://bugs.gentoo.org/898598 Signed-off-by: Sam James gentoo.org> .../patch-2.7.6-configure-mkdir-spruced-up.patch | 38 ++++++++++ .../patch-2.7.6-ndebug-assert-hash-table.patch | 37 ++++++++++ sys-devel/patch/patch-2.7.6-r7.ebuild | 86 ++++++++++++++++++++++ 3 files changed, 161 insertions(+) diff --git a/sys-devel/patch/files/patch-2.7.6-configure-mkdir-spruced-up.patch b/sys-devel/patch/files/patch-2.7.6-configure-mkdir-spruced-up.patch new file mode 100644 index 000000000000..8ef7a954a4d9 --- /dev/null +++ b/sys-devel/patch/files/patch-2.7.6-configure-mkdir-spruced-up.patch @@ -0,0 +1,38 @@ +https://bugs.gentoo.org/898598 +https://github.com/coreutils/gnulib/commit/3c136a2cc38d71083f123231a8b9ad4b01930789 +--- a/configure ++++ b/configure +@@ -17084,6 +17084,8 @@ else + #include + #include + #include ++/* Android 4.3 declares fchownat() in instead. */ ++#include + #include + int + main () +@@ -17130,6 +17132,8 @@ else + /* end confdefs.h. */ + #include + #include ++ /* Android 4.3 declares fchownat() in instead. */ ++ #include + + int + main () +--- a/lib/unistd.in.h ++++ b/lib/unistd.in.h +@@ -113,6 +113,13 @@ + # include + #endif + ++/* Android 4.3 declares fchownat in , not in . */ ++/* But avoid namespace pollution on glibc systems. */ ++#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ ++ && !defined __GLIBC__ ++# include ++#endif ++ + /* MSVC defines off_t in . + May also define off_t to a 64-bit type on native Windows. */ + #if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ diff --git a/sys-devel/patch/files/patch-2.7.6-ndebug-assert-hash-table.patch b/sys-devel/patch/files/patch-2.7.6-ndebug-assert-hash-table.patch new file mode 100644 index 000000000000..d3aa7aa4c34e --- /dev/null +++ b/sys-devel/patch/files/patch-2.7.6-ndebug-assert-hash-table.patch @@ -0,0 +1,37 @@ +From 01ae7ce6a7f270937face6aec75db28d30d83059 Mon Sep 17 00:00:00 2001 +Message-ID: <01ae7ce6a7f270937face6aec75db28d30d83059.1738773172.git.sam@gentoo.org> +From: Sam James +Date: Wed, 5 Feb 2025 16:16:06 +0000 +Subject: [PATCH] Fix dodgy assert with side-effects in insert_cached_dirfd +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Michał Górny reported that patch was running out of +FDs and that the `deep-directories` test was failing. This turns out +to be because `hash_insert` isn't called at all with `-DNDEBUG` because +`insert_cached_dirfd` only calls it in one case inside of an `assert`. + +See https://github.com/conda-forge/patch-feedstock/issues/11. + +This regressed in 025a54b789bd88ed15430f8633514e296826983e. + +* src/safe.c (insert_cached_dirfd): Don't use 'assert' for 'hash_insert' + call with side-effects. +--- a/src/safe.c ++++ b/src/safe.c +@@ -183,7 +183,8 @@ static void insert_cached_dirfd (struct cached_dirfd *entry, int keepfd) + + /* Only insert if the parent still exists. */ + if (! list_empty (&entry->children_link)) +- assert (hash_insert (cached_dirfds, entry) == entry); ++ if (hash_insert (cached_dirfds, entry) != entry) ++ xalloc_die (); + } + + static void invalidate_cached_dirfd (int dirfd, const char *name) + +base-commit: 1da6bf84db2ed0be88ccb47139256e48243a75f0 +-- +2.48.1 + diff --git a/sys-devel/patch/patch-2.7.6-r7.ebuild b/sys-devel/patch/patch-2.7.6-r7.ebuild new file mode 100644 index 000000000000..61ce4a002a1d --- /dev/null +++ b/sys-devel/patch/patch-2.7.6-r7.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/patch.asc +inherit flag-o-matic verify-sig + +DESCRIPTION="Utility to apply diffs to files" +HOMEPAGE="https://www.gnu.org/software/patch/patch.html" +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/patch.git" + inherit git-r3 +else + SRC_URI="mirror://gnu/patch/${P}.tar.xz" + SRC_URI+=" verify-sig? ( mirror://gnu/patch/${P}.tar.xz.sig )" + + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~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="static test xattr" +RESTRICT="!test? ( test )" + +RDEPEND="xattr? ( sys-apps/attr )" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( sys-apps/ed ) + verify-sig? ( sec-keys/openpgp-keys-patch ) +" + +PATCHES=( + "${FILESDIR}"/${P}-fix-test-suite.patch + "${FILESDIR}"/${PN}-2.7.6-fix-error-handling-with-git-style-patches.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2018-6951.patch + "${FILESDIR}"/${PN}-2.7.6-allow-input-files-to-be-missing-for-ed-style-patches.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2018-6952.patch + "${FILESDIR}"/${PN}-2.7.6-Do-not-crash-when-RLIMIT_NOFILE-is-set-to-RLIM_INFINITY.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156-fix1.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156-fix2.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2019-13636.patch + "${FILESDIR}"/${PN}-2.7.6-CVE-2019-13638.patch + "${FILESDIR}"/${PN}-2.7.6-Avoid-invalid-memory-access-in-context-format-diffs.patch + "${FILESDIR}"/${PN}-2.7.6-configure-mkdir-spruced-up.patch + "${FILESDIR}"/${PN}-2.7.6-ndebug-assert-hash-table.patch +) + +src_unpack() { + if [[ ${PV} == 9999 ]] ; then + git-r3_src_unpack + + cd "${S}" || die + ./bootstrap || die + elif use verify-sig ; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig} + fi + + default +} + +src_configure() { + use static && append-ldflags -static + + local myeconfargs=( + $(use_enable xattr) + # rename to gpatch for better BSD compatibility + --program-prefix=g + ) + # Do not let $ED mess up the search for `ed` 470210. + ac_cv_path_ED=$(type -P ed) \ + econf "${myeconfargs[@]}" +} + +src_test() { + emake check gl_public_submodule_commit= +} + +src_install() { + default + + # symlink to the standard name + dosym gpatch /usr/bin/patch + dosym gpatch.1 /usr/share/man/man1/patch.1 +}