summaryrefslogtreecommitdiff
path: root/sys-devel/patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-02-27 19:26:40 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-02-27 19:26:40 +0000
commit4418da21bd05d610a3450f4aa75481785ca372a0 (patch)
tree05975a5e68e88b64b58ed4f9c416e36cd4dbff4e /sys-devel/patch
parentacfd7c956a7b45da7af1452ec12e0b2d5e6ac65b (diff)
gentoo auto-resync : 27:02:2025 - 19:26:39
Diffstat (limited to 'sys-devel/patch')
-rw-r--r--sys-devel/patch/Manifest4
-rw-r--r--sys-devel/patch/files/patch-2.7.6_p20250206-no-backup-if-mismatch-regression.patch131
-rw-r--r--sys-devel/patch/files/patch-2.7.6_p20250206-traditional-diff-lines.patch114
-rw-r--r--sys-devel/patch/patch-2.7.6_p20250206-r1.ebuild (renamed from sys-devel/patch/patch-2.7.6_p20250206.ebuild)17
4 files changed, 265 insertions, 1 deletions
diff --git a/sys-devel/patch/Manifest b/sys-devel/patch/Manifest
index 06cf4de60097..961aed879f8a 100644
--- a/sys-devel/patch/Manifest
+++ b/sys-devel/patch/Manifest
@@ -13,12 +13,14 @@ AUX patch-2.7.6-configure-mkdir.patch 478 BLAKE2B 95135becb2749c9c0217aa6185a384
AUX patch-2.7.6-fix-error-handling-with-git-style-patches.patch 3582 BLAKE2B c443abb5112283aeb20db4ccf57c0d1241bfa586ad8d54d0ff2e1ae9026174f560df37dda1fedfc39db8178db05f77a4f94827ede80982311f475f460e4ae57f SHA512 1c05cf05b7348b86c878bd464a3f2f978b3e97655bf4f9aa83732af8bfd1e82046b88db39b7ce70e33ffc00c7f09c28ba777fba3fbd9538fd76767bfc396f382
AUX patch-2.7.6-fix-test-suite.patch 3006 BLAKE2B 4b00c743f880f3cd672d6d37ff89d691d34d38b9652a9434544db10c3e28adf412071a14b5f6e4fcb1cead5e6ec0c20f786b061c96eb3fed4d9e8744a18bb02a SHA512 626256394ca2df1fadfb6cfaaa4458b86912ba70debac88d959ce3c34d2f5791284fb2b9b38b88b3e38a50a1e0f6585f0c860a9866f27c40be4884e95d7d83f2
AUX patch-2.7.6-ndebug-assert-hash-table.patch 1563 BLAKE2B 283a1d0cf5228965809223fd977d9793313b8b031e8666813b0fc68da9b841ff9d46d840261fb8ef7e3b45957151f351d832d9c860df8e37ad9490a895f5edaa SHA512 5847dc8288ddd5149902bd0b2e4fb33d37eaf5d6ee253ccbba25378bec2261640b0ce557a89aff7e48d306ef825f7a8db9bb87707f42615bea103784e0cfc7d4
+AUX patch-2.7.6_p20250206-no-backup-if-mismatch-regression.patch 3476 BLAKE2B 3251e773b11cdc6d37e0907d17d4c659eb58107c8ea270de9d77b976d58879a8429689f7e97cfc9ed3b58215b3d1b0493724f6d33c1e197508bb8be34ad48747 SHA512 1da3bca476f2969422417f5803914c6bbb4b4fb44ac3576ff1b0fa8598c4fe627e99a3acf54336c326f0f7b21cf485c219c315549eabc1a121b48451697642d9
+AUX patch-2.7.6_p20250206-traditional-diff-lines.patch 2936 BLAKE2B f21a58b6e39694d9237a9eb5e05ef2aa6ba30fce4348e216c81302666e2a941a6a6bbd4a30df4d3c0a1b50fb56044152d727eec64cf903b298237c626266c7a9 SHA512 45c0103d868f93106c2df1e2cd79a51ec5208dbead0f003f213083d0d1e723e2d881916c04d5b45bf208cb062782f97e05a95356d5ccc63fff53ccfbac2f2e62
DIST patch-2.7.6.tar.xz 783756 BLAKE2B e3dd2d155a94c39cb60eafc26677e84de14c3a6d5814dff69de091ded52f21862490970254297795f2c42a0c3203f7e88a8f65bb66968f8dfd6e066bf53f2dfb SHA512 fcca87bdb67a88685a8a25597f9e015f5e60197b9a269fa350ae35a7991ed8da553939b4bbc7f7d3cfd863c67142af403b04165633acbce4339056a905e87fbd
DIST patch-2.7.6.tar.xz.sig 801 BLAKE2B 8f2decb10402ecf0208d05ea7cce3bae565d31ee2bb2a118367c117d25b158d8bd525cae654ec0c0e2c036cc8f47a331edc1bb10b100683ade64dfa3b651988b SHA512 1302a1110dcda4f3d83b5263415d72be55c46dae0efb1c123e9c346154e09def5657004bbe7249e2d014555349410e7a5217140dd8852331235f75bcc757351b
DIST patch-2.7.6_p20250206.tar.xz 906596 BLAKE2B f110bcf19b655c900327088ba023743fd845161dd00cab228675d3c0992fa397916adf153c35775fc5ff8e733b559ce8a05eac71eec7156403f4c9ab17ff2a3e SHA512 2dd05af5f9f0864b0cccc5c5194d0ba4ca427fc366b91210e2f539a50bd2006d7142606f8f223b45c5d426eafef7e6b17c6b67c2ef9b7ec75589bb3d9fce68d3
DIST patch-2.7.6_p20250206.tar.xz.sig 833 BLAKE2B 8363136c58bbde5c349a4c96cd277588f3b679a98ea1c21da39bcf375c2b85c0d36165f1dceab453a09bcc2745d5ab6959d5ba28020e138591e7530dbf72f180 SHA512 a114f836502bb02910c8f88d7e667ce92ef6b0b9a26eb466ee9bd1ad8956036867801b19ea3ee27418fe0fb6e673e3d5d2aad2b9c05f7e99fd8bb1a9d604ea6f
EBUILD patch-2.7.6-r6.ebuild 2393 BLAKE2B bee456b5704807b931046f85172a93aa3ed564979a02ff307943b7c4d585d21bdcebc1d637f5914925d0eb9d088f5d2413ab9903ec8daf442a316455c9a2954a SHA512 706529f59336e2d746b88c68acfea63d299372505e021b38fd301f25ae09c3afc2fea9daab73526399dc1fa0898914a1937f9a18d1bce1c0cade10354ec484c6
EBUILD patch-2.7.6-r7.ebuild 2470 BLAKE2B a2f64c2a715847db3121093c2f9c774121fb0b17d768e394d06a8e90c00b21edaf10d3967af1874a0631db42f2d506ecc62c792aae97a5611da5554f5b1c58bc SHA512 1483a88b0bae665d7edd71a1b9270388eae633f9ba8f7038ff9b22b5143a031894f61f7acb18a093d24568c055412da7e49948fe53b2c5f1b66ee650fe5574b3
-EBUILD patch-2.7.6_p20250206.ebuild 2041 BLAKE2B 835f7c98e5d9e6cff2044624f818c9171c4eb9f5a39dd8166505e08bd2a2b07e02cc2b01f0f7bc574cec3170f9115ec6a2b1dbe008c0415411ab1a6b6168f332 SHA512 b00bc87f4ed8fd68ed8b2348813c794861e448e810d5fd8db2469f047d23eb78a166ff1ebe81cf483faf68c8fbaf67a28edf2ef1d0e89a294da0f80844affaf2
+EBUILD patch-2.7.6_p20250206-r1.ebuild 2406 BLAKE2B 90bc1c01591a62cd5068d0dadfc4e850810e4283dc1a10bf63ff10c0102736447bf552ef0afdc64a5dac90da09e53e445c79bd2a369234a6c5f0b6fbc67c1946 SHA512 8b71298941bb4a2edfc314aa6b9008a8b3ae6388911d94fde5f0b822aa3b887193d63842368d6e28dfe0353671b5a4c68447e5a37d251984638d4e7e366abf2f
EBUILD patch-9999.ebuild 2043 BLAKE2B 1656b1095752f92ae19eba238049d203590bea056d784f1011f8fdf48ab95a16bb4a91b51674cf7ce1e8e01889abfbb45d8a19a371da37ce3f64889d2ca2fea1 SHA512 d15f55a85a5674d05805931b75369c13ae072582ed370d590a85831e1591304cff232ab69752795303555b64a7b090894d99061a51db0024c887ce170682f6af
MISC metadata.xml 329 BLAKE2B ac0ac5e4a422955e2e1cc040d03ab9df083c70d0275145366ffe47c04fb08ac5e9c1cf776ab9c96e023910a0f66a7ff3cfd8377574d8e282cd78c435a6d8bdd2 SHA512 a0c5d5bc2d111a6d22afa4bae0e56ac7f927798122fed5373dd64a214d7b51dc436482bf21eb2ef32073c2f4004cb6dd6449afd58b7ab6936ed3c2e3a4c39872
diff --git a/sys-devel/patch/files/patch-2.7.6_p20250206-no-backup-if-mismatch-regression.patch b/sys-devel/patch/files/patch-2.7.6_p20250206-no-backup-if-mismatch-regression.patch
new file mode 100644
index 000000000000..f4d162694ab4
--- /dev/null
+++ b/sys-devel/patch/files/patch-2.7.6_p20250206-no-backup-if-mismatch-regression.patch
@@ -0,0 +1,131 @@
+From b5d2124e2e6019ee5d329b49ef6904a0daec74a1 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon, 24 Feb 2025 22:59:51 -0800
+Subject: [PATCH] patch: fix --no-backup-if-mismatch regression
+
+Problem reported by Sam James in:
+https://lists.gnu.org/archive/html/bug-patch/2025-02/msg00014.html
+https://bugs.gentoo.org/show_bug.cgi?id=949834
+* src/patch.c (backup_if_mismatch_specified): New static var.
+(get_some_switches): Set it.
+(main): Default backup_if_mismatch only if not set on command line.
+* tests/no-backup: New file.
+* tests/Makefile.am (TESTS): Add it.
+---
+ src/patch.c | 6 ++++-
+ tests/Makefile.am | 1 +
+ tests/no-backup | 56 +++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 62 insertions(+), 1 deletion(-)
+ create mode 100644 tests/no-backup
+
+diff --git a/src/patch.c b/src/patch.c
+index 6c460f7..e4d0524 100644
+--- a/src/patch.c
++++ b/src/patch.c
+@@ -118,6 +118,7 @@ static bool merge;
+ static enum diff reject_format = NO_DIFF; /* automatic */
+ static bool make_backups;
+ static bool backup_if_mismatch;
++static bool backup_if_mismatch_specified;
+ static char const *version_control;
+ static char const *version_control_context;
+ static bool remove_empty_files;
+@@ -196,7 +197,8 @@ main (int argc, char **argv)
+ if (set_utc && setenv ("TZ", "UTC0", 1) < 0)
+ pfatal ("setenv");
+
+- backup_if_mismatch = ! posixly_correct;
++ if (!backup_if_mismatch_specified)
++ backup_if_mismatch = !posixly_correct;
+ if (make_backups | backup_if_mismatch)
+ backup_type = get_version (version_control_context, version_control);
+
+@@ -1050,9 +1052,11 @@ get_some_switches (int argc, char **argv)
+ usage (stdout, EXIT_SUCCESS);
+ case CHAR_MAX + 5:
+ backup_if_mismatch = true;
++ backup_if_mismatch_specified = true;
+ break;
+ case CHAR_MAX + 6:
+ backup_if_mismatch = false;
++ backup_if_mismatch_specified = true;
+ break;
+ case CHAR_MAX + 7:
+ posixly_correct = true;
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 43ddf66..acb449a 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -50,6 +50,7 @@ TESTS = \
+ mixed-patch-types \
+ munged-context-format \
+ need-filename \
++ no-backup \
+ no-mode-change-git-diff \
+ no-newline-triggers-assert \
+ preserve-c-function-names \
+diff --git a/tests/no-backup b/tests/no-backup
+new file mode 100644
+index 0000000..57b73fa
+--- /dev/null
++++ b/tests/no-backup
+@@ -0,0 +1,56 @@
++# Copyright 2025 Free Software Foundation, Inc.
++#
++# Copying and distribution of this file, with or without modification,
++# in any medium, are permitted without royalty provided the copyright
++# notice and this notice are preserved.
++
++# Test the --no-backup-if-mismatch option
++
++. $srcdir/test-lib.sh
++
++require cat
++use_local_patch
++use_tmpdir
++
++# ==============================================================
++
++cat >my_file <<'EOF'
++/* ... */
++void baz();
++
++
++void baz() {
++ /* ... */
++}
++
++int main() {
++ int foo;
++ int bar;
++
++ /* ... */
++ baz();
++}
++EOF
++
++cat >my_file.patch <<'EOF'
++--- my_file 2025-02-16 11:22:12.881765792 +0000
+++++ my_file_new 2025-02-16 11:22:12.881796732 +0000
++@@ -2,7 +2,7 @@
++ void baz();
++
++ void baz() {
++- /* ... */
+++ // ...
++ }
++
++ int main() {
++EOF
++
++unset POSIXLY_CORRECT
++
++check 'patch -N --no-backup-if-mismatch <my_file.patch || echo "Status: $?"' <<'EOF'
++patching file my_file
++Hunk #1 succeeded at 3 with fuzz 1 (offset 1 line).
++EOF
++
++ncheck 'test ! -f my_file.orig'
+--
+2.45.3
+
diff --git a/sys-devel/patch/files/patch-2.7.6_p20250206-traditional-diff-lines.patch b/sys-devel/patch/files/patch-2.7.6_p20250206-traditional-diff-lines.patch
new file mode 100644
index 000000000000..3d9d3109e91c
--- /dev/null
+++ b/sys-devel/patch/files/patch-2.7.6_p20250206-traditional-diff-lines.patch
@@ -0,0 +1,114 @@
+From 29fced6251928e6334fa15fd28bf2c198acd4cd4 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Wed, 26 Feb 2025 16:44:48 -0800
+Subject: [PATCH 1/2] Count traditional diff pattern lines correctly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes a bug I introduced on Thu Sep 5 16:37:50 2024 -0700.
+Problem reported by Petr Vaněk in:
+https://lists.gnu.org/archive/html/bug-patch/2025-02/msg00017.html
+* src/pch.c (another_hunk): Fix method for counting number
+of lines in a traditional diff hunk.
+---
+ src/pch.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/pch.c b/src/pch.c
+index 63c9a0c..d9f5c61 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -1765,9 +1765,10 @@ another_hunk (enum diff difftype, bool rev)
+ if (*s == ',') {
+ idx_t last;
+ s = scan_linenum (s + 1, &last);
+- if (p_first >= IDX_MAX - p_ptrn_lines)
++ ptrdiff_t diff = last - p_first;
++ if (! (-1 <= diff && diff < IDX_MAX))
+ malformed ();
+- p_ptrn_lines += 1 - p_first;
++ p_ptrn_lines = diff + 1;
+ }
+ else
+ p_ptrn_lines = (*s != 'a');
+--
+2.45.3
+
+
+From b3d0c933389208ccac795a1b517c5a8b11cc012e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@gentoo.org>
+Date: Wed, 26 Feb 2025 16:44:48 -0800
+Subject: [PATCH 2/2] Regression in commit abe92e8010ab affecting MariaDB tests
+
+I have disovered a regression in commit abe92e8010ab ("Prefer idx_t,
+ptrdiff_t to lin") while I was running MariaDB tests. The regression is
+related to a diff file [1], where the patch fails to apply it with
+following error:
+
+ patch: **** '---' expected at line 2 of patch
+
+To illustrate the issue, I have attached a git patch containing a
+testcase with simplified reproducer.
+
+[1] https://github.com/MariaDB/server/blob/mariadb-10.6.21/mysql-test/suite/innodb/r/innodb-wl5522%2Cstrict_crc32.rdiff file
+---
+ tests/Makefile.am | 1 +
+ tests/regression-abe92e8010ab | 33 +++++++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+)
+ create mode 100644 tests/regression-abe92e8010ab
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index acb449a..8f1a248 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -57,6 +57,7 @@ TESTS = \
+ preserve-mode-and-timestamp \
+ quoted-filenames \
+ read-only-files \
++ regression-abe92e8010ab \
+ reject-format \
+ remember-backup-files \
+ remember-reject-files \
+diff --git a/tests/regression-abe92e8010ab b/tests/regression-abe92e8010ab
+new file mode 100644
+index 0000000..0e11e34
+--- /dev/null
++++ b/tests/regression-abe92e8010ab
+@@ -0,0 +1,33 @@
++. $srcdir/test-lib.sh
++
++require cat
++use_local_patch
++use_tmpdir
++
++cat > f <<EOF
++1
++2
++test:
++a
++4
++EOF
++
++cat > f.diff <<EOF
++2,3c2
++< test:
++< a
++---
++> 3
++EOF
++
++check 'patch f < f.diff' <<EOF
++patching file f
++Hunk #1 succeeded at 3 (offset 1 line).
++EOF
++
++check 'cat f' <<EOF
++1
++2
++3
++4
++EOF
+--
+2.45.3
+
diff --git a/sys-devel/patch/patch-2.7.6_p20250206.ebuild b/sys-devel/patch/patch-2.7.6_p20250206-r1.ebuild
index 5e593eb27c80..0c0ae58d62c4 100644
--- a/sys-devel/patch/patch-2.7.6_p20250206.ebuild
+++ b/sys-devel/patch/patch-2.7.6_p20250206-r1.ebuild
@@ -3,6 +3,11 @@
EAPI=8
+WANT_AUTOCONF=none
+WANT_LIBTOOL=none
+WANT_AUTOMAKE=1.16
+inherit autotools
+
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/patch.asc
inherit flag-o-matic verify-sig
@@ -36,6 +41,13 @@ BDEPEND="
verify-sig? ( >=sec-keys/openpgp-keys-patch-20250206 )
"
+PATCHES=(
+ # backport fix for https://bugs.gentoo.org/949834
+ "${FILESDIR}"/${P}-no-backup-if-mismatch-regression.patch
+ # backport https://lists.gnu.org/archive/html/bug-patch/2025-02/msg00017.html
+ "${FILESDIR}"/${P}-traditional-diff-lines.patch
+)
+
src_unpack() {
if [[ ${PV} == 9999 ]] ; then
git-r3_src_unpack
@@ -49,6 +61,11 @@ src_unpack() {
default
}
+src_prepare() {
+ default
+ eautomake
+}
+
src_configure() {
use static && append-ldflags -static