From 96115b78aaf3178953f91e1e02971e6004561f00 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 5 Jul 2023 09:02:15 +0200 Subject: [PATCH 01/15] Fix output of "diff -l -y" for non-ASCII input files --- ...of-diff-l-y-for-non-ASCII-input-file.patch | 27 +++++++++++++++++++ diffutils.spec | 7 ++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch diff --git a/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch b/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch new file mode 100644 index 0000000..83c6b73 --- /dev/null +++ b/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch @@ -0,0 +1,27 @@ +From cb52fa88d5f2d9bc4894a7eccd90fdc2e03f5af4 Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Tue, 4 Jul 2023 18:45:33 +0200 +Subject: [PATCH] diff: Fix output of "diff -l -y" for non-ASCII input files + +* src/side.c (print_half_line): Output the multibyte character to out, +not stdout. +--- + src/side.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/side.c b/src/side.c +index 2f566f8..46ef095 100644 +--- a/src/side.c ++++ b/src/side.c +@@ -146,7 +146,7 @@ print_half_line (char const *const *line, intmax_t indent, intmax_t out_bound) + if (in_position <= out_bound) + { + out_position = in_position; +- fwrite (tp0, 1, bytes, stdout); ++ fwrite (tp0, 1, bytes, out); + } + text_pointer = tp0 + bytes; + break; +-- +2.34.1 + diff --git a/diffutils.spec b/diffutils.spec index a4b1bef..5ad3376 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,10 +1,11 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Patch0: diffutils-i18n.patch +Patch1: 0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -29,6 +30,7 @@ Install diffutils if you need to compare text files. %setup -q # Multibyte %patch -P0 -p1 -b .i18n +%patch -P1 -p1 -b .fix-output-of-diff-l-y-for-non-ASCII-input-file # Run autoreconf for aarch64 support (bug #925256). autoreconf @@ -56,6 +58,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Wed Jul 05 2023 Than Ngo - 3.10-2 +- Fix output of "diff -l -y" for non-ASCII input files + * Thu Jun 29 2023 Than Ngo - 3.10-1 - Fix bz#2208831, update to 3.10 - Fix bz#2196671, diff -D no longer fails to output #ifndef lines introduced in 3.9 From 0ea6b505117f1b2181c48aea18346d7c6823a45e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 17:28:45 +0000 Subject: [PATCH 02/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index 5ad3376..198f52c 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 2%{?dist} +Release: 3%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Patch0: diffutils-i18n.patch @@ -58,6 +58,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Wed Jul 19 2023 Fedora Release Engineering - 3.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jul 05 2023 Than Ngo - 3.10-2 - Fix output of "diff -l -y" for non-ASCII input files From 22cf0d6a15bdb09fb8731a468b66d44c73ea2113 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 17:10:49 +0000 Subject: [PATCH 03/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index 198f52c..fa3984a 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 3%{?dist} +Release: 4%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Patch0: diffutils-i18n.patch @@ -58,6 +58,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 3.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Jul 19 2023 Fedora Release Engineering - 3.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 9421e38500804f1f240a96036d03ac6d1960df6a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jan 2024 09:27:34 +0000 Subject: [PATCH 04/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index fa3984a..cde3384 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 4%{?dist} +Release: 5%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Patch0: diffutils-i18n.patch @@ -58,6 +58,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Wed Jan 24 2024 Fedora Release Engineering - 3.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 3.10-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 33ebdf4509ab5887b48cf702619cc92911c1ec57 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 20:59:36 +0000 Subject: [PATCH 05/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index cde3384..2aec6e5 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 5%{?dist} +Release: 6%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Patch0: diffutils-i18n.patch @@ -58,6 +58,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 3.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jan 24 2024 Fedora Release Engineering - 3.10-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 112f3556e3c802293668e54571cebcbf84b91b64 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 24 Jul 2024 11:59:20 +0200 Subject: [PATCH 06/15] fix a regression, cmp-s returns 1 even if files are identical --- diffutils-3.10-cmp-s-empty.patch | 19 +++++++++++++++++++ diffutils.spec | 12 +++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 diffutils-3.10-cmp-s-empty.patch diff --git a/diffutils-3.10-cmp-s-empty.patch b/diffutils-3.10-cmp-s-empty.patch new file mode 100644 index 0000000..80bd4b9 --- /dev/null +++ b/diffutils-3.10-cmp-s-empty.patch @@ -0,0 +1,19 @@ +diff -up diffutils-3.10/src/cmp.c.orig diffutils-3.10/src/cmp.c +--- diffutils-3.10/src/cmp.c.orig 2024-07-23 12:27:16.243455513 +0200 ++++ diffutils-3.10/src/cmp.c 2024-07-23 12:31:55.560196269 +0200 +@@ -343,12 +343,13 @@ main (int argc, char **argv) + + /* If only a return code is needed, + and if both input descriptors are associated with plain files, ++ and if both files are larger than 0 bytes (procfs files are always 0), + conclude that the files differ if they have different sizes + and if more bytes will be compared than are in the smaller file. */ + + if (comparison_type == type_status +- && 0 <= stat_buf[0].st_size && S_ISREG (stat_buf[0].st_mode) +- && 0 <= stat_buf[1].st_size && S_ISREG (stat_buf[1].st_mode)) ++ && 0 < stat_buf[0].st_size && S_ISREG (stat_buf[0].st_mode) ++ && 0 < stat_buf[1].st_size && S_ISREG (stat_buf[1].st_mode)) + { + off_t s0 = stat_buf[0].st_size - file_position (0); + off_t s1 = stat_buf[1].st_size - file_position (1); diff --git a/diffutils.spec b/diffutils.spec index 2aec6e5..d17ceb7 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,11 +1,13 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 6%{?dist} +Release: 7%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz +# Multibyte Patch0: diffutils-i18n.patch Patch1: 0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch +Patch2: diffutils-3.10-cmp-s-empty.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -27,10 +29,7 @@ to merge two files interactively. Install diffutils if you need to compare text files. %prep -%setup -q -# Multibyte -%patch -P0 -p1 -b .i18n -%patch -P1 -p1 -b .fix-output-of-diff-l-y-for-non-ASCII-input-file +%autosetup -p1 # Run autoreconf for aarch64 support (bug #925256). autoreconf @@ -58,6 +57,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Tue Jul 23 2024 Than Ngo - 3.10-7 +- fix a regression, cmp-s returns 1 even if files are identical + * Wed Jul 17 2024 Fedora Release Engineering - 3.10-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From efeeb64f37b6f1b38861fbb4d3a463ed7b6553fa Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 30 Jul 2024 10:39:36 +0200 Subject: [PATCH 07/15] refresh patch for 'cmp -s' --- ...of-diff-l-y-for-non-ASCII-input-file.patch | 27 -------- diffutils-3.10-cmp-s-empty.patch | 66 +++++++++++++++++-- diffutils.spec | 10 +-- 3 files changed, 66 insertions(+), 37 deletions(-) delete mode 100644 0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch diff --git a/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch b/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch deleted file mode 100644 index 83c6b73..0000000 --- a/0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch +++ /dev/null @@ -1,27 +0,0 @@ -From cb52fa88d5f2d9bc4894a7eccd90fdc2e03f5af4 Mon Sep 17 00:00:00 2001 -From: Bruno Haible -Date: Tue, 4 Jul 2023 18:45:33 +0200 -Subject: [PATCH] diff: Fix output of "diff -l -y" for non-ASCII input files - -* src/side.c (print_half_line): Output the multibyte character to out, -not stdout. ---- - src/side.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/side.c b/src/side.c -index 2f566f8..46ef095 100644 ---- a/src/side.c -+++ b/src/side.c -@@ -146,7 +146,7 @@ print_half_line (char const *const *line, intmax_t indent, intmax_t out_bound) - if (in_position <= out_bound) - { - out_position = in_position; -- fwrite (tp0, 1, bytes, stdout); -+ fwrite (tp0, 1, bytes, out); - } - text_pointer = tp0 + bytes; - break; --- -2.34.1 - diff --git a/diffutils-3.10-cmp-s-empty.patch b/diffutils-3.10-cmp-s-empty.patch index 80bd4b9..2d05602 100644 --- a/diffutils-3.10-cmp-s-empty.patch +++ b/diffutils-3.10-cmp-s-empty.patch @@ -1,11 +1,42 @@ -diff -up diffutils-3.10/src/cmp.c.orig diffutils-3.10/src/cmp.c ---- diffutils-3.10/src/cmp.c.orig 2024-07-23 12:27:16.243455513 +0200 -+++ diffutils-3.10/src/cmp.c 2024-07-23 12:31:55.560196269 +0200 -@@ -343,12 +343,13 @@ main (int argc, char **argv) +commit ff1096a0c24c3a302a58864392270e6622e21a03 +Author: Paul Eggert +Date: Wed Jun 21 11:19:13 2023 -0700 + + cmp: fix -s bug when comparing /proc files + + * NEWS: Mention this. + * src/cmp.c (main, cmp): Do not trust st_size == 0, as it may + be a /proc file. + * tests/brief-vs-stat-zero-kernel-lies: Also test cmp -s. + +diff --git a/NEWS b/NEWS +index 0b7cf48..00ee5b6 100644 +--- a/NEWS ++++ b/NEWS +@@ -10,6 +10,12 @@ GNU diffutils NEWS -*- outline -*- + cmp/diff can again work with file dates past Y2K38 + [bug introduced in 3.9] + ++ cmp -s no longer mishandles /proc files, for which the Linux kernel ++ reports a zero size even when nonempty. For example, the following ++ shell command now outputs nothing, as it should: ++ cp /proc/cmdline t; cmp -s /proc/cmdline t || echo files differ ++ [bug present since "the beginning"] ++ + diff -D no longer fails to output #ifndef lines. + [bug#61193 introduced in 3.9] + +diff --git a/src/cmp.c b/src/cmp.c +index 4bf0a4c..936125c 100644 +--- a/src/cmp.c ++++ b/src/cmp.c +@@ -338,13 +338,14 @@ main (int argc, char **argv) + } /* If only a return code is needed, - and if both input descriptors are associated with plain files, -+ and if both files are larger than 0 bytes (procfs files are always 0), +- and if both input descriptors are associated with plain files, ++ and both input descriptors are associated with plain files, ++ and the file sizes are nonzero so they are not Linux /proc files, conclude that the files differ if they have different sizes and if more bytes will be compared than are in the smaller file. */ @@ -17,3 +48,26 @@ diff -up diffutils-3.10/src/cmp.c.orig diffutils-3.10/src/cmp.c { off_t s0 = stat_buf[0].st_size - file_position (0); off_t s1 = stat_buf[1].st_size - file_position (1); +@@ -401,7 +402,7 @@ cmp (void) + ? bytes : TYPE_MAXIMUM (off_t)); + + for (f = 0; f < 2; f++) +- if (0 <= stat_buf[f].st_size && S_ISREG (stat_buf[f].st_mode)) ++ if (0 < stat_buf[f].st_size && S_ISREG (stat_buf[f].st_mode)) + { + off_t file_bytes = stat_buf[f].st_size - file_position (f); + if (file_bytes < byte_number_max) +diff --git a/tests/brief-vs-stat-zero-kernel-lies b/tests/brief-vs-stat-zero-kernel-lies +index 82b33e6..7cc2dc7 100755 +--- a/tests/brief-vs-stat-zero-kernel-lies ++++ b/tests/brief-vs-stat-zero-kernel-lies +@@ -35,4 +35,9 @@ printf 'diff\0--brief\0/proc/self/cmdline\0bin\0' > bin || framework_failure_ + diff --brief /proc/self/cmdline bin > out 2>&1 || fail=1 + compare /dev/null out || fail=1 + ++# Similarly for cmp -s. ++printf 'cmp\0-s\0/proc/self/cmdline\0bin\0' > bin || framework_failure_ ++cmp -s /proc/self/cmdline bin > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ + Exit $fail diff --git a/diffutils.spec b/diffutils.spec index d17ceb7..e4fcd90 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,13 +1,12 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 7%{?dist} +Release: 8%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # Multibyte Patch0: diffutils-i18n.patch -Patch1: 0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch -Patch2: diffutils-3.10-cmp-s-empty.patch +Patch1: diffutils-3.10-cmp-s-empty.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -57,8 +56,11 @@ make check %{_infodir}/diffutils.info* %changelog +* Tue Jul 30 2024 Than Ngo - 3.10-8 +- refresh patch for 'cmp -s' + * Tue Jul 23 2024 Than Ngo - 3.10-7 -- fix a regression, cmp-s returns 1 even if files are identical +- fix a regression, 'cmp -s' returns 1 even if files are identical * Wed Jul 17 2024 Fedora Release Engineering - 3.10-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 0d56b9fccf696018c3b4ff28984d36603de6b9a0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 15:46:32 +0000 Subject: [PATCH 08/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index e4fcd90..ee969b4 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.10 -Release: 8%{?dist} +Release: 9%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # Multibyte @@ -56,6 +56,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 3.10-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Tue Jul 30 2024 Than Ngo - 3.10-8 - refresh patch for 'cmp -s' From e55ec778c3e9a38fccf8658aaa689d33502b5436 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 27 Mar 2025 12:22:44 +0100 Subject: [PATCH 09/15] Fixed rhbz#2343469, Update to 3.11 --- .gitignore | 1 + diffutils-3.10-cmp-s-empty.patch | 73 --- diffutils-3.10.tar.xz.sig | 16 - diffutils-3.11.tar.xz.sig | 16 + diffutils-i18n.patch | 779 ------------------------------- diffutils.spec | 10 +- sources | 2 +- 7 files changed, 23 insertions(+), 874 deletions(-) delete mode 100644 diffutils-3.10-cmp-s-empty.patch delete mode 100644 diffutils-3.10.tar.xz.sig create mode 100644 diffutils-3.11.tar.xz.sig delete mode 100644 diffutils-i18n.patch diff --git a/.gitignore b/.gitignore index 48b1e37..3f6ce78 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ diffutils-2.8.1.tar.gz /diffutils-3.8.tar.xz /diffutils-3.9.tar.xz /diffutils-3.10.tar.xz +/diffutils-3.11.tar.xz diff --git a/diffutils-3.10-cmp-s-empty.patch b/diffutils-3.10-cmp-s-empty.patch deleted file mode 100644 index 2d05602..0000000 --- a/diffutils-3.10-cmp-s-empty.patch +++ /dev/null @@ -1,73 +0,0 @@ -commit ff1096a0c24c3a302a58864392270e6622e21a03 -Author: Paul Eggert -Date: Wed Jun 21 11:19:13 2023 -0700 - - cmp: fix -s bug when comparing /proc files - - * NEWS: Mention this. - * src/cmp.c (main, cmp): Do not trust st_size == 0, as it may - be a /proc file. - * tests/brief-vs-stat-zero-kernel-lies: Also test cmp -s. - -diff --git a/NEWS b/NEWS -index 0b7cf48..00ee5b6 100644 ---- a/NEWS -+++ b/NEWS -@@ -10,6 +10,12 @@ GNU diffutils NEWS -*- outline -*- - cmp/diff can again work with file dates past Y2K38 - [bug introduced in 3.9] - -+ cmp -s no longer mishandles /proc files, for which the Linux kernel -+ reports a zero size even when nonempty. For example, the following -+ shell command now outputs nothing, as it should: -+ cp /proc/cmdline t; cmp -s /proc/cmdline t || echo files differ -+ [bug present since "the beginning"] -+ - diff -D no longer fails to output #ifndef lines. - [bug#61193 introduced in 3.9] - -diff --git a/src/cmp.c b/src/cmp.c -index 4bf0a4c..936125c 100644 ---- a/src/cmp.c -+++ b/src/cmp.c -@@ -338,13 +338,14 @@ main (int argc, char **argv) - } - - /* If only a return code is needed, -- and if both input descriptors are associated with plain files, -+ and both input descriptors are associated with plain files, -+ and the file sizes are nonzero so they are not Linux /proc files, - conclude that the files differ if they have different sizes - and if more bytes will be compared than are in the smaller file. */ - - if (comparison_type == type_status -- && 0 <= stat_buf[0].st_size && S_ISREG (stat_buf[0].st_mode) -- && 0 <= stat_buf[1].st_size && S_ISREG (stat_buf[1].st_mode)) -+ && 0 < stat_buf[0].st_size && S_ISREG (stat_buf[0].st_mode) -+ && 0 < stat_buf[1].st_size && S_ISREG (stat_buf[1].st_mode)) - { - off_t s0 = stat_buf[0].st_size - file_position (0); - off_t s1 = stat_buf[1].st_size - file_position (1); -@@ -401,7 +402,7 @@ cmp (void) - ? bytes : TYPE_MAXIMUM (off_t)); - - for (f = 0; f < 2; f++) -- if (0 <= stat_buf[f].st_size && S_ISREG (stat_buf[f].st_mode)) -+ if (0 < stat_buf[f].st_size && S_ISREG (stat_buf[f].st_mode)) - { - off_t file_bytes = stat_buf[f].st_size - file_position (f); - if (file_bytes < byte_number_max) -diff --git a/tests/brief-vs-stat-zero-kernel-lies b/tests/brief-vs-stat-zero-kernel-lies -index 82b33e6..7cc2dc7 100755 ---- a/tests/brief-vs-stat-zero-kernel-lies -+++ b/tests/brief-vs-stat-zero-kernel-lies -@@ -35,4 +35,9 @@ printf 'diff\0--brief\0/proc/self/cmdline\0bin\0' > bin || framework_failure_ - diff --brief /proc/self/cmdline bin > out 2>&1 || fail=1 - compare /dev/null out || fail=1 - -+# Similarly for cmp -s. -+printf 'cmp\0-s\0/proc/self/cmdline\0bin\0' > bin || framework_failure_ -+cmp -s /proc/self/cmdline bin > out 2>&1 || fail=1 -+compare /dev/null out || fail=1 -+ - Exit $fail diff --git a/diffutils-3.10.tar.xz.sig b/diffutils-3.10.tar.xz.sig deleted file mode 100644 index 3eaf7e9..0000000 --- a/diffutils-3.10.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAmRp3HUACgkQf9n8ywAL -7u5uJA/+MAaQc6ovuxdBJomue6M+KkLLjUhlA5GILfVmV1Jr99P+ke8QlKmr5kOX -q9xxGJS+Rkp4coEqtuS+lKnhRoXq2OhYuO439zrm3BKOz9il9gR7yd2hN21zEQ3I -kW+TEqjswawOh9wpubCk/C5WozxSLSVu3nUefF3rzVDGwNtG73Z4etDpTQ0OXCYw -9Owy3F7Bmnxg0Ae/ETkZ/l95zPOAGUXGNrHYJ5KaxT5AJVbeNAgqlP2SWQmyBX8m -Ui6ffjvjn8tr99uAZUoD64FDehQ6xPIS7uknuQ9yUMa6SR4877Axhaekfy0pwR6j -lKSZI2PAJqufaVCnlM8ZQzDleHHqbKUD8cvbjW2upPg0Ow6Ppu/VFnFAgtREQnIP -Wd6WdRil7WVcglrurPGiykENrRG204ZGIEauZkUgsSB9ONZKgEt13jsu7PAQn+Qf -vGQf7/sk3+eRMIhkglPgJVDqV36GlYkxt0MDe2yJ3tsu7ZUzREYSQ8m8EcUdJ3h1 -xqFqaIpxxNzvyn7WtNeu3Ej1dD+lGTj8osLmGzSnCQ7eaFghtKJuUoTLnd0rcD9N -gW60pBb4DBEiPcAwqYmVmVwYKJ/afPf2qjfCDJDDm+nVHHPKeitzVNCnRVvnzJZc -55BV6ftNOHLV/H6Q7LDG9bF/WQR0HPu9UatdpYNUyggh45a3jlc= -=cXRh ------END PGP SIGNATURE----- diff --git a/diffutils-3.11.tar.xz.sig b/diffutils-3.11.tar.xz.sig new file mode 100644 index 0000000..d4330a6 --- /dev/null +++ b/diffutils-3.11.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAmegTMoACgkQf9n8ywAL +7u4/Hw/+Krffku9ToMb9l4rGs1s8cNFLs8xReYwCUe7MR1Wz7wi4UOhfWQWeuBEQ +SWQQBbvQg05H9AFSL/Bs8EgPNr0UqF413XdGMvf4s+lJ5OffOZkmOkdWGTUAa1iG +eTXpL19/dYGdAqhWcmLVyo8QZrr17KvcVwrFMi1b4obi3zqDFe/9sbpyYerDLuMa +jaN9Piu1lXrVdjQSfsgLunatD+SfNikaKXpD9IPh1009ghHBbeEa1MDoMF0wwXQs +DkclLmdo7/5fCy0f9owBDc8RgbzILCABE0Vq+gEm0mQgPj6eJRigQUowpmAVLTrg +mhJybOCEF/pkzvSgjFX2zMGuXNmPfUs5BLjvtNtCdTa+xo/6Hh1n/B02hP+Oe6mU +z1JO8WOrgtLddEMykR1T7/h/R/D2O22IWcazJ34RegI4A7RlxEoCIFYcVtExqDnN +UcOkNDPeBBMAi+exsgA7ellLsOOpsM/gfWGaQpz4Qa3VUk1HzgdTbSji6E/l6zrp +FWJfF1NmSDCe0P5ESVzCAIH7pUhUz2B+ood8XvA/7Cw/whyhP8l549D5BsKAHUJC +QkZDhtWKhZmrIP1nBt6ljopGyaldBu/47CMDPeoQHsJq9SGUDD7BdnFD5HKxFWdC +gZpaBXFDUdqc6lEwoC0RqXPVSs6cYH7ugK20kHp6snIfppOPecs= +=m3W8 +-----END PGP SIGNATURE----- diff --git a/diffutils-i18n.patch b/diffutils-i18n.patch deleted file mode 100644 index 5b8706b..0000000 --- a/diffutils-i18n.patch +++ /dev/null @@ -1,779 +0,0 @@ -diff -up diffutils-3.10/src/diff.c.i18n diffutils-3.10/src/diff.c ---- diffutils-3.10/src/diff.c.i18n 2023-05-20 11:17:26.000000000 +0200 -+++ diffutils-3.10/src/diff.c 2023-06-29 13:24:19.567608253 +0200 -@@ -76,6 +76,8 @@ static _Noreturn void try_help (char con - static void check_stdout (void); - static void usage (void); - -+bool (*lines_differ) (char const *, size_t, char const *, size_t); -+ - /* If comparing directories, compare their common subdirectories - recursively. */ - static bool recursive; -@@ -310,6 +312,14 @@ main (int argc, char **argv) - presume_output_tty = false; - xstdopen (); - -+#ifdef HANDLE_MULTIBYTE -+ if (MB_CUR_MAX > 1) -+ lines_differ = lines_differ_multibyte; -+ else -+#endif -+ lines_differ = lines_differ_singlebyte; -+ -+ - /* Decode the options. */ - - while ((c = getopt_long (argc, argv, shortopts, longopts, nullptr)) != -1) -diff -up diffutils-3.10/src/diff.h.i18n diffutils-3.10/src/diff.h ---- diffutils-3.10/src/diff.h.i18n 2023-05-20 11:37:55.000000000 +0200 -+++ diffutils-3.10/src/diff.h 2023-06-29 13:25:49.451271873 +0200 -@@ -33,6 +33,17 @@ _GL_INLINE_HEADER_BEGIN - # define XTERN extern - #endif - -+/* For platforms which support the ISO C ammendment 1 functionality we -+ support user-defined character classes. */ -+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H -+/* Solaris 2.5 has a bug: must be included before . */ -+# include -+# include -+# if defined (HAVE_MBRTOWC) -+# define HANDLE_MULTIBYTE 1 -+# endif -+#endif -+ - /* What kind of changes a hunk contains. */ - enum changes - { -@@ -392,7 +403,11 @@ extern void print_sdiff_script (struct c - /* util.c */ - extern char const change_letter[4]; - extern char const pr_program[]; --extern bool lines_differ (char const *, char const *) ATTRIBUTE_PURE; -+extern bool (*lines_differ) (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE; -+extern bool lines_differ_singlebyte (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE; -+#ifdef HANDLE_MULTIBYTE -+extern bool lines_differ_multibyte (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE; -+#endif - extern lin translate_line_number (struct file_data const *, lin); - extern struct change *find_change (struct change *); - extern struct change *find_reverse_change (struct change *); -diff -up diffutils-3.10/src/io.c.i18n diffutils-3.10/src/io.c ---- diffutils-3.10/src/io.c.i18n 2023-05-20 11:17:26.000000000 +0200 -+++ diffutils-3.10/src/io.c 2023-06-29 13:20:52.457820950 +0200 -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - /* Rotate an unsigned value to the left. */ - #define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) -@@ -223,6 +224,28 @@ slurp (struct file_data *current) - - /* Split the file into lines, simultaneously computing the equivalence - class for each line. */ -+#ifdef HANDLE_MULTIBYTE -+# define MBC2WC(P, END, MBLENGTH, WC, STATE, CONVFAIL) \ -+do \ -+ { \ -+ mbstate_t state_bak = STATE; \ -+ \ -+ CONVFAIL = 0; \ -+ MBLENGTH = mbrtowc (&WC, P, END - (char const *)P, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-2: \ -+ case (size_t)-1: \ -+ STATE = state_bak; \ -+ ++CONVFAIL; \ -+ /* Fall through. */ \ -+ case 0: \ -+ MBLENGTH = 1; \ -+ } \ -+ } \ -+ while (0) -+#endif - - static void - find_and_hash_each_line (struct file_data *current) -@@ -249,12 +272,300 @@ find_and_hash_each_line (struct file_dat - bool same_length_diff_contents_compare_anyway = - diff_length_compare_anyway | ig_case; - -+#ifdef HANDLE_MULTIBYTE -+ wchar_t wc; -+ size_t mblength; -+ mbstate_t state; -+ int convfail; -+ -+ memset (&state, '\0', sizeof (mbstate_t)); -+#endif -+ - while (p < suffix_begin) - { - char const *ip = p; - hash_value h = 0; - unsigned char c; - -+#ifdef HANDLE_MULTIBYTE -+ if (MB_CUR_MAX > 1) -+ { -+ wchar_t lo_wc; -+ char mbc[MB_LEN_MAX]; -+ mbstate_t state_wc; -+ -+ /* Hash this line until we find a newline. */ -+ switch (ig_white_space) -+ { -+ case IGNORE_ALL_SPACE: -+ while (1) -+ { -+ if (*p == '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (convfail) -+ mbc[0] = *p++; -+ else if (!iswspace (wc)) -+ { -+ bool flag = 0; -+ -+ if (ig_case) -+ { -+ lo_wc = towlower (wc); -+ if (lo_wc != wc) -+ { -+ flag = 1; -+ -+ p += mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength = wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength != (size_t)-1 && -+ mblength != (size_t)-2); -+ -+ mblength = (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i = 0; i < mblength; i++) -+ mbc[i] = *p++; -+ } -+ } -+ else -+ { -+ p += mblength; -+ continue; -+ } -+ -+ for (i = 0; i < mblength; i++) -+ h = HASH (h, mbc[i]); -+ } -+ break; -+ -+ case IGNORE_SPACE_CHANGE: -+ while (1) -+ { -+ if (*p == '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (!convfail && iswspace (wc)) -+ { -+ while (1) -+ { -+ if (*p == '\n') -+ { -+ ++p; -+ goto hashing_done; -+ } -+ -+ p += mblength; -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ if (convfail || !iswspace (wc)) -+ break; -+ } -+ h = HASH (h, ' '); -+ } -+ -+ /* WC is now the first non-space. */ -+ if (convfail) -+ mbc[0] = *p++; -+ else -+ { -+ bool flag = 0; -+ -+ if (ignore_case) -+ { -+ lo_wc = towlower (wc); -+ if (lo_wc != wc) -+ { -+ flag = 1; -+ -+ p += mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength = wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength != (size_t)-1 && -+ mblength != (size_t)-2); -+ -+ mblength = (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i = 0; i < mblength; i++) -+ mbc[i] = *p++; -+ } -+ } -+ -+ for (i = 0; i < mblength; i++) -+ h = HASH (h, mbc[i]); -+ } -+ break; -+ -+ case IGNORE_TAB_EXPANSION: -+ case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE: -+ case IGNORE_TRAILING_SPACE: -+ { -+ size_t column = 0; -+ while (1) -+ { -+ if (*p == '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (!convfail -+ && ig_white_space & IGNORE_TRAILING_SPACE -+ && iswspace (wc)) -+ { -+ char const *p1 = p; -+ while (1) -+ { -+ if (*p1 == '\n') -+ { -+ p = p1 + 1; -+ goto hashing_done; -+ } -+ -+ p1 += mblength; -+ MBC2WC (p1, suffix_begin, mblength, wc, state, convfail); -+ if (convfail || !iswspace (wc)) -+ break; -+ } -+ } -+ -+ size_t repetitions = 1; -+ bool no_convert = 0; -+ -+ if (ig_white_space & IGNORE_TAB_EXPANSION) -+ { -+ if (convfail) -+ column++; -+ else -+ switch (wc) -+ { -+ case L'\b': -+ column -= 0 < column; -+ break; -+ -+ case L'\t': -+ mbc[0] = ' '; -+ mblength = 1; -+ no_convert = 1; -+ p++; -+ assert(mblength == 1); -+ repetitions = tabsize - column % tabsize; -+ column = (column + repetitions < column -+ ? 0 -+ : column + repetitions); -+ break; -+ -+ case L'\r': -+ column = 0; -+ break; -+ -+ default: -+ column += wcwidth (wc); -+ break; -+ } -+ } -+ -+ if (ig_case) -+ { -+ lo_wc = towlower (wc); -+ if (lo_wc != wc) -+ { -+ no_convert = 1; -+ p += mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength = wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength != (size_t)-1 && -+ mblength != (size_t)-2); -+ -+ mblength = (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!no_convert) -+ for (i = 0; i < mblength; i++) -+ mbc[i] = *p++; -+ -+ do -+ { -+ for (i = 0; i < mblength; i++) -+ h = HASH (h, mbc[i]); -+ } -+ while (--repetitions != 0); -+ } -+ } -+ break; -+ -+ default: -+ while (1) -+ { -+ if (*p == '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (convfail) -+ mbc[0] = *p++; -+ else -+ { -+ int flag = 0; -+ -+ if (ig_case) -+ { -+ lo_wc = towlower (wc); -+ if (lo_wc != wc) -+ { -+ flag = 1; -+ p += mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength = wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength != (size_t)-1 && -+ mblength != (size_t)-2); -+ -+ mblength = (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i = 0; i < mblength; i++) -+ mbc[i] = *p++; -+ } -+ } -+ -+ for (i = 0; i < mblength; i++) -+ h = HASH (h, mbc[i]); -+ } -+ } -+ } -+ else -+#endif -+ - /* Hash this line until we find a newline. */ - switch (ig_white_space) - { -@@ -405,7 +716,7 @@ find_and_hash_each_line (struct file_dat - else if (!diff_length_compare_anyway) - continue; - -- if (! lines_differ (eqline, ip)) -+ if (! lines_differ (eqline, eqs[i].length + 1, ip, length + 1)) - break; - } - -diff -up diffutils-3.10/src/util.c.i18n diffutils-3.10/src/util.c ---- diffutils-3.10/src/util.c.i18n 2023-02-19 19:04:39.000000000 +0100 -+++ diffutils-3.10/src/util.c 2023-06-29 13:20:52.457820950 +0200 -@@ -1085,7 +1085,8 @@ finish_output (void) - Return nonzero if the lines differ. */ - - bool --lines_differ (char const *s1, char const *s2) -+lines_differ_singlebyte (char const *s1, size_t s1len, -+ char const *s2, size_t s2len) - { - register char const *t1 = s1; - register char const *t2 = s2; -@@ -1241,6 +1242,354 @@ lines_differ (char const *s1, char const - - return true; - } -+ -+#ifdef HANDLE_MULTIBYTE -+# define MBC2WC(T, END, MBLENGTH, WC, STATE, CONVFAIL) \ -+do \ -+ { \ -+ mbstate_t bak = STATE; \ -+ \ -+ CONVFAIL = 0; \ -+ MBLENGTH = mbrtowc (&WC, T, END - T, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-2: \ -+ case (size_t)-1: \ -+ STATE = bak; \ -+ ++CONVFAIL; \ -+ /* Fall through. */ \ -+ case 0: \ -+ MBLENGTH = 1; \ -+ } \ -+ } \ -+ while (0) -+ -+bool -+lines_differ_multibyte (char const *s1, size_t s1len, -+ char const *s2, size_t s2len) -+{ -+ char const *end1, *end2; -+ char c1, c2; -+ wchar_t wc1, wc2, wc1_bak, wc2_bak; -+ size_t mblen1, mblen2; -+ mbstate_t state1, state2, state1_bak, state2_bak; -+ int convfail1, convfail2, convfail1_bak, convfail2_bak; -+ -+ char const *t1 = s1; -+ char const *t2 = s2; -+ char const *t1_bak, *t2_bak; -+ size_t column = 0; -+ -+ if (ignore_white_space == IGNORE_NO_WHITE_SPACE && !ignore_case) -+ { -+ while (*t1 != '\n') -+ if (*t1++ != *t2++) -+ return 1; -+ return 0; -+ } -+ -+ end1 = t1 + s1len; -+ end2 = t2 + s2len; -+ -+ memset (&state1, '\0', sizeof (mbstate_t)); -+ memset (&state2, '\0', sizeof (mbstate_t)); -+ -+ while (1) -+ { -+ c1 = *t1; -+ c2 = *t2; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ -+ /* Test for exact char equality first, since it's a common case. */ -+ if (convfail1 ^ convfail2) -+ break; -+ else if (convfail1 && convfail2 && c1 != c2) -+ break; -+ else if (!convfail1 && !convfail2 && wc1 != wc2) -+ { -+ switch (ignore_white_space) -+ { -+ case IGNORE_ALL_SPACE: -+ /* For -w, just skip past any white space. */ -+ while (1) -+ { -+ if (convfail1) -+ break; -+ else if (wc1 == L'\n' || !iswspace (wc1)) -+ break; -+ -+ t1 += mblen1; -+ c1 = *t1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ -+ while (1) -+ { -+ if (convfail2) -+ break; -+ else if (wc2 == L'\n' || !iswspace (wc2)) -+ break; -+ -+ t2 += mblen2; -+ c2 = *t2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ t1 += mblen1; -+ t2 += mblen2; -+ break; -+ -+ case IGNORE_SPACE_CHANGE: -+ /* For -b, advance past any sequence of white space in -+ line 1 and consider it just one space, or nothing at -+ all if it is at the end of the line. */ -+ if (wc1 != L'\n' && iswspace (wc1)) -+ { -+ size_t mblen_bak; -+ mbstate_t state_bak; -+ -+ do -+ { -+ t1 += mblen1; -+ mblen_bak = mblen1; -+ state_bak = state1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ while (!convfail1 && (wc1 != L'\n' && iswspace (wc1))); -+ -+ state1 = state_bak; -+ mblen1 = mblen_bak; -+ t1 -= mblen1; -+ convfail1 = 0; -+ wc1 = L' '; -+ } -+ -+ /* Likewise for line 2. */ -+ if (wc2 != L'\n' && iswspace (wc2)) -+ { -+ size_t mblen_bak; -+ mbstate_t state_bak; -+ -+ do -+ { -+ t2 += mblen2; -+ mblen_bak = mblen2; -+ state_bak = state2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ while (!convfail2 && (wc2 != L'\n' && iswspace (wc2))); -+ -+ state2 = state_bak; -+ mblen2 = mblen_bak; -+ t2 -= mblen2; -+ convfail2 = 0; -+ wc2 = L' '; -+ } -+ -+ if (wc1 != wc2) -+ { -+ /* If we went too far when doing the simple test for -+ equality, go back to the first non-whitespace -+ character in both sides and try again. */ -+ if (wc2 == L' ' && wc1 != L'\n' && -+ t1 > s1 && -+ !convfail1_bak && iswspace (wc1_bak)) -+ { -+ t1 = t1_bak; -+ wc1 = wc1_bak; -+ state1 = state1_bak; -+ convfail1 = convfail1_bak; -+ continue; -+ } -+ if (wc1 == L' ' && wc2 != L'\n' -+ && t2 > s2 -+ && !convfail2_bak && iswspace (wc2_bak)) -+ { -+ t2 = t2_bak; -+ wc2 = wc2_bak; -+ state2 = state2_bak; -+ convfail2 = convfail2_bak; -+ continue; -+ } -+ } -+ -+ t1_bak = t1; t2_bak = t2; -+ wc1_bak = wc1; wc2_bak = wc2; -+ state1_bak = state1; state2_bak = state2; -+ convfail1_bak = convfail1; convfail2_bak = convfail2; -+ -+ if (wc1 == L'\n') -+ wc1 = L' '; -+ else -+ t1 += mblen1; -+ -+ if (wc2 == L'\n') -+ wc2 = L' '; -+ else -+ t2 += mblen2; -+ -+ break; -+ -+ case IGNORE_TRAILING_SPACE: -+ case IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE: -+ if (iswspace (wc1) && iswspace (wc2)) -+ { -+ char const *p; -+ wchar_t wc; -+ size_t mblength; -+ int convfail; -+ mbstate_t state; -+ bool just_whitespace_left = 1; -+ if (wc1 != L'\n') -+ { -+ mblength = mblen1; -+ p = t1; -+ memset (&state, '\0', sizeof(mbstate_t)); -+ while (p < end1) -+ { -+ if (*p == '\n') -+ break; -+ -+ p += mblength; -+ MBC2WC (p, end1, mblength, wc, state, convfail); -+ if (convfail || !iswspace (wc)) -+ { -+ just_whitespace_left = 0; -+ break; -+ } -+ } -+ } -+ if (just_whitespace_left && wc2 != L'\n') -+ { -+ mblength = mblen2; -+ p = t2; -+ memset (&state, '\0', sizeof(mbstate_t)); -+ while (p < end2) -+ { -+ if (*p == '\n') -+ break; -+ -+ p += mblength; -+ MBC2WC (p, end2, mblength, wc, state, convfail); -+ if (convfail || !iswspace (wc)) -+ { -+ just_whitespace_left = 0; -+ break; -+ } -+ } -+ } -+ -+ if (just_whitespace_left) -+ /* Both lines have nothing but whitespace left. */ -+ return false; -+ } -+ -+ if (ignore_white_space == IGNORE_TRAILING_SPACE) -+ break; -+ /* Fall through. */ -+ case IGNORE_TAB_EXPANSION: -+ if ((wc1 == L' ' && wc2 == L'\t') -+ || (wc1 == L'\t' && wc2 == L' ')) -+ { -+ size_t column2 = column; -+ -+ while (1) -+ { -+ if (convfail1) -+ { -+ ++t1; -+ break; -+ } -+ else if (wc1 == L' ') -+ column++; -+ else if (wc1 == L'\t') -+ column += tabsize - column % tabsize; -+ else -+ { -+ t1 += mblen1; -+ break; -+ } -+ -+ t1 += mblen1; -+ c1 = *t1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ -+ while (1) -+ { -+ if (convfail2) -+ { -+ ++t2; -+ break; -+ } -+ else if (wc2 == L' ') -+ column2++; -+ else if (wc2 == L'\t') -+ column2 += tabsize - column2 % tabsize; -+ else -+ { -+ t2 += mblen2; -+ break; -+ } -+ -+ t2 += mblen2; -+ c2 = *t2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ -+ if (column != column2) -+ return 1; -+ } -+ else -+ { -+ t1 += mblen1; -+ t2 += mblen2; -+ } -+ break; -+ -+ case IGNORE_NO_WHITE_SPACE: -+ t1 += mblen1; -+ t2 += mblen2; -+ break; -+ } -+ -+ /* Lowercase all letters if -i is specified. */ -+ if (ignore_case) -+ { -+ if (!convfail1) -+ wc1 = towlower (wc1); -+ if (!convfail2) -+ wc2 = towlower (wc2); -+ } -+ -+ if (convfail1 ^ convfail2) -+ break; -+ else if (convfail1 && convfail2 && c1 != c2) -+ break; -+ else if (!convfail1 && !convfail2 && wc1 != wc2) -+ break; -+ } -+ else -+ { -+ t1_bak = t1; t2_bak = t2; -+ wc1_bak = wc1; wc2_bak = wc2; -+ state1_bak = state1; state2_bak = state2; -+ convfail1_bak = convfail1; convfail2_bak = convfail2; -+ -+ t1 += mblen1; t2 += mblen2; -+ } -+ -+ if (!convfail1 && wc1 == L'\n') -+ return 0; -+ -+ column += convfail1 ? 1 : -+ (wc1 == L'\t') ? tabsize - column % tabsize : wcwidth (wc1); -+ } -+ -+ return 1; -+} -+#endif - - /* Find the consecutive changes at the start of the script START. - Return the last link before the first gap. */ diff --git a/diffutils.spec b/diffutils.spec index ee969b4..53fd5b4 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,12 +1,9 @@ Summary: GNU collection of diff utilities Name: diffutils -Version: 3.10 -Release: 9%{?dist} +Version: 3.11 +Release: 1%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz -# Multibyte -Patch0: diffutils-i18n.patch -Patch1: diffutils-3.10-cmp-s-empty.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -56,6 +53,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Thu Mar 27 2025 Than Ngo - 3.11-1 +- Fixed rhbz#2343469, Update to 3.11 + * Thu Jan 16 2025 Fedora Release Engineering - 3.10-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index 97fc8bb..15cdc08 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (diffutils-3.10.tar.xz) = 219d2c815a120690c6589846271e43aee5c96c61a7ee4abbef97dfcdb3d6416652ed494b417de0ab6688c4322540d48be63b5e617beb6d20530b5d55d723ccbb +SHA512 (diffutils-3.11.tar.xz) = a381ee6bcbbead155ab6ea1aecc167ab1077c6d95133a876e26284b60bcaae26f01c62eaee400c86302b74fa8ab0c5239b7860ea86478b739ddc304367a35960 From d7a248ef6ea6c26c80d4a2860a1200686f5995dd Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 27 Mar 2025 13:46:27 +0100 Subject: [PATCH 10/15] Backported upstream patch, Fixed allocation typo leading to crash --- ...1-allocation-typo-leading-to-crashes.patch | 26 +++++++++++++++++++ diffutils.spec | 7 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 diffutils-3.11-allocation-typo-leading-to-crashes.patch diff --git a/diffutils-3.11-allocation-typo-leading-to-crashes.patch b/diffutils-3.11-allocation-typo-leading-to-crashes.patch new file mode 100644 index 0000000..31796ca --- /dev/null +++ b/diffutils-3.11-allocation-typo-leading-to-crashes.patch @@ -0,0 +1,26 @@ +diff --git a/NEWS b/NEWS +index 73d98d6..bfc4035 100644 +--- a/NEWS ++++ b/NEWS +@@ -8,6 +8,9 @@ GNU diffutils NEWS -*- outline -*- + file to a nonempty regular file. + [bug#76452 introduced in 3.11] + ++ diff -y no longer crashes when given nontrivial differences. ++ [bug#76613 introduced in 3.11] ++ + + * Noteworthy changes in release 3.11 (2025-02-02) [stable] + +diff --git a/src/io.c b/src/io.c +index a62c529..eba4aba 100644 +--- 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; diff --git a/diffutils.spec b/diffutils.spec index 53fd5b4..82ee291 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,9 +1,11 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.11 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz +# upstream fixes +Patch10: diffutils-3.11-allocation-typo-leading-to-crashes.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -53,6 +55,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Thu Mar 27 2025 Than Ngo - 3.11-2 +- Backported upstream patch, Fixed allocation typo leading to crash + * Thu Mar 27 2025 Than Ngo - 3.11-1 - Fixed rhbz#2343469, Update to 3.11 From 1159f221141e8351a97fd94fea3993053714351d Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 27 Mar 2025 15:15:37 +0100 Subject: [PATCH 11/15] diff does not show a unified diff when one of the file is empty --- ...-empty-files-as-a-different-file-typ.patch | 82 +++++++++++++++++++ ...ion-size-computation-that-could-caus.patch | 30 +++++++ ...1-allocation-typo-leading-to-crashes.patch | 26 ------ diffutils.spec | 9 +- 4 files changed, 119 insertions(+), 28 deletions(-) create mode 100644 0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch create mode 100644 0001-diff-fix-allocation-size-computation-that-could-caus.patch delete mode 100644 diffutils-3.11-allocation-typo-leading-to-crashes.patch diff --git a/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch b/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch new file mode 100644 index 0000000..217bc1a --- /dev/null +++ b/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch @@ -0,0 +1,82 @@ +From 6ce0ebd033c395265c262ae3aab6477a49d4c2f1 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 20 Feb 2025 21:59:55 -0800 +Subject: [PATCH] diff: don't treat empty files as a different file type + +Reported by Kate Deplaix in +. + +* 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) +-- +2.34.1 + diff --git a/0001-diff-fix-allocation-size-computation-that-could-caus.patch b/0001-diff-fix-allocation-size-computation-that-could-caus.patch new file mode 100644 index 0000000..3deedf8 --- /dev/null +++ b/0001-diff-fix-allocation-size-computation-that-could-caus.patch @@ -0,0 +1,30 @@ +From 03e529dd69d50c247a217b9b659659538dfa397a Mon Sep 17 00:00:00 2001 +From: Collin Funk +Date: Thu, 27 Feb 2025 20:15:55 -0800 +Subject: [PATCH] diff: fix allocation size computation that could cause bad + writes + +Reported by Nick Smallbone in: +. + +* src/io.c (find_and_hash_each_line): Fix size computation. +--- + src/io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/io.c b/src/io.c +index a62c529..adb4f50 100644 +--- 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; + +-- +2.48.1 + diff --git a/diffutils-3.11-allocation-typo-leading-to-crashes.patch b/diffutils-3.11-allocation-typo-leading-to-crashes.patch deleted file mode 100644 index 31796ca..0000000 --- a/diffutils-3.11-allocation-typo-leading-to-crashes.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/NEWS b/NEWS -index 73d98d6..bfc4035 100644 ---- a/NEWS -+++ b/NEWS -@@ -8,6 +8,9 @@ GNU diffutils NEWS -*- outline -*- - file to a nonempty regular file. - [bug#76452 introduced in 3.11] - -+ diff -y no longer crashes when given nontrivial differences. -+ [bug#76613 introduced in 3.11] -+ - - * Noteworthy changes in release 3.11 (2025-02-02) [stable] - -diff --git a/src/io.c b/src/io.c -index a62c529..eba4aba 100644 ---- 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; diff --git a/diffutils.spec b/diffutils.spec index 82ee291..3576be5 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,11 +1,13 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.11 -Release: 2%{?dist} +Release: 3%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # upstream fixes -Patch10: diffutils-3.11-allocation-typo-leading-to-crashes.patch +Patch10: 0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch +Patch11: 0001-diff-fix-allocation-size-computation-that-could-caus.patch + License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -55,6 +57,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Thu Mar 27 2025 Than Ngo - 3.11-3 +- diff does not show a unified diff when one of the file is empty + * Thu Mar 27 2025 Than Ngo - 3.11-2 - Backported upstream patch, Fixed allocation typo leading to crash From 3ef05884d710268c02631b0d4de17f9855c34bda Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 11 Apr 2025 12:12:12 +0200 Subject: [PATCH 12/15] Fixed rhbz#2358545, Update to 3.12 --- .gitignore | 1 + ...-empty-files-as-a-different-file-typ.patch | 82 ------------------- ...ion-size-computation-that-could-caus.patch | 30 ------- diffutils-3.11.tar.xz.sig | 16 ---- diffutils-3.12.tar.xz.sig | 16 ++++ diffutils.spec | 9 +- sources | 2 +- 7 files changed, 23 insertions(+), 133 deletions(-) delete mode 100644 0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch delete mode 100644 0001-diff-fix-allocation-size-computation-that-could-caus.patch delete mode 100644 diffutils-3.11.tar.xz.sig create mode 100644 diffutils-3.12.tar.xz.sig diff --git a/.gitignore b/.gitignore index 3f6ce78..147b952 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ diffutils-2.8.1.tar.gz /diffutils-3.9.tar.xz /diffutils-3.10.tar.xz /diffutils-3.11.tar.xz +/diffutils-3.12.tar.xz diff --git a/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch b/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch deleted file mode 100644 index 217bc1a..0000000 --- a/0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 6ce0ebd033c395265c262ae3aab6477a49d4c2f1 Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Thu, 20 Feb 2025 21:59:55 -0800 -Subject: [PATCH] diff: don't treat empty files as a different file type - -Reported by Kate Deplaix in -. - -* 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) --- -2.34.1 - diff --git a/0001-diff-fix-allocation-size-computation-that-could-caus.patch b/0001-diff-fix-allocation-size-computation-that-could-caus.patch deleted file mode 100644 index 3deedf8..0000000 --- a/0001-diff-fix-allocation-size-computation-that-could-caus.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 03e529dd69d50c247a217b9b659659538dfa397a Mon Sep 17 00:00:00 2001 -From: Collin Funk -Date: Thu, 27 Feb 2025 20:15:55 -0800 -Subject: [PATCH] diff: fix allocation size computation that could cause bad - writes - -Reported by Nick Smallbone in: -. - -* src/io.c (find_and_hash_each_line): Fix size computation. ---- - src/io.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/io.c b/src/io.c -index a62c529..adb4f50 100644 ---- 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; - --- -2.48.1 - diff --git a/diffutils-3.11.tar.xz.sig b/diffutils-3.11.tar.xz.sig deleted file mode 100644 index d4330a6..0000000 --- a/diffutils-3.11.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAmegTMoACgkQf9n8ywAL -7u4/Hw/+Krffku9ToMb9l4rGs1s8cNFLs8xReYwCUe7MR1Wz7wi4UOhfWQWeuBEQ -SWQQBbvQg05H9AFSL/Bs8EgPNr0UqF413XdGMvf4s+lJ5OffOZkmOkdWGTUAa1iG -eTXpL19/dYGdAqhWcmLVyo8QZrr17KvcVwrFMi1b4obi3zqDFe/9sbpyYerDLuMa -jaN9Piu1lXrVdjQSfsgLunatD+SfNikaKXpD9IPh1009ghHBbeEa1MDoMF0wwXQs -DkclLmdo7/5fCy0f9owBDc8RgbzILCABE0Vq+gEm0mQgPj6eJRigQUowpmAVLTrg -mhJybOCEF/pkzvSgjFX2zMGuXNmPfUs5BLjvtNtCdTa+xo/6Hh1n/B02hP+Oe6mU -z1JO8WOrgtLddEMykR1T7/h/R/D2O22IWcazJ34RegI4A7RlxEoCIFYcVtExqDnN -UcOkNDPeBBMAi+exsgA7ellLsOOpsM/gfWGaQpz4Qa3VUk1HzgdTbSji6E/l6zrp -FWJfF1NmSDCe0P5ESVzCAIH7pUhUz2B+ood8XvA/7Cw/whyhP8l549D5BsKAHUJC -QkZDhtWKhZmrIP1nBt6ljopGyaldBu/47CMDPeoQHsJq9SGUDD7BdnFD5HKxFWdC -gZpaBXFDUdqc6lEwoC0RqXPVSs6cYH7ugK20kHp6snIfppOPecs= -=m3W8 ------END PGP SIGNATURE----- diff --git a/diffutils-3.12.tar.xz.sig b/diffutils-3.12.tar.xz.sig new file mode 100644 index 0000000..9816207 --- /dev/null +++ b/diffutils-3.12.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAmf14TEACgkQf9n8ywAL +7u5tEg//YI75CvWhml5WPNESJWoNVcb+ak8K5g29sHXE5RW9ZuzvEjHAy2IGpkmG +QbSC2GA3s1BhjIvrm567Xvnz5Rdn4lultZygznL/+oD4PMoantux4dF6P4KcO7jG +KNPWBF0+/gue9KeJIx4tIGXjQ7g/aAxN/U7UukD5NELrF/4KAsFSWC0PA++taGyd +R+kZNl3IX3rci0m4vMXCZX+h1td39NinLuYueOqniZhN84+kjfKfLe+EOPmpdSNr +md25Ez5vcZ7p1meHHFIRhW1xnyF4FEC5H1ePv56wMlKShtflS2/hjmQadlo+9CQn +fnotq12Yi2BEDwn/wlB9t0J4wgGVbvJM5Ie8ggK74ys77JsXbAtaTeJvCYKI/3bF +D2Xt2gI2+Xdfm7zr9xXg4ygf/AqJ0Dc1Cx0hNpgV4BRgMUjKnyp1VgE7bDZn6R4w +W2YRXMsKJQp8NpAk5+XI5El3EYoMcPuI6OQs+b+e98wcGgeeOafWjWrUliIUDln6 +iTXtOBFebV0JtdSWdzNPrxT0+WbmdYSfP7qrqIgMrPHbp5cN7XjVPu6nky07N2RE +f4Q2Ny8KyCul8AskCNimYzGU0rsN1qQtDRSx2CR5ABYztwc/WY2KgXL9aGZ+eIfa +YRIpzush1GB5Bu50huAT2VCCqrk6VCg7v1vLfr3V/eszEUVhPZg= +=vkFD +-----END PGP SIGNATURE----- diff --git a/diffutils.spec b/diffutils.spec index 3576be5..e0a2478 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,12 +1,10 @@ Summary: GNU collection of diff utilities Name: diffutils -Version: 3.11 -Release: 3%{?dist} +Version: 3.12 +Release: 1%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # upstream fixes -Patch10: 0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch -Patch11: 0001-diff-fix-allocation-size-computation-that-could-caus.patch License: GPL-3.0-or-later Provides: bundled(gnulib) @@ -57,6 +55,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Fri Apr 11 2025 Than Ngo - 3.12-1 +- Fixed rhbz#2358545, Update to 3.12 + * Thu Mar 27 2025 Than Ngo - 3.11-3 - diff does not show a unified diff when one of the file is empty diff --git a/sources b/sources index 15cdc08..405b3de 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (diffutils-3.11.tar.xz) = a381ee6bcbbead155ab6ea1aecc167ab1077c6d95133a876e26284b60bcaae26f01c62eaee400c86302b74fa8ab0c5239b7860ea86478b739ddc304367a35960 +SHA512 (diffutils-3.12.tar.xz) = 10b17cf1dcdfa9ca0e5db91d62c4a079ebe9fd7eafa3aaebd4eb7e6206e4d753f348496622aa281e1bd7f7fcde65ce4a886dcc4acbb59332ef980f224197b4e4 From f07f8c37a43d0c81d666238e80afe23e19dd00ae Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 5 May 2025 13:19:21 +0200 Subject: [PATCH 13/15] =?UTF-8?q?-=20Upstream=20patches=20=20=20*=20cross?= =?UTF-8?q?=20compile=20build=20of=203.12=20diffutils=20fails=20=20=20*=20?= =?UTF-8?q?sdiff:=20continue=20=E2=86=92=20break=20=20=20*=20sdiff:=20paci?= =?UTF-8?q?fy=20gcc=20-flto=20-Wmaybe-uninitialized=20=20=20*=20sdiff:=20p?= =?UTF-8?q?ort=20back=20to=20C17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pacify-gcc-flto-Wmaybe-uninitialized.patch | 85 +++++++++++++++++++ 0001-sdiff-port-back-to-C17.patch | 27 ++++++ ...utils-3.12-cross-compiler-build-fail.patch | 30 +++++++ diffutils-3.12-sdiff-continue-break.patch | 65 ++++++++++++++ diffutils.spec | 18 +++- 5 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch create mode 100644 0001-sdiff-port-back-to-C17.patch create mode 100644 diffutils-3.12-cross-compiler-build-fail.patch create mode 100644 diffutils-3.12-sdiff-continue-break.patch diff --git a/0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch b/0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch new file mode 100644 index 0000000..bd3edc0 --- /dev/null +++ b/0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch @@ -0,0 +1,85 @@ +From 45a4762bf3241e7fb6a2e01d382791ae44236841 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Wed, 23 Apr 2025 11:34:20 -0700 +Subject: [PATCH] sdiff: pacify gcc -flto -Wmaybe-uninitialized + +* src/sdiff.c (edit): Portmanteauize two locals into one, which +arguably makes the code clearer, and anyway pacifies gcc -flto +-Wmaybe-uninitialized with gcc (GCC) 15.0.1 20250329 (Red Hat +15.0.1-0) x86-64 (Bug#78019). +--- + src/sdiff.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/sdiff.c b/src/sdiff.c +index 5b1b162..15b8dce 100644 +--- a/src/sdiff.c ++++ b/src/sdiff.c +@@ -857,8 +857,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + { + for (;;) + { +- int cmd0; +- int cmd1; ++ int cmd; + bool gotcmd = false; + + while (! gotcmd) +@@ -867,8 +866,8 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + perror_fatal (_("write failed")); + ck_fflush (stdout); + +- cmd0 = skip_white (); +- switch (cmd0) ++ cmd = skip_white (); ++ switch (cmd) + { + case '1': case '2': case 'l': case 'r': + case 's': case 'v': case 'q': +@@ -882,12 +881,15 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + break; + + case 'e': +- cmd1 = skip_white (); ++ int cmd1 = skip_white (); + switch (cmd1) + { + case '1': case '2': case 'b': case 'd': case 'l': case 'r': + if (skip_white () == '\n') +- gotcmd = true; ++ { ++ gotcmd = true; ++ cmd |= cmd1 << UCHAR_WIDTH; ++ } + else + { + give_help (); +@@ -908,7 +910,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + if (feof (stdin)) + { + gotcmd = true; +- cmd0 = 'q'; ++ cmd = 'q'; + break; + } + FALLTHROUGH; +@@ -921,7 +923,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + } + } + +- switch (cmd0) ++ switch (cmd & UCHAR_MAX) + { + case '1': case 'l': + lf_copy (left, llen, outfile); +@@ -954,6 +956,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + if (! tmp) + perror_fatal (squote (0, tmpname)); + ++ int cmd1 = cmd >> UCHAR_WIDTH; + switch (cmd1) + { + case 'd': +-- +2.48.1 + diff --git a/0001-sdiff-port-back-to-C17.patch b/0001-sdiff-port-back-to-C17.patch new file mode 100644 index 0000000..c7fc16a --- /dev/null +++ b/0001-sdiff-port-back-to-C17.patch @@ -0,0 +1,27 @@ +From 686357a40ca038edc902276cb3b33f4757d8cfb2 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Sat, 26 Apr 2025 12:54:06 -0700 +Subject: [PATCH] sdiff: port back to C17- + +* src/sdiff.c (edit): Do not use a label just before a statement. +Problem reported by Bruno Haible (Bug#78032). +--- + src/sdiff.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sdiff.c b/src/sdiff.c +index 15b8dce..cc961c3 100644 +--- a/src/sdiff.c ++++ b/src/sdiff.c +@@ -880,7 +880,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + } + break; + +- case 'e': ++ case 'e':; + int cmd1 = skip_white (); + switch (cmd1) + { +-- +2.48.1 + diff --git a/diffutils-3.12-cross-compiler-build-fail.patch b/diffutils-3.12-cross-compiler-build-fail.patch new file mode 100644 index 0000000..c2cba1c --- /dev/null +++ b/diffutils-3.12-cross-compiler-build-fail.patch @@ -0,0 +1,30 @@ +From d9083a4cc638cf9c7dfc3cc534a7c6b4debf50ab Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Thu, 10 Apr 2025 16:42:14 +0200 +Subject: strcasecmp: Support cross-compilation. + +Reported by Rudi Heitbaum in +. + +diff --git a/m4/strcasecmp.m4 b/m4/strcasecmp.m4 +index e40ee5d..eb4345d 100644 +--- a/m4/strcasecmp.m4 ++++ b/m4/strcasecmp.m4 +@@ -1,5 +1,5 @@ + # strcasecmp.m4 +-# serial 2 ++# serial 3 + dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation + dnl gives unlimited permission to copy and/or distribute it, +@@ -57,7 +57,7 @@ int main () + gl_cv_func_strcasecmp_works=no + fi + ], +- []) ++ [:]) + ]) + ]) + +-- +cgit v1.1 diff --git a/diffutils-3.12-sdiff-continue-break.patch b/diffutils-3.12-sdiff-continue-break.patch new file mode 100644 index 0000000..59fac2a --- /dev/null +++ b/diffutils-3.12-sdiff-continue-break.patch @@ -0,0 +1,65 @@ +commit 80053ab7b57c1f0825deb4a22018dacfa62d7272 +Author: Paul Eggert +Date: Wed Apr 23 11:17:53 2025 -0700 + + sdiff: continue → break + + * src/sdiff.c (edit): Don’t use ‘continue’ when a simple + break from the switch will do. + +diff --git a/src/sdiff.c b/src/sdiff.c +index 7734a82..5b1b162 100644 +--- a/src/sdiff.c ++++ b/src/sdiff.c +@@ -872,13 +872,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + { + case '1': case '2': case 'l': case 'r': + case 's': case 'v': case 'q': +- if (skip_white () != '\n') ++ if (skip_white () == '\n') ++ gotcmd = true; ++ else + { + give_help (); + flush_line (); +- continue; + } +- gotcmd = true; + break; + + case 'e': +@@ -886,13 +886,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + switch (cmd1) + { + case '1': case '2': case 'b': case 'd': case 'l': case 'r': +- if (skip_white () != '\n') ++ if (skip_white () == '\n') ++ gotcmd = true; ++ else + { + give_help (); + flush_line (); +- continue; + } +- gotcmd = true; + break; + case '\n': + gotcmd = true; +@@ -900,7 +900,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + default: + give_help (); + flush_line (); +- continue; ++ break; + } + break; + +@@ -917,7 +917,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen, + FALLTHROUGH; + case '\n': + give_help (); +- continue; ++ break; + } + } + diff --git a/diffutils.spec b/diffutils.spec index e0a2478..b9c730d 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,11 +1,18 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.12 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # upstream fixes - +# cross compile build of 3.12 diffutils fails +Patch: diffutils-3.12-cross-compiler-build-fail.patch +# sdiff: continue → break +Patch: diffutils-3.12-sdiff-continue-break.patch +# sdiff: pacify gcc -flto -Wmaybe-uninitialized +Patch: 0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch +# sdiff: port back to C17 +Patch: 0001-sdiff-port-back-to-C17.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -55,6 +62,13 @@ make check %{_infodir}/diffutils.info* %changelog +* Mon May 05 2025 Than Ngo - 3.12-2 +- Upstream patches + * cross compile build of 3.12 diffutils fails + * sdiff: continue → break + * sdiff: pacify gcc -flto -Wmaybe-uninitialized + * sdiff: port back to C17 + * Fri Apr 11 2025 Than Ngo - 3.12-1 - Fixed rhbz#2358545, Update to 3.12 From 66c0191743106e5335811d2f057a9517de6d3225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Fri, 4 Jul 2025 13:39:06 +0200 Subject: [PATCH 14/15] tests: migrate from STI to TMT Related: https://fedoraproject.org/wiki/Changes/DisableSTI --- .fmf/version | 1 + plans/ci.fmf | 5 +++++ .../main.fmf | 17 ++++++++++++++++ .../runtest.sh | 3 +-- tests/diff-Z-hangs/main.fmf | 13 ++++++++++++ tests/diff-Z-hangs/runtest.sh | 1 - tests/diff-hang-long-files/main.fmf | 20 +++++++++++++++++++ tests/diff-hang-long-files/runtest.sh | 2 +- .../main.fmf | 17 ++++++++++++++++ .../runtest.sh | 1 - .../main.fmf | 14 +++++++++++++ .../runtest.sh | 3 +-- tests/tests.yml | 18 ----------------- tests/whitespace/main.fmf | 15 ++++++++++++++ tests/whitespace/runtest.sh | 3 +-- 15 files changed, 106 insertions(+), 27 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf create mode 100644 tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf mode change 100644 => 100755 tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh create mode 100644 tests/diff-Z-hangs/main.fmf mode change 100644 => 100755 tests/diff-Z-hangs/runtest.sh create mode 100644 tests/diff-hang-long-files/main.fmf mode change 100644 => 100755 tests/diff-hang-long-files/runtest.sh create mode 100644 tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf mode change 100644 => 100755 tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh create mode 100644 tests/sdiff-does-not-recognize-E-option/main.fmf mode change 100644 => 100755 tests/sdiff-does-not-recognize-E-option/runtest.sh delete mode 100644 tests/tests.yml create mode 100644 tests/whitespace/main.fmf mode change 100644 => 100755 tests/whitespace/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf b/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf new file mode 100644 index 0000000..d7910cc --- /dev/null +++ b/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf @@ -0,0 +1,17 @@ +summary: Test for cmp -s returns 1 even if files are identical +description: "Bug summary: cmp -s returns 1 even if files are identical\n\nDescription:\n\ + 'cmp -s' can return 1 even if files are identical, for example, if comparing\n\ + a file from /proc with a copy of that file in /tmp, since all files in\n/proc + have a size of 0 bytes.\n" +contact: Jeffrey Bastian +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: + /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical +extra-task: + /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical diff --git a/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh b/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh old mode 100644 new mode 100755 index 4e16f2b..72ded09 --- a/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh +++ b/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh @@ -26,8 +26,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include rhts environment -. /usr/bin/rhts-environment.sh -. /usr/share/rhts-library/rhtslib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils" #set -x diff --git a/tests/diff-Z-hangs/main.fmf b/tests/diff-Z-hangs/main.fmf new file mode 100644 index 0000000..b978f00 --- /dev/null +++ b/tests/diff-Z-hangs/main.fmf @@ -0,0 +1,13 @@ +summary: Test for diffutils to check if comparing two files using diff -Z with + mixed line endings doesn't hang +description: "Bug summary: diff -Z hangs\n" +contact: Filip Holec +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: /CoreOS/diffutils/Regression/diff-Z-hangs +extra-task: /CoreOS/diffutils/Regression/diff-Z-hangs diff --git a/tests/diff-Z-hangs/runtest.sh b/tests/diff-Z-hangs/runtest.sh old mode 100644 new mode 100755 index ef14e65..79b396a --- a/tests/diff-Z-hangs/runtest.sh +++ b/tests/diff-Z-hangs/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="diffutils" diff --git a/tests/diff-hang-long-files/main.fmf b/tests/diff-hang-long-files/main.fmf new file mode 100644 index 0000000..e41e226 --- /dev/null +++ b/tests/diff-hang-long-files/main.fmf @@ -0,0 +1,20 @@ +summary: Diff appears to hang in long file +description: "Test Name: diff-hang-long-files\nAuthor: Michal Fabry \n\ + Location: /CoreOS/diffutils/Regression/diff-hang-long-files\n\nShort Description: + Diff appears to hang in long file\n\n\nLong Description:\n\nRunning the \"diff + -bBw\" command on a very large input file (eg 250 MB), in a multi-byte locale + (ie UTF-8), took a very long time to complete, if at all. In a reported case, + a diff ran for multiple days and did not complete. In certain situations, this + could cause 100% CPU usage.\n" +contact: Michal Fabry +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils + - words + - time +duration: 5m +extra-summary: /CoreOS/diffutils/Regression/diff-hang-long-files +extra-task: /CoreOS/diffutils/Regression/diff-hang-long-files diff --git a/tests/diff-hang-long-files/runtest.sh b/tests/diff-hang-long-files/runtest.sh old mode 100644 new mode 100755 index 18d3606..1457dfe --- a/tests/diff-hang-long-files/runtest.sh +++ b/tests/diff-hang-long-files/runtest.sh @@ -15,7 +15,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 @@ -76,3 +75,4 @@ rlPhaseEnd #rlCreateLogFromJournal | tee $OUTPUTFILE rlJournalPrintText +rlJournalEnd diff --git a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf new file mode 100644 index 0000000..06210fd --- /dev/null +++ b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf @@ -0,0 +1,17 @@ +summary: Test for diffutils to ensure U3000 ideographic space is treated as + space when used -b or -w options +description: "Bug summary: diff -w/-b doesn't treat U3000 (IDEOGRAPHIC SPACE) as space\n\ + \nTest for diffutils to ensure U3000 ideographic space is treated as space when + used -b or -w options\n" +contact: Filip Holec +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: + /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space +extra-task: + /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space diff --git a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh old mode 100644 new mode 100755 index 46a760d..d84af01 --- a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh +++ b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="diffutils" diff --git a/tests/sdiff-does-not-recognize-E-option/main.fmf b/tests/sdiff-does-not-recognize-E-option/main.fmf new file mode 100644 index 0000000..6fe5268 --- /dev/null +++ b/tests/sdiff-does-not-recognize-E-option/main.fmf @@ -0,0 +1,14 @@ +summary: Test for sdiff does not recognize -E option +description: "Bug summary: sdiff does not recognize -E option\n\nThe test runs sdiff + -E on two files differing just in use of tab/8 spaces. sdiff shall not fail and + shall return that the files are identical.\n" +contact: Martin Kyral +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 10m +extra-summary: /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option +extra-task: /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option diff --git a/tests/sdiff-does-not-recognize-E-option/runtest.sh b/tests/sdiff-does-not-recognize-E-option/runtest.sh old mode 100644 new mode 100755 index d60f29b..be034f2 --- a/tests/sdiff-does-not-recognize-E-option/runtest.sh +++ b/tests/sdiff-does-not-recognize-E-option/runtest.sh @@ -27,8 +27,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh -. /usr/lib/beakerlib/beakerlib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils" diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 7f41590..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Tests that run in classic context -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - - container - - atomic - tests: - - cmp-s-returns-1-even-if-files-are-identical - - diff-hang-long-files - - diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space - - diff-Z-hangs - - sdiff-does-not-recognize-E-option - - whitespace - required_packages: - - findutils # beakerlib needs find command diff --git a/tests/whitespace/main.fmf b/tests/whitespace/main.fmf new file mode 100644 index 0000000..955e588 --- /dev/null +++ b/tests/whitespace/main.fmf @@ -0,0 +1,15 @@ +summary: diff -b should ignore whitespace +description: "Create 2 files, f1, f2 with contents \"abc\" and \"abc \" (without quotes),\n\ + i.e. the same line with a space on the end.\n\nDiff ignoring whitespace:\n\ndiff + -b f1 f2\n\nshould produce no diff output, but does on F8. Works fine on FC6.\n\ + \nversion: diffutils-2.8.1-17.fc8\n" +contact: Bill Peck +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: /CoreOS/diffutils/whitespace +extra-task: /CoreOS/diffutils/whitespace diff --git a/tests/whitespace/runtest.sh b/tests/whitespace/runtest.sh old mode 100644 new mode 100755 index 50348e9..9f28bf1 --- a/tests/whitespace/runtest.sh +++ b/tests/whitespace/runtest.sh @@ -15,8 +15,7 @@ # # Author: Bill Peck -. /usr/bin/rhts-environment.sh -. /usr/share/rhts-library/rhtslib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils" From fd5c7c3b394a398a20f33143262b1982164dc82d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 19:17:26 +0000 Subject: [PATCH 15/15] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- diffutils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffutils.spec b/diffutils.spec index b9c730d..3c90eaf 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.12 -Release: 2%{?dist} +Release: 3%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz # upstream fixes @@ -62,6 +62,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 3.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon May 05 2025 Than Ngo - 3.12-2 - Upstream patches * cross compile build of 3.12 diffutils fails