* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2016-08-15 19:55 Lars Wendler
0 siblings, 0 replies; 6+ messages in thread
From: Lars Wendler @ 2016-08-15 19:55 UTC (permalink / raw
To: gentoo-commits
commit: 0ac0d1883b2fbb34f8b85995cf2ce651af4ef006
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 19:55:04 2016 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 19:55:18 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ac0d188
sys-apps/diffutils: Revbump to fix use-after-free bug in diff3 (bug #591044).
Package-Manager: portage-2.3.0
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.4-r1.ebuild | 50 +++++++++
.../files/diffutils-3.4-diff3_fix_leaks.patch | 123 +++++++++++++++++++++
.../files/diffutils-3.4-diff3_use_after_free.patch | 26 +++++
.../diffutils-3.4-no_color_on_dumb_terms.patch | 49 ++++++++
4 files changed, 248 insertions(+)
diff --git a/sys-apps/diffutils/diffutils-3.4-r1.ebuild b/sys-apps/diffutils/diffutils-3.4-r1.ebuild
new file mode 100644
index 0000000..43a9069
--- /dev/null
+++ b/sys-apps/diffutils/diffutils-3.4-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic
+
+DESCRIPTION="Tools to make diffs and compare files"
+HOMEPAGE="https://www.gnu.org/software/diffutils/"
+SRC_URI="mirror://gnu-alpha/diffutils/${P}.tar.xz
+ mirror://gnu/diffutils/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static"
+
+DEPEND="app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+
+DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
+
+PATCHES=(
+ "${FILESDIR}/${P}-no_color_on_dumb_terms.patch"
+ "${FILESDIR}/${P}-diff3_use_after_free.patch"
+ "${FILESDIR}/${P}-diff3_fix_leaks.patch"
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # Disable automagic dependency over libsigsegv; see bug #312351.
+ export ac_cv_libsigsegv=no
+
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR}" \
+ --with-packager-bug-reports="https://bugs.gentoo.org/" \
+ $(use_enable nls)
+}
+
+src_test() {
+ # explicitly allow parallel testing
+ emake check
+}
diff --git a/sys-apps/diffutils/files/diffutils-3.4-diff3_fix_leaks.patch b/sys-apps/diffutils/files/diffutils-3.4-diff3_fix_leaks.patch
new file mode 100644
index 0000000..fda8319
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.4-diff3_fix_leaks.patch
@@ -0,0 +1,123 @@
+From edd942ca27d570a33d612b12eecaa33a76640e46 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@fb.com>
+Date: Fri, 12 Aug 2016 21:40:29 -0700
+Subject: diff3: fix leaks, for real
+
+* src/diff3.c (struct diff_block)[lint]: Add member, n2.
+(free_diff_block, next_to_n2): New functions.
+---
+
+diff --git a/src/diff3.c b/src/diff3.c
+index 0eb643e..b80aeb3 100644
+--- a/src/diff3.c
++++ b/src/diff3.c
+@@ -78,6 +78,9 @@ struct diff_block {
+ char **lines[2]; /* The actual lines (may contain nulls) */
+ size_t *lengths[2]; /* Line lengths (including newlines, if any) */
+ struct diff_block *next;
++#ifdef lint
++ struct diff_block *n2; /* Used only when freeing. */
++#endif
+ };
+
+ /* Three way diff */
+@@ -176,7 +179,7 @@ static struct diff3_block *create_diff3_block (lin, lin, lin, lin, lin, lin);
+ static struct diff3_block *make_3way_diff (struct diff_block *, struct diff_block *);
+ static struct diff3_block *reverse_diff3_blocklist (struct diff3_block *);
+ static struct diff3_block *using_to_diff3_block (struct diff_block *[2], struct diff_block *[2], int, int, struct diff3_block const *);
+-static struct diff_block *process_diff (char const *, char const *, struct diff_block **);
++static struct diff_block *process_diff (char const *, char const *, struct diff_block **, char **);
+ static void check_stdout (void);
+ static void fatal (char const *) __attribute__((noreturn));
+ static void output_diff3 (FILE *, struct diff3_block *, int const[3], int const[3]);
+@@ -212,6 +215,38 @@ static struct option const longopts[] =
+ {0, 0, 0, 0}
+ };
+
++static void
++free_diff_block (struct diff_block *p)
++{
++#ifndef lint
++ (void)p;
++#else
++ while (p)
++ {
++ free (p->lines[0]);
++ free (p->lines[1]);
++ free (p->lengths[0]);
++ free (p->lengths[1]);
++ struct diff_block *next = p->n2;
++ free (p);
++ p = next;
++ }
++#endif
++}
++
++/* Copy each next pointer to n2, since make_3way_diff would clobber the former,
++ yet we will still need something to free these buffers. */
++static void
++next_to_n2 (struct diff_block *p)
++{
++#ifndef lint
++ (void)p;
++#else
++ while (p)
++ p = p->n2 = p->next;
++#endif
++}
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -377,10 +412,19 @@ main (int argc, char **argv)
+ /* Invoke diff twice on two pairs of input files, combine the two
+ diffs, and output them. */
+
++ char *b0, *b1;
+ commonname = file[rev_mapping[FILEC]];
+- thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block);
+- thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block);
++ thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block, &b1);
++ thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block, &b0);
++
++ next_to_n2 (thread0);
++ next_to_n2 (thread1);
++
+ diff3 = make_3way_diff (thread0, thread1);
++
++ free_diff_block (thread0);
++ free_diff_block (thread1);
++
+ if (edscript)
+ conflicts_found
+ = output_diff3_edscript (stdout, diff3, mapping, rev_mapping,
+@@ -400,6 +444,8 @@ main (int argc, char **argv)
+ conflicts_found = false;
+ }
+
++ free (b0);
++ free (b1);
+ check_stdout ();
+ exit (conflicts_found);
+ }
+@@ -938,7 +984,8 @@ compare_line_list (char * const list1[], size_t const lengths1[],
+ static struct diff_block *
+ process_diff (char const *filea,
+ char const *fileb,
+- struct diff_block **last_block)
++ struct diff_block **last_block,
++ char **buf_to_free)
+ {
+ char *diff_contents;
+ char *diff_limit;
+@@ -953,6 +1000,7 @@ process_diff (char const *filea,
+ sizeof *bptr->lengths[1]));
+
+ diff_limit = read_diff (filea, fileb, &diff_contents);
++ *buf_to_free = diff_contents;
+ scan_diff = diff_contents;
+
+ while (scan_diff < diff_limit)
+--
+cgit v1.0
+
diff --git a/sys-apps/diffutils/files/diffutils-3.4-diff3_use_after_free.patch b/sys-apps/diffutils/files/diffutils-3.4-diff3_use_after_free.patch
new file mode 100644
index 0000000..41a4b27
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.4-diff3_use_after_free.patch
@@ -0,0 +1,26 @@
+From 1a0df4396ebe3b9a58b882bb976cfce3f50d3cac Mon Sep 17 00:00:00 2001
+From: Bastian Beischer <bastian.beischer@rwth-aachen.de>
+Date: Sat, 13 Aug 2016 18:53:36 -0700
+Subject: diff3: fix heap use-after-free; add minimal diff3 test coverage
+
+Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an
+invalid use of free, leading to use-after-free in nearly any invocation
+of diff3. Revert that commit.
+Reported by Bastian Beischer in http://bugs.gnu.org/24210
+---
+
+diff --git a/src/diff3.c b/src/diff3.c
+index 6ef90f4..0eb643e 100644
+--- a/src/diff3.c
++++ b/src/diff3.c
+@@ -1039,7 +1039,6 @@ process_diff (char const *filea,
+
+ *block_list_end = NULL;
+ *last_block = bptr;
+- free (diff_contents);
+ return block_list;
+ }
+
+--
+cgit v1.0
+
diff --git a/sys-apps/diffutils/files/diffutils-3.4-no_color_on_dumb_terms.patch b/sys-apps/diffutils/files/diffutils-3.4-no_color_on_dumb_terms.patch
new file mode 100644
index 0000000..33f81e4
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.4-no_color_on_dumb_terms.patch
@@ -0,0 +1,49 @@
+From 697c1f4fa93ac971c487725e9e53fc211cd3c670 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@fb.com>
+Date: Mon, 8 Aug 2016 18:50:15 -0700
+Subject: diff: disable colorization for TERM=dumb
+
+* src/diff.c (main): With --color or --color=auto, when TERM is
+"dumb", disable colorization. Suggested by Daniel Colascione.
+* NEWS (Bug fixes): Mention it.
+* tests/colors: Add a test that would fail without this change,
+yet passes with it.
+---
+
+diff --git a/src/diff.c b/src/diff.c
+index 9bc1d96..686945e 100644
+--- a/src/diff.c
++++ b/src/diff.c
+@@ -656,6 +656,13 @@ main (int argc, char **argv)
+ prev = c;
+ }
+
++ if (colors_style == AUTO)
++ {
++ char const *t = getenv ("TERM");
++ if (t && STREQ (t, "dumb"))
++ colors_style = NEVER;
++ }
++
+ if (output_style == OUTPUT_UNSPECIFIED)
+ {
+ if (show_c_function)
+diff --git a/tests/colors b/tests/colors
+index 3ad2206..8651a5b 100755
+--- a/tests/colors
++++ b/tests/colors
+@@ -86,6 +86,11 @@ test $? = 1 || fail=1
+ gen_exp_default > exp || framework_failure_
+ compare exp out || fail=1
+
++TERM=dumb diff ---presume-output-tty --color=auto a b > out
++test $? = 1 || fail=1
++gen_exp_default > exp || framework_failure_
++compare exp out || fail=1
++
+ diff --color=never a b > out
+ test $? = 1 || fail=1
+ gen_exp_default > exp || framework_failure_
+--
+cgit v1.0
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2021-11-17 2:41 Georgy Yakovlev
0 siblings, 0 replies; 6+ messages in thread
From: Georgy Yakovlev @ 2021-11-17 2:41 UTC (permalink / raw
To: gentoo-commits
commit: 03757f59d10a55b3b97676aeb02ab9e1f1365aec
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 17 02:38:47 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed Nov 17 02:39:07 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03757f59
sys-apps/diffutils: add ppc32 musl patch
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.8.ebuild | 2 ++
sys-apps/diffutils/files/ppc-musl.patch | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/sys-apps/diffutils/diffutils-3.8.ebuild b/sys-apps/diffutils/diffutils-3.8.ebuild
index fc7ab80b4a3b..4cae3d13edc4 100644
--- a/sys-apps/diffutils/diffutils-3.8.ebuild
+++ b/sys-apps/diffutils/diffutils-3.8.ebuild
@@ -17,6 +17,8 @@ IUSE="nls static"
BDEPEND="nls? ( sys-devel/gettext )"
+PATCHES=( "${FILESDIR}/ppc-musl.patch" )
+
src_configure() {
use static && append-ldflags -static
diff --git a/sys-apps/diffutils/files/ppc-musl.patch b/sys-apps/diffutils/files/ppc-musl.patch
new file mode 100644
index 000000000000..6ba37f233591
--- /dev/null
+++ b/sys-apps/diffutils/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
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2022-04-25 10:11 WANG Xuerui
0 siblings, 0 replies; 6+ messages in thread
From: WANG Xuerui @ 2022-04-25 10:11 UTC (permalink / raw
To: gentoo-commits
commit: 1bff2846eaa16d29f9c023508d855931a727eebd
Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 25 04:10:31 2022 +0000
Commit: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 10:10:46 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bff2846
sys-apps/diffutils: fix build on loong
Upstream has updated gnulib but hasn't tagged a new release yet, so only
add the bare minimum to fix build on loong.
This has been inside loongson-overlay for a while, and is tested on real
loong hardware.
See: https://github.com/gentoo/gentoo/pull/25189
Acked-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.8.ebuild | 5 ++++-
sys-apps/diffutils/files/loong-fix-build.patch | 26 ++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/sys-apps/diffutils/diffutils-3.8.ebuild b/sys-apps/diffutils/diffutils-3.8.ebuild
index df2a985392fb..53a9433ee899 100644
--- a/sys-apps/diffutils/diffutils-3.8.ebuild
+++ b/sys-apps/diffutils/diffutils-3.8.ebuild
@@ -23,7 +23,10 @@ IUSE="nls static"
BDEPEND="nls? ( sys-devel/gettext )
verify-sig? ( sec-keys/openpgp-keys-diffutils )"
-PATCHES=( "${FILESDIR}/ppc-musl.patch" )
+PATCHES=(
+ "${FILESDIR}/ppc-musl.patch"
+ "${FILESDIR}/loong-fix-build.patch"
+)
src_configure() {
use static && append-ldflags -static
diff --git a/sys-apps/diffutils/files/loong-fix-build.patch b/sys-apps/diffutils/files/loong-fix-build.patch
new file mode 100644
index 000000000000..cd06fa8df5e4
--- /dev/null
+++ b/sys-apps/diffutils/files/loong-fix-build.patch
@@ -0,0 +1,26 @@
+From 34add045fd2ec3f1031dee961c4d9cc4285486a7 Mon Sep 17 00:00:00 2001
+From: Sun Haiyong <youbest@sina.com>
+Date: Tue, 31 Aug 2021 11:11:52 +0800
+Subject: [PATCH] stack-direction: Add support for loongarch CPU
+
+* m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
+set "sv_cv_stack_direction" to "-1" .
+---
+ m4/stack-direction.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
+index 93287254b..e6c3284ce 100644
+--- a/m4/stack-direction.m4
++++ b/m4/stack-direction.m4
+@@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
+ i?86 | x86_64 | \
+ i860 | \
+ ia64 | \
++ loongarch* | \
+ m32r | \
+ m68* | \
+ m88k | \
+--
+2.17.2
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2023-01-29 7:33 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-01-29 7:33 UTC (permalink / raw
To: gentoo-commits
commit: cc023c47f0a30174d43fb940109fce5781edda95
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 29 07:32:40 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 07:33:13 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc023c47
sys-apps/diffutils: fix tests w/ make 4.4
Closes: https://bugs.gentoo.org/879891
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.9.ebuild | 10 ++++++--
.../files/diffutils-3.9-make-4.4-test-color.patch | 30 ++++++++++++++++++++++
2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/sys-apps/diffutils/diffutils-3.9.ebuild b/sys-apps/diffutils/diffutils-3.9.ebuild
index ebbd0424d186..acce50bad293 100644
--- a/sys-apps/diffutils/diffutils-3.9.ebuild
+++ b/sys-apps/diffutils/diffutils-3.9.ebuild
@@ -27,8 +27,14 @@ LICENSE="GPL-2"
SLOT="0"
IUSE="nls static"
-BDEPEND="nls? ( sys-devel/gettext )
- verify-sig? ( sec-keys/openpgp-keys-diffutils )"
+BDEPEND="
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-diffutils )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-make-4.4-test-color.patch
+)
src_configure() {
use static && append-ldflags -static
diff --git a/sys-apps/diffutils/files/diffutils-3.9-make-4.4-test-color.patch b/sys-apps/diffutils/files/diffutils-3.9-make-4.4-test-color.patch
new file mode 100644
index 000000000000..01f6aeedc956
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.9-make-4.4-test-color.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/879891
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59905
+https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=89f3daeaaf021a77177daec8666bcd80ec476833
+
+From 89f3daeaaf021a77177daec8666bcd80ec476833 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@fb.com>
+Date: Mon, 16 Jan 2023 15:48:10 -0800
+Subject: tests: accommodate newer GNU make's SIGPIPE-ignore
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* tests/colors: Allow an exit code of not just 141 (SIGPIPE),
+but also "error": 2.
+Reported by Tomasz Kłoczko in http://bugs.gnu.org/59905.
+--- a/tests/colors
++++ b/tests/colors
+@@ -128,6 +128,9 @@ printf '%1000000s-a' > a
+ printf '%1000000s-b' > b
+ head -c 10 < fifo > /dev/null &
+ diff --color=always ---presume-output-tty a b > fifo
+-test $? = 141 || fail=1
++
++# Depending on version of GNU make (4.3.92-4.4 set SIGPIPE to "ignore"),
++# either of these is acceptable.
++case $? in 2|141) ;; *) fail=1 ;; esac
+
+ Exit $fail
+--
+cgit v1.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2023-02-12 6:22 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-02-12 6:22 UTC (permalink / raw
To: gentoo-commits
commit: 675f20bce1d8ec148072e6447dc4a365d2c9936a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:18:03 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:18:03 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=675f20bc
sys-apps/diffutils: backport regression fix for -D
This also fixes the groff tests.
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.9-r1.ebuild | 58 ++++++++++++++++++++++
.../diffutils-3.9-diff-D-option-regression.patch | 27 ++++++++++
2 files changed, 85 insertions(+)
diff --git a/sys-apps/diffutils/diffutils-3.9-r1.ebuild b/sys-apps/diffutils/diffutils-3.9-r1.ebuild
new file mode 100644
index 000000000000..b33f99dcdb75
--- /dev/null
+++ b/sys-apps/diffutils/diffutils-3.9-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/diffutils.asc
+inherit flag-o-matic verify-sig
+
+DESCRIPTION="Tools to make diffs and compare files"
+HOMEPAGE="https://www.gnu.org/software/diffutils/"
+
+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="43-2d50"
+ MY_P=${PN}-$(ver_cut 1-2).${MY_COMMIT}
+ SRC_URI="https://meyering.net/diff/${MY_P}.tar.xz"
+ SRC_URI+=" verify-sig? ( https://meyering.net/diff/${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 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls static"
+
+BDEPEND="
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-diffutils )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-make-4.4-test-color.patch
+ "${FILESDIR}"/${P}-diff-D-option-regression.patch
+)
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # Disable automagic dependency over libsigsegv; see bug #312351.
+ export ac_cv_libsigsegv=no
+
+ # required for >=glibc-2.26, bug #653914
+ use elibc_glibc && export gl_cv_func_getopt_gnu=yes
+
+ local myeconfargs=(
+ # Interferes with F_S (sets F_S=2)
+ --disable-gcc-warnings
+ --with-packager="Gentoo"
+ --with-packager-version="${PVR}"
+ --with-packager-bug-reports="https://bugs.gentoo.org/"
+ $(use_enable nls)
+ )
+ econf "${myeconfargs[@]}"
+}
diff --git a/sys-apps/diffutils/files/diffutils-3.9-diff-D-option-regression.patch b/sys-apps/diffutils/files/diffutils-3.9-diff-D-option-regression.patch
new file mode 100644
index 000000000000..a12e1bc673a0
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.9-diff-D-option-regression.patch
@@ -0,0 +1,27 @@
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61193
+https://git.savannah.gnu.org/cgit/groff.git/commit/?id=10274fb69e517b2c4b10fcd0ba3347e5bd0eefd7
+https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=ba08fbbb0ca5da455bf695236c57bc50e7faed50
+
+From ba08fbbb0ca5da455bf695236c57bc50e7faed50 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Fri, 10 Feb 2023 15:33:40 -0800
+Subject: diff: fix bug where -D does not work
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Problem reported by Robert Webb (bug#61193).
+* src/diff.c (main): Omit stray ‘sizeof’.
+* tests/ifdef: New test.
+* tests/Makefile.am (TESTS): Add it.
+--- a/src/diff.c
++++ b/src/diff.c
+@@ -416,7 +416,7 @@ main (int argc, char **argv)
+ char *base = b;
+ int changes = 0;
+
+- for (i = 0; i < sizeof sizeof C_ifdef_group_formats; i++)
++ for (i = 0; i < sizeof C_ifdef_group_formats; i++)
+ {
+ char ch = C_ifdef_group_formats[i];
+ switch (ch)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/
@ 2025-03-14 6:46 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2025-03-14 6:46 UTC (permalink / raw
To: gentoo-commits
commit: 277ce2dbccc1a02ddf2676c0ce4c39683b49de2f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 14 06:45:49 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 14 06:45:49 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=277ce2db
sys-apps/diffutils: backport regression fixes to 3.11
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/diffutils/diffutils-3.11-r2.ebuild | 67 +++++++++++++++++
.../files/diffutils-3.11-allocation-crash.patch | 29 ++++++++
.../files/diffutils-3.11-empty-files.patch | 83 ++++++++++++++++++++++
.../diffutils/files/diffutils-3.11-tests-seq.patch | 64 +++++++++++++++++
4 files changed, 243 insertions(+)
diff --git a/sys-apps/diffutils/diffutils-3.11-r2.ebuild b/sys-apps/diffutils/diffutils-3.11-r2.ebuild
new file mode 100644
index 000000000000..22e8514a4f1f
--- /dev/null
+++ b/sys-apps/diffutils/diffutils-3.11-r2.ebuild
@@ -0,0 +1,67 @@
+# 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/diffutils.asc
+inherit verify-sig
+
+DESCRIPTION="Tools to make diffs and compare files"
+HOMEPAGE="https://www.gnu.org/software/diffutils/"
+
+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="242-d65b"
+ MY_P=${PN}-$(ver_cut 1-2).${MY_COMMIT}
+ SRC_URI="https://meyering.net/diff/${MY_P}.tar.xz"
+ SRC_URI+=" verify-sig? ( https://meyering.net/diff/${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 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls"
+
+BDEPEND="
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-diffutils )
+"
+RDEPEND="
+ nls? ( app-i18n/gnulib-l10n )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-empty-files.patch
+ "${FILESDIR}"/${P}-tests-seq.patch
+ "${FILESDIR}"/${P}-allocation-crash.patch
+)
+
+src_prepare() {
+ default
+
+ # Needed because of ${P}-diff-D-option-regression.patch
+ #touch man/diff.1 || die
+}
+
+src_configure() {
+ # Disable automagic dependency over libsigsegv; see bug #312351.
+ export ac_cv_libsigsegv=no
+
+ # required for >=glibc-2.26, bug #653914
+ use elibc_glibc && export gl_cv_func_getopt_gnu=yes
+
+ local myeconfargs=(
+ # Interferes with F_S (sets F_S=2)
+ --disable-gcc-warnings
+ --with-packager="Gentoo"
+ --with-packager-version="${PVR}"
+ --with-packager-bug-reports="https://bugs.gentoo.org/"
+ $(use_enable nls)
+ )
+ econf "${myeconfargs[@]}"
+}
diff --git a/sys-apps/diffutils/files/diffutils-3.11-allocation-crash.patch b/sys-apps/diffutils/files/diffutils-3.11-allocation-crash.patch
new file mode 100644
index 000000000000..3f80cd7e7c69
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.11-allocation-crash.patch
@@ -0,0 +1,29 @@
+https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=e9f8e6a439fd607adbdd846ab93267dc367b5c79
+
+From e9f8e6a439fd607adbdd846ab93267dc367b5c79 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Fri, 28 Feb 2025 22:53:28 -0800
+Subject: diff: fix allocation typo leading to crashes
+
+But reported by Nick Smallbone, with one-line fix by
+Collin Funk <https://bugs.gnu.org/76613>.
+* src/io.c (find_and_hash_each_line): Fix size computation.
+---
+ src/io.c | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/io.c
++++ b/src/io.c
+@@ -1012,7 +1012,7 @@ find_and_hash_each_line (struct file_data *current)
+ linbuf += linbuf_base;
+ linbuf = xpalloc (linbuf, &n, 1, -1, sizeof *linbuf);
+ linbuf -= linbuf_base;
+- alloc_lines = n - linbuf_base;
++ alloc_lines = linbuf_base + n;
+ }
+ linbuf[line] = p;
+
+--
+cgit v1.1
+
+
diff --git a/sys-apps/diffutils/files/diffutils-3.11-empty-files.patch b/sys-apps/diffutils/files/diffutils-3.11-empty-files.patch
new file mode 100644
index 000000000000..1f78bce8d972
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.11-empty-files.patch
@@ -0,0 +1,83 @@
+https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=6ce0ebd033c395265c262ae3aab6477a49d4c2f1
+
+From 6ce0ebd033c395265c262ae3aab6477a49d4c2f1 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 20 Feb 2025 21:59:55 -0800
+Subject: diff: don't treat empty files as a different file type
+
+Reported by Kate Deplaix <kit-ty-kate@outlook.com> in
+<https://lists.gnu.org/r/bug-diffutils/2025-02/msg00005.html>.
+
+* src/diff.c (compare_prepped_files): Don't rely on string
+file type, as that might not agree with our idea of a file type.
+---
+ src/diff.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/diff.c b/src/diff.c
+index fa6100e..6e1bbc5 100644
+--- a/src/diff.c
++++ b/src/diff.c
+@@ -1223,14 +1223,14 @@ compare_prepped_files (struct comparison const *parent,
+ the type is unusual, then simply report their type.
+ However, at the top level do this only if one file is a symlink
+ and the other is not. */
+- if (toplevel
+- ? (!S_ISLNK (cmp->file[0].stat.st_mode)
+- != !S_ISLNK (cmp->file[1].stat.st_mode))
+- : (cmp->file[0].filetype != cmp->file[1].filetype
+- || ! (S_ISREG (cmp->file[0].stat.st_mode)
+- || S_ISLNK (cmp->file[0].stat.st_mode)
+- || S_ISCHR (cmp->file[0].stat.st_mode)
+- || S_ISBLK (cmp->file[0].stat.st_mode))))
++ mode_t mode0 = cmp->file[0].stat.st_mode;
++ mode_t mode1 = cmp->file[1].stat.st_mode;
++ if (toplevel ? !S_ISLNK (mode0) != !S_ISLNK (mode1)
++ : S_ISREG (mode0) ? !S_ISREG (mode1)
++ : S_ISLNK (mode0) ? !S_ISLNK (mode1)
++ : S_ISCHR (mode0) ? !S_ISCHR (mode1)
++ : S_ISBLK (mode0) ? !S_ISBLK (mode1)
++ : true)
+ {
+ /* POSIX 1003.1-2017 says any message will do, so long as it
+ contains the file names. */
+@@ -1244,7 +1244,7 @@ compare_prepped_files (struct comparison const *parent,
+ }
+
+ /* If both files are symlinks, compare symlink contents. */
+- if (S_ISLNK (cmp->file[0].stat.st_mode))
++ if (S_ISLNK (mode0))
+ {
+ /* We get here only if we are not dereferencing symlinks. */
+ dassert (no_dereference_symlinks);
+@@ -1295,7 +1295,7 @@ compare_prepped_files (struct comparison const *parent,
+ and report file types of all other non-regular files.
+ POSIX 1003.1-2017 says any message will do,
+ so long as it contains the file names. */
+- if (!toplevel && !S_ISREG (cmp->file[0].stat.st_mode))
++ if (!toplevel && !S_ISREG (mode0))
+ {
+ if (cmp->file[0].stat.st_rdev == cmp->file[1].stat.st_rdev)
+ return EXIT_SUCCESS;
+@@ -1311,7 +1311,7 @@ compare_prepped_files (struct comparison const *parent,
+ for (int i = 0; i < n_num; i++)
+ sprintf (numbuf[i], "%"PRIdMAX, num[i]);
+
+- message ((S_ISCHR (cmp->file[0].stat.st_mode)
++ message ((S_ISCHR (mode0)
+ ? ("Character special files %s (%s, %s)"
+ " and %s (%s, %s) differ\n")
+ : ("Block special files %s (%s, %s)"
+@@ -1323,8 +1323,8 @@ compare_prepped_files (struct comparison const *parent,
+ }
+
+ if (files_can_be_treated_as_binary
+- && S_ISREG (cmp->file[0].stat.st_mode)
+- && S_ISREG (cmp->file[1].stat.st_mode)
++ && S_ISREG (mode0)
++ && S_ISREG (mode1)
+ && cmp->file[0].stat.st_size != cmp->file[1].stat.st_size
+ && 0 <= cmp->file[0].stat.st_size
+ && 0 <= cmp->file[1].stat.st_size)
+--
+cgit v1.1
diff --git a/sys-apps/diffutils/files/diffutils-3.11-tests-seq.patch b/sys-apps/diffutils/files/diffutils-3.11-tests-seq.patch
new file mode 100644
index 000000000000..407b76ac05f7
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.11-tests-seq.patch
@@ -0,0 +1,64 @@
+https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=58e734dedd2ed84b559c313b4fbe8e2a1b987a1d
+
+From 58e734dedd2ed84b559c313b4fbe8e2a1b987a1d Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Fri, 28 Feb 2025 14:32:44 -0800
+Subject: tests: make seq replacement more available
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This refactoring should let other future tests use ‘seq’.
+* tests/diff3 (seq): Move from here ...
+* tests/init.cfg: ... to here.
+---
+ tests/diff3 | 12 ------------
+ tests/init.cfg | 12 ++++++++++++
+ 2 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/diff3 b/tests/diff3
+index e468243..c2079ec 100644
+--- a/tests/diff3
++++ b/tests/diff3
+@@ -3,18 +3,6 @@
+
+ . "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+-# Some systems lack seq.
+-# A limited replacement for seq: handle 1 or 2 args; increment must be 1
+-seq()
+-{
+- case $# in
+- 1) start=1 final=$1;;
+- 2) start=$1 final=$2;;
+- *) echo you lose 1>&2; exit 1;;
+- esac
+- awk 'BEGIN{for(i='$start';i<='$final';i++) print i}' < /dev/null
+-}
+-
+ echo a > a || framework_failure_
+ echo b > b || framework_failure_
+ echo c > c || framework_failure_
+diff --git a/tests/init.cfg b/tests/init.cfg
+index 8b3b107..66c26d6 100644
+--- a/tests/init.cfg
++++ b/tests/init.cfg
+@@ -120,4 +120,16 @@ require_utf8_locale_()
+ test $found_working_tr = 1 || skip_ "failed to find a working tr program"
+ }
+
++# Some systems lack seq.
++# A limited replacement for seq: handle 1 or 2 args; increment must be 1
++seq()
++{
++ case $# in
++ 1) start=1 final=$1;;
++ 2) start=$1 final=$2;;
++ *) echo you lose 1>&2; exit 1;;
++ esac
++ awk 'BEGIN{for(i='$start';i<='$final';i++) print i}' < /dev/null
++}
++
+ sanitize_path_
+--
+cgit v1.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-14 6:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-15 19:55 [gentoo-commits] repo/gentoo:master commit in: sys-apps/diffutils/files/, sys-apps/diffutils/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2021-11-17 2:41 Georgy Yakovlev
2022-04-25 10:11 WANG Xuerui
2023-01-29 7:33 Sam James
2023-02-12 6:22 Sam James
2025-03-14 6:46 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox