Compare commits
10 Commits
ae028d11c6
...
40e556c1c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40e556c1c0 | ||
|
|
a0362f224f | ||
|
|
523765dc2f | ||
|
|
d543f99157 | ||
|
|
75eb9d5bb4 | ||
|
|
0f17951a0b | ||
|
|
814461b65c | ||
|
|
898a2ac5f2 | ||
|
|
a20f8ff888 | ||
|
|
597a941142 |
27
diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch
Normal file
27
diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From cb52fa88d5f2d9bc4894a7eccd90fdc2e03f5af4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bruno Haible <bruno@clisp.org>
|
||||||
|
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
|
||||||
|
|
||||||
BIN
diffutils-3.10.tar.xz
Normal file
BIN
diffutils-3.10.tar.xz
Normal file
Binary file not shown.
Binary file not shown.
@ -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);
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
diff -up diffutils-3.6/src/diff.c.i18n diffutils-3.6/src/diff.c
|
diff -up diffutils-3.10/src/diff.c.i18n diffutils-3.10/src/diff.c
|
||||||
--- diffutils-3.6/src/diff.c.i18n 2017-05-06 20:02:54.000000000 +0100
|
--- diffutils-3.10/src/diff.c.i18n 2023-05-20 11:17:26.000000000 +0200
|
||||||
+++ diffutils-3.6/src/diff.c 2017-05-22 10:52:21.989254674 +0100
|
+++ diffutils-3.10/src/diff.c 2023-06-29 13:24:19.567608253 +0200
|
||||||
@@ -76,6 +76,8 @@ static void try_help (char const *, char
|
@@ -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.6/src/diff.c.i18n diffutils-3.6/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;
|
||||||
@@ -298,6 +300,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.6/src/diff.c.i18n diffutils-3.6/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.6/src/diff.h.i18n diffutils-3.6/src/diff.h
|
diff -up diffutils-3.10/src/diff.h.i18n diffutils-3.10/src/diff.h
|
||||||
--- diffutils-3.6/src/diff.h.i18n 2017-01-01 11:22:36.000000000 +0000
|
--- diffutils-3.10/src/diff.h.i18n 2023-05-20 11:37:55.000000000 +0200
|
||||||
+++ diffutils-3.6/src/diff.h 2017-05-22 10:51:09.050371844 +0100
|
+++ 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,22 +46,22 @@ diff -up diffutils-3.6/src/diff.h.i18n diffutils-3.6/src/diff.h
|
|||||||
/* What kind of changes a hunk contains. */
|
/* What kind of changes a hunk contains. */
|
||||||
enum changes
|
enum changes
|
||||||
{
|
{
|
||||||
@@ -381,7 +392,11 @@ extern void print_sdiff_script (struct c
|
@@ -392,7 +403,11 @@ extern void print_sdiff_script (struct 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[];
|
||||||
extern char *concat (char const *, char const *, char const *);
|
-extern bool lines_differ (char const *, char const *) ATTRIBUTE_PURE;
|
||||||
-extern bool lines_differ (char const *, char const *) _GL_ATTRIBUTE_PURE;
|
+extern bool (*lines_differ) (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE;
|
||||||
+extern bool (*lines_differ) (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
+extern bool lines_differ_singlebyte (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE;
|
||||||
+extern bool lines_differ_singlebyte (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
|
||||||
+#ifdef HANDLE_MULTIBYTE
|
+#ifdef HANDLE_MULTIBYTE
|
||||||
+extern bool lines_differ_multibyte (char const *, size_t, char const *, size_t) _GL_ATTRIBUTE_PURE;
|
+extern bool lines_differ_multibyte (char const *, size_t, char const *, size_t) ATTRIBUTE_PURE;
|
||||||
+#endif
|
+#endif
|
||||||
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.6/src/io.c.i18n diffutils-3.6/src/io.c
|
diff -up diffutils-3.10/src/io.c.i18n diffutils-3.10/src/io.c
|
||||||
--- diffutils-3.6/src/io.c.i18n 2017-01-01 11:22:36.000000000 +0000
|
--- diffutils-3.10/src/io.c.i18n 2023-05-20 11:17:26.000000000 +0200
|
||||||
+++ diffutils-3.6/src/io.c 2017-05-22 10:51:09.050371844 +0100
|
+++ 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.6/src/io.c.i18n diffutils-3.6/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)))
|
||||||
@@ -215,6 +216,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.6/src/io.c.i18n diffutils-3.6/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)
|
||||||
@@ -241,12 +264,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.6/src/io.c.i18n diffutils-3.6/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)
|
||||||
{
|
{
|
||||||
@@ -397,7 +708,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.6/src/io.c.i18n diffutils-3.6/src/io.c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff -up diffutils-3.6/src/util.c.i18n diffutils-3.6/src/util.c
|
diff -up diffutils-3.10/src/util.c.i18n diffutils-3.10/src/util.c
|
||||||
--- diffutils-3.6/src/util.c.i18n 2017-05-18 18:39:59.000000000 +0100
|
--- diffutils-3.10/src/util.c.i18n 2023-02-19 19:04:39.000000000 +0100
|
||||||
+++ diffutils-3.6/src/util.c 2017-05-22 10:51:09.050371844 +0100
|
+++ diffutils-3.10/src/util.c 2023-06-29 13:20:52.457820950 +0200
|
||||||
@@ -985,7 +985,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.6/src/util.c.i18n diffutils-3.6/src/util.c
|
|||||||
{
|
{
|
||||||
register char const *t1 = s1;
|
register char const *t1 = s1;
|
||||||
register char const *t2 = s2;
|
register char const *t2 = s2;
|
||||||
@@ -1141,6 +1142,354 @@ lines_differ (char const *s1, char const
|
@@ -1241,6 +1242,354 @@ lines_differ (char const *s1, char const
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
Name: diffutils
|
Name: diffutils
|
||||||
Version: 3.8
|
Version: 3.10
|
||||||
Release: 2
|
Release: 2
|
||||||
Summary: A GNU collection of diff utilities
|
Summary: A GNU collection of diff utilities
|
||||||
URL: http://www.gnu.org/software/diffutils/diffutils.html
|
URL: http://www.gnu.org/software/diffutils/diffutils.html
|
||||||
Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
|
Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
|
||||||
Patch1: diffutils-cmp-s-empty.patch
|
Patch1: diffutils-i18n.patch
|
||||||
Patch2: diffutils-i18n.patch
|
#Fix output of "diff -l -y" for non-ASCII input files
|
||||||
|
Patch2: diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch
|
||||||
Patch3: diff3-set-flagging-to-true-in-X-option.patch
|
Patch3: diff3-set-flagging-to-true-in-X-option.patch
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
@ -27,7 +28,7 @@ GNU Diffutils is a package of several programs related to finding differences be
|
|||||||
autoreconf -ifv
|
autoreconf -ifv
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch aarch64
|
%ifarch aarch64 riscv64
|
||||||
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
|
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
|
||||||
%endif
|
%endif
|
||||||
%configure
|
%configure
|
||||||
@ -55,6 +56,36 @@ cat tests/test-suite.log
|
|||||||
%exclude %{_infodir}/dir
|
%exclude %{_infodir}/dir
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 29 2023 yoo <sunyuechi@iscas.ac.cn> - 3.10-2
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix riscv build error
|
||||||
|
|
||||||
|
* Wed Jul 12 2023 dillon chen <dillon.chen@gmail.com> - 3.10-1
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:update version to 3.10
|
||||||
|
|
||||||
|
* Wed Mar 8 2023 Jiayi Chen <chenjiayi22@huawei.com> - 3.9-2
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix diff -D option failed
|
||||||
|
|
||||||
|
* Sat Jan 28 2023 Jiayi Chen <chenjiayi22@huawei.com> - 3.9-1
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:update version to 3.9
|
||||||
|
|
||||||
|
* Wed Oct 19 2022 zhangruifang <zhangruifang1@h-partners.com> - 3.8-3
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix unlikely memory leak
|
||||||
|
|
||||||
* Tue Mar 22 2022 panxiaohe<panxh.life@foxmail.com> - 3.8-2
|
* Tue Mar 22 2022 panxiaohe<panxh.life@foxmail.com> - 3.8-2
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user