summaryrefslogtreecommitdiff
path: root/sys-devel/patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-29 20:19:23 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-29 20:19:23 +0100
commit12bb627384ddfd47382b9f1b6464481a58d01ebb (patch)
treef9760c04ccd4fcd7de214e2acd5b0e43fb530aa9 /sys-devel/patch
parent5fdd950c7ae03e12746a45c86d85861beaacc846 (diff)
gentoo resync : 29.08.2018
Diffstat (limited to 'sys-devel/patch')
-rw-r--r--sys-devel/patch/Manifest2
-rw-r--r--sys-devel/patch/files/patch-2.7.6-fix-error-handling-with-git-style-patches.patch125
-rw-r--r--sys-devel/patch/patch-2.7.6-r2.ebuild36
3 files changed, 163 insertions, 0 deletions
diff --git a/sys-devel/patch/Manifest b/sys-devel/patch/Manifest
index b07c1e3590f6..84b722ceb961 100644
--- a/sys-devel/patch/Manifest
+++ b/sys-devel/patch/Manifest
@@ -1,6 +1,8 @@
+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 2610 BLAKE2B e750283b85f0cb9d52324f28b8a03087980e8a61b16c3465914eeca65a3b800d8946a10c4dd0ab08b18c1cbc37810e55fb5c35314082a8c11e383b7d50d1bd3f SHA512 7ced1f9b937bf62131654d8a25c8d2a3f3cfe5fa8961e2e000542cce68061b10895bc0001ded898b9a43608af1f9c07903dc5c2f0a41662470d97188ed682115
DIST patch-2.7.5.tar.xz 727704 BLAKE2B a7aefd05da73329ae301f0f6429306661d72fedd59c6d35acef4828c7e5951c0ce3e8cedfc8ed9ac45d45f6eff564c2e41c0ccb95fbe1c668f63844b7069520c SHA512 6620ac8101f60c0b456ce339fa5e371f40be0b391e2e9728f34f3625f9907e516de61dac2f91bc76e6fd28a9bd1224efc3ba827cfaa606d857730c1af4195a0f
DIST patch-2.7.6.tar.xz 783756 BLAKE2B e3dd2d155a94c39cb60eafc26677e84de14c3a6d5814dff69de091ded52f21862490970254297795f2c42a0c3203f7e88a8f65bb66968f8dfd6e066bf53f2dfb SHA512 fcca87bdb67a88685a8a25597f9e015f5e60197b9a269fa350ae35a7991ed8da553939b4bbc7f7d3cfd863c67142af403b04165633acbce4339056a905e87fbd
EBUILD patch-2.7.5.ebuild 911 BLAKE2B 3eda3342754fb82470d8abbd3a9b9e3ee24b6e8ed62f8d0629fa3b6c3e248a4b522aa1a0074011108d8a74ddf4a94d00aa8d8423efd1b7755b4895438fbe3180 SHA512 f15e1b045b40506b1390a98bcf71834e153bc99d03fac764fea092ada307ac9f36444919052ff4c3a13ba3d5cb9b2afb089f0694f95a19f2636cef43cf149698
EBUILD patch-2.7.6-r1.ebuild 997 BLAKE2B 197e49254bbe881c02991ab5c1647f1445629079b242b84c5717f1255accc7ed15e85b8e2e514ba48dd89e5a86b51f791c6e323c9e615459d474f859f433cb77 SHA512 a96d34e7e6ac6fbfbf2bb742ec523f2810d605bd9b65cfc31658c4362ba46a4b31ffe46ab81184ef8f177f2bdbdaf99c532e7d7e0a3ffb635dc74d7b0906c5df
+EBUILD patch-2.7.6-r2.ebuild 1088 BLAKE2B e369a161b562b640b29a289d394480f14fc148044983d3e4e63af883582c539e71c9653e15abf1bad8395d98f1d520fe9e971a295b6e4567821f2077b40eda44 SHA512 5c4b3be3d8eba7b8580468410fdf1527ae6b977695587162eb6ff433e68139291169df4e8b2d8070435a258eae279b42765ab1f8b1afcb1ba477fde5b056f2f4
MISC metadata.xml 253 BLAKE2B 295e9d6d93aaa12af413972e1590c67087801cc09c9aa6b59d4606c0f4106d1dacf2baa9858559083b4c6d91beeef218d0729e8593a33788958da6d2897e8ce2 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555
diff --git a/sys-devel/patch/files/patch-2.7.6-fix-error-handling-with-git-style-patches.patch b/sys-devel/patch/files/patch-2.7.6-fix-error-handling-with-git-style-patches.patch
new file mode 100644
index 000000000000..a4f127dd7ce4
--- /dev/null
+++ b/sys-devel/patch/files/patch-2.7.6-fix-error-handling-with-git-style-patches.patch
@@ -0,0 +1,125 @@
+Backport for Gentoo patch-2.7.x.
+
+https://bugs.gentoo.org/664640
+
+
+Original patch:
+Author: Lubomir Rintel <lkundrak@v3.sk>
+Date: Tue Feb 27 16:52:00 2018 +0100
+Subject: Fix error handling with git-style patches
+
+When an error is encountered in output_files(), the subsequent call to
+cleanup() calls back into output_files() resulting in an infinte recursion.
+This is trivially reproduced with a git-style patch (which utilizes
+output_file_later()) that tries to patch a nonexistent or unreadable
+file (see attached test case).
+
+* src/patch.c: (output_files) clear the files_to_output list before
+iterating it, so that recursive calls won't iterate the same files.
+* tests/git-error: New test case.
+* tests/Makefile.am (TESTS): Add test case.
+
+Origin: https://lists.gnu.org/archive/html/bug-patch/2018-02/msg00010.html
+
+--- a/src/patch.c
++++ b/src/patch.c
+@@ -1938,8 +1938,12 @@ output_files (struct stat const *st)
+ {
+ gl_list_iterator_t iter;
+ const void *elt;
++ gl_list_t files;
+
+- iter = gl_list_iterator (files_to_output);
++ files = files_to_output;
++ init_files_to_output ();
++
++ iter = gl_list_iterator (files);
+ while (gl_list_iterator_next (&iter, &elt, NULL))
+ {
+ const struct file_to_output *file_to_output = elt;
+@@ -1957,8 +1961,8 @@ output_files (struct stat const *st)
+ /* Free the list up to here. */
+ for (;;)
+ {
+- const void *elt2 = gl_list_get_at (files_to_output, 0);
+- gl_list_remove_at (files_to_output, 0);
++ const void *elt2 = gl_list_get_at (files, 0);
++ gl_list_remove_at (files, 0);
+ if (elt == elt2)
+ break;
+ }
+@@ -1967,7 +1971,7 @@ output_files (struct stat const *st)
+ }
+ }
+ gl_list_iterator_free (&iter);
+- gl_list_clear (files_to_output);
++ gl_list_free (files);
+ }
+
+ /* Fatal exit with cleanup. */
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -40,6 +40,7 @@ TESTS = \
+ filename-choice \
+ git-binary-diff \
+ git-cleanup \
++ git-error \
+ garbage \
+ global-reject-files \
+ inname \
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -1316,6 +1316,7 @@ TESTS = \
+ filename-choice \
+ git-binary-diff \
+ git-cleanup \
++ git-error \
+ garbage \
+ global-reject-files \
+ inname \
+@@ -1695,6 +1696,13 @@ git-cleanup.log: git-cleanup
+ --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)
++git-error.log: git-error
++ @p='git-error'; \
++ b='git-error'; \
++ $(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)
+ garbage.log: garbage
+ @p='garbage'; \
+ b='garbage'; \
+--- /dev/null
++++ b/tests/git-error
+@@ -0,0 +1,29 @@
++# Copyright (C) 2018 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.
++
++. $srcdir/test-lib.sh
++
++require cat
++use_local_patch
++use_tmpdir
++
++cat > f.diff <<EOF
++diff --git a/boo b/boo
++--- /dev/fd/63 2018-02-27 16:32:54.861266246 +0100
+++++ /dev/fd/62 2018-02-27 16:32:54.861266246 +0100
++@@ -1 +1 @@
++-abc
+++def
++
++EOF
++
++check 'patch .nonexistent < f.diff || echo "Status: $?"' <<EOF
++patching file .nonexistent
++Hunk #1 FAILED at 1.
++1 out of 1 hunk FAILED -- saving rejects to file .nonexistent.rej
++$PATCH: **** Can't reopen file .nonexistent : No such file or directory
++Status: 2
++EOF
diff --git a/sys-devel/patch/patch-2.7.6-r2.ebuild b/sys-devel/patch/patch-2.7.6-r2.ebuild
new file mode 100644
index 000000000000..9a9734424328
--- /dev/null
+++ b/sys-devel/patch/patch-2.7.6-r2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic
+
+DESCRIPTION="Utility to apply diffs to files"
+HOMEPAGE="https://www.gnu.org/software/patch/patch.html"
+SRC_URI="mirror://gnu/patch/${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 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static test xattr"
+
+RDEPEND="xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ test? ( sys-apps/ed )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-test-suite.patch
+ "${FILESDIR}"/${PN}-2.7.6-fix-error-handling-with-git-style-patches.patch
+)
+
+src_configure() {
+ use static && append-ldflags -static
+
+ local myeconfargs=(
+ $(use_enable xattr)
+ --program-prefix="$(use userland_BSD && echo g)"
+ )
+ # Do not let $ED mess up the search for `ed` 470210.
+ ac_cv_path_ED=$(type -P ed) \
+ econf "${myeconfargs[@]}"
+}