Fixed rhbz#2358545, Update to 3.12
This commit is contained in:
parent
1159f22114
commit
3ef05884d7
7 changed files with 23 additions and 133 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
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: [PATCH] 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)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 03e529dd69d50c247a217b9b659659538dfa397a Mon Sep 17 00:00:00 2001
|
||||
From: Collin Funk <collin.funk1@gmail.com>
|
||||
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 <nick@smallbone.se> in:
|
||||
<https://lists.gnu.org/r/bug-diffutils/2025-02/msg00012.html>.
|
||||
|
||||
* 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
|
||||
|
||||
|
|
@ -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-----
|
||||
16
diffutils-3.12.tar.xz.sig
Normal file
16
diffutils-3.12.tar.xz.sig
Normal file
|
|
@ -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-----
|
||||
|
|
@ -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 <than@redhat.com> - 3.12-1
|
||||
- Fixed rhbz#2358545, Update to 3.12
|
||||
|
||||
* Thu Mar 27 2025 Than Ngo <than@redhat.com> - 3.11-3
|
||||
- diff does not show a unified diff when one of the file is empty
|
||||
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (diffutils-3.11.tar.xz) = a381ee6bcbbead155ab6ea1aecc167ab1077c6d95133a876e26284b60bcaae26f01c62eaee400c86302b74fa8ab0c5239b7860ea86478b739ddc304367a35960
|
||||
SHA512 (diffutils-3.12.tar.xz) = 10b17cf1dcdfa9ca0e5db91d62c4a079ebe9fd7eafa3aaebd4eb7e6206e4d753f348496622aa281e1bd7f7fcde65ce4a886dcc4acbb59332ef980f224197b4e4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue