- Fix bz#2208831, update to 3.10

- Fix bz#2196671, diff -D no longer fails to output #ifndef lines introduced in 3.9
This commit is contained in:
Than Ngo 2023-06-29 13:59:26 +02:00
parent d2e1c85231
commit 2b29d95c6c
7 changed files with 52 additions and 69 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ diffutils-2.8.1.tar.gz
/diffutils-3.7.tar.xz /diffutils-3.7.tar.xz
/diffutils-3.8.tar.xz /diffutils-3.8.tar.xz
/diffutils-3.9.tar.xz /diffutils-3.9.tar.xz
/diffutils-3.10.tar.xz

16
diffutils-3.10.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----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-----

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAmPEk3oACgkQf9n8ywAL
7u6wfg//YWpTsc+kHsuteg8gEWJWaOj+NI7XD86OPIkfb+VDHsaLiui1A0Wb6R+K
SGLuUITr2IPXVqaE98PmrcII7Yd1BPsu8qQSaOs6J4c702rbYQhWQUMAyhevg2QT
cvg8ao8GEphzIn5Fod9KQqy91lgEI84fQfNOtphL9de97HEDQTBL5sWoa2rPKWLZ
JQFxEOaGybSQe9SQXJjjThAGyg3QY8oP+07KnpEnH3UxZutPTqCYzNg7oZv7eObU
LDhx+AcXLbbkjFwdeM2ubdwD600bAJdDjmLotDom9ew7AOZUqB+Ml9tzn+fOnXuB
oKMLB8ONMRJ+5rsZPJFRZUgJQZQ6e5AOZMNZwX5vWLBB/68sMVDtuGlaKHwxZWv4
oqEWXicffa+ot77jc7Cr/rBEFDTaGayBgPJqLsk0wj1UZCKQOAN0DcL7ThH4qH4c
gb0F1asIi/QjA2cGmRauTMj/WfjIBhDMrFC5dgn7uZHvgWM9Bt1jAJXZt0RQ+A16
PgSgwnQYaQxZu18M7Mhe/JKSmTzTZpBIyI/95MwQK++YjYF1ROy95ViGJP2gkGDg
qt4P5JJ2eyRtdcutVOSDRTUERRdLyIIdnUiIIhPs4aSBoNgktvL5e91/BSVLMPXf
3pnUGIWpZjhHv3Xc7Z3HrFxdXYuXtv2OdUjZBrewA6KZjZFh+JE=
=GjI7
-----END PGP SIGNATURE-----

View File

@ -1,20 +0,0 @@
diff -up diffutils-3.6/src/cmp.c.cmp-s-empty diffutils-3.6/src/cmp.c
--- diffutils-3.6/src/cmp.c.cmp-s-empty 2017-05-18 18:39:59.000000000 +0100
+++ diffutils-3.6/src/cmp.c 2017-05-22 10:53:28.477147864 +0100
@@ -330,12 +330,15 @@ 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
&& S_ISREG (stat_buf[0].st_mode)
- && S_ISREG (stat_buf[1].st_mode))
+ && S_ISREG (stat_buf[1].st_mode)
+ && stat_buf[0].st_size > 0
+ && stat_buf[1].st_size > 0)
{
off_t s0 = stat_buf[0].st_size - file_position (0);
off_t s1 = stat_buf[1].st_size - file_position (1);

View File

@ -1,6 +1,6 @@
diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c diff -up diffutils-3.10/src/diff.c.i18n diffutils-3.10/src/diff.c
--- diffutils-3.9/src/diff.c.i18n 2023-01-02 01:18:33.000000000 +0000 --- diffutils-3.10/src/diff.c.i18n 2023-05-20 11:17:26.000000000 +0200
+++ diffutils-3.9/src/diff.c 2023-01-16 14:40:53.841265893 +0000 +++ 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 @@ -76,6 +76,8 @@ static _Noreturn void try_help (char con
static void check_stdout (void); static void check_stdout (void);
static void usage (void); static void usage (void);
@ -10,7 +10,7 @@ diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c
/* If comparing directories, compare their common subdirectories /* If comparing directories, compare their common subdirectories
recursively. */ recursively. */
static bool recursive; static bool recursive;
@@ -303,6 +305,13 @@ main (int argc, char **argv) @@ -310,6 +312,14 @@ main (int argc, char **argv)
presume_output_tty = false; presume_output_tty = false;
xstdopen (); xstdopen ();
@ -20,16 +20,17 @@ diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c
+ else + else
+#endif +#endif
+ lines_differ = lines_differ_singlebyte; + lines_differ = lines_differ_singlebyte;
+
+ +
/* Decode the options. */ /* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) while ((c = getopt_long (argc, argv, shortopts, longopts, nullptr)) != -1)
diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h diff -up diffutils-3.10/src/diff.h.i18n diffutils-3.10/src/diff.h
--- diffutils-3.9/src/diff.h.i18n 2023-01-02 01:18:33.000000000 +0000 --- diffutils-3.10/src/diff.h.i18n 2023-05-20 11:37:55.000000000 +0200
+++ diffutils-3.9/src/diff.h 2023-01-16 14:41:58.620317020 +0000 +++ diffutils-3.10/src/diff.h 2023-06-29 13:25:49.451271873 +0200
@@ -23,6 +23,17 @@ @@ -33,6 +33,17 @@ _GL_INLINE_HEADER_BEGIN
#include <stdio.h> # define XTERN extern
#include <unlocked-io.h> #endif
+/* For platforms which support the ISO C ammendment 1 functionality we +/* For platforms which support the ISO C ammendment 1 functionality we
+ support user-defined character classes. */ + support user-defined character classes. */
@ -45,7 +46,7 @@ diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h
/* What kind of changes a hunk contains. */ /* What kind of changes a hunk contains. */
enum changes enum changes
{ {
@@ -389,7 +400,11 @@ extern void print_sdiff_script (struct c @@ -392,7 +403,11 @@ extern void print_sdiff_script (struct c
/* util.c */ /* util.c */
extern char const change_letter[4]; extern char const change_letter[4];
extern char const pr_program[]; extern char const pr_program[];
@ -58,9 +59,9 @@ diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h
extern lin translate_line_number (struct file_data const *, lin); extern lin translate_line_number (struct file_data const *, lin);
extern struct change *find_change (struct change *); extern struct change *find_change (struct change *);
extern struct change *find_reverse_change (struct change *); extern struct change *find_reverse_change (struct change *);
diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c diff -up diffutils-3.10/src/io.c.i18n diffutils-3.10/src/io.c
--- diffutils-3.9/src/io.c.i18n 2023-01-02 01:18:33.000000000 +0000 --- diffutils-3.10/src/io.c.i18n 2023-05-20 11:17:26.000000000 +0200
+++ diffutils-3.9/src/io.c 2023-01-16 14:40:53.841265893 +0000 +++ diffutils-3.10/src/io.c 2023-06-29 13:20:52.457820950 +0200
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <cmpbuf.h> #include <cmpbuf.h>
#include <file-type.h> #include <file-type.h>
@ -69,7 +70,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
/* Rotate an unsigned value to the left. */ /* Rotate an unsigned value to the left. */
#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) #define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
@@ -214,6 +215,28 @@ slurp (struct file_data *current) @@ -223,6 +224,28 @@ slurp (struct file_data *current)
/* Split the file into lines, simultaneously computing the equivalence /* Split the file into lines, simultaneously computing the equivalence
class for each line. */ class for each line. */
@ -98,7 +99,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
static void static void
find_and_hash_each_line (struct file_data *current) find_and_hash_each_line (struct file_data *current)
@@ -240,12 +263,300 @@ find_and_hash_each_line (struct file_dat @@ -249,12 +272,300 @@ find_and_hash_each_line (struct file_dat
bool same_length_diff_contents_compare_anyway = bool same_length_diff_contents_compare_anyway =
diff_length_compare_anyway | ig_case; diff_length_compare_anyway | ig_case;
@ -399,7 +400,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
/* Hash this line until we find a newline. */ /* Hash this line until we find a newline. */
switch (ig_white_space) switch (ig_white_space)
{ {
@@ -396,7 +707,7 @@ find_and_hash_each_line (struct file_dat @@ -405,7 +716,7 @@ find_and_hash_each_line (struct file_dat
else if (!diff_length_compare_anyway) else if (!diff_length_compare_anyway)
continue; continue;
@ -408,10 +409,10 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
break; break;
} }
diff -up diffutils-3.9/src/util.c.i18n diffutils-3.9/src/util.c diff -up diffutils-3.10/src/util.c.i18n diffutils-3.10/src/util.c
--- diffutils-3.9/src/util.c.i18n 2023-01-02 01:18:33.000000000 +0000 --- diffutils-3.10/src/util.c.i18n 2023-02-19 19:04:39.000000000 +0100
+++ diffutils-3.9/src/util.c 2023-01-16 14:40:53.842265909 +0000 +++ diffutils-3.10/src/util.c 2023-06-29 13:20:52.457820950 +0200
@@ -1084,7 +1084,8 @@ finish_output (void) @@ -1085,7 +1085,8 @@ finish_output (void)
Return nonzero if the lines differ. */ Return nonzero if the lines differ. */
bool bool
@ -421,7 +422,7 @@ diff -up diffutils-3.9/src/util.c.i18n diffutils-3.9/src/util.c
{ {
register char const *t1 = s1; register char const *t1 = s1;
register char const *t2 = s2; register char const *t2 = s2;
@@ -1240,6 +1241,354 @@ lines_differ (char const *s1, char const @@ -1241,6 +1242,354 @@ lines_differ (char const *s1, char const
return true; return true;
} }

View File

@ -1,11 +1,10 @@
Summary: GNU collection of diff utilities Summary: GNU collection of diff utilities
Name: diffutils Name: diffutils
Version: 3.9 Version: 3.10
Release: 4%{?dist} Release: 1%{?dist}
URL: https://www.gnu.org/software/diffutils/diffutils.html URL: https://www.gnu.org/software/diffutils/diffutils.html
Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
Patch1: diffutils-cmp-s-empty.patch Patch0: diffutils-i18n.patch
Patch2: diffutils-i18n.patch
License: GPL-3.0-or-later License: GPL-3.0-or-later
Provides: bundled(gnulib) Provides: bundled(gnulib)
BuildRequires: gcc BuildRequires: gcc
@ -28,10 +27,8 @@ Install diffutils if you need to compare text files.
%prep %prep
%setup -q %setup -q
# For 'cmp -s', compare file sizes only if both non-zero (bug #563618). # Multibyte
%patch 1 -p1 -b .cmp-s-empty %patch -P0 -p1 -b .i18n
%patch 2 -p1 -b .i18n
# Run autoreconf for aarch64 support (bug #925256). # Run autoreconf for aarch64 support (bug #925256).
autoreconf autoreconf
@ -59,6 +56,10 @@ make check
%{_infodir}/diffutils.info* %{_infodir}/diffutils.info*
%changelog %changelog
* Thu Jun 29 2023 Than Ngo <than@redhat.com> - 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
* Tue Mar 28 2023 Than Ngo <than@redhat.com> - 3.9-4 * Tue Mar 28 2023 Than Ngo <than@redhat.com> - 3.9-4
- Fix deprecated patch rpm marco - Fix deprecated patch rpm marco

View File

@ -1 +1 @@
SHA512 (diffutils-3.9.tar.xz) = d43280cb1cb2615a8867d971467eb9a3fa037fe9a411028068036f733dab42b10d42767093cea4de71e62b2659a3ec73bd7d1a8f251befd49587e32802682d0f SHA512 (diffutils-3.10.tar.xz) = 219d2c815a120690c6589846271e43aee5c96c61a7ee4abbef97dfcdb3d6416652ed494b417de0ab6688c4322540d48be63b5e617beb6d20530b5d55d723ccbb