Compare commits
69 commits
diffutils-
...
rawhide
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30c705e495 | ||
|
|
fd5c7c3b39 | ||
|
|
66c0191743 |
||
|
|
f07f8c37a4 | ||
|
|
3ef05884d7 | ||
|
|
1159f22114 | ||
|
|
d7a248ef6e | ||
|
|
e55ec778c3 | ||
|
|
0d56b9fccf | ||
|
|
efeeb64f37 | ||
|
|
112f3556e3 | ||
|
|
33ebdf4509 | ||
|
|
9421e38500 | ||
|
|
22cf0d6a15 | ||
|
|
0ea6b50511 | ||
|
|
96115b78aa | ||
|
|
2b29d95c6c | ||
|
|
d2e1c85231 | ||
|
|
2de4d2f417 | ||
|
|
5c223564ef | ||
|
|
b3d7b433f0 |
||
|
|
2aba9bf603 | ||
|
|
9a171232f3 | ||
|
|
6958cd94fe |
||
|
|
4216d4197e | ||
|
|
8363a7f4b1 |
||
|
|
775035f1b7 |
||
|
|
26b96e3108 | ||
|
|
0489ee8312 | ||
|
|
7c51935b92 | ||
|
|
9b2b8d9dea |
||
|
|
5274a69ee0 | ||
|
|
972db8de2d | ||
|
|
e32d8be992 | ||
|
|
a73ccd0f1d | ||
|
|
0ac5385bd9 | ||
|
|
9129d879f7 | ||
|
|
3c89f4400e | ||
|
|
b3095ad7f2 | ||
|
|
12ce2b4fd7 | ||
|
|
03744b2863 |
||
|
|
863087bea7 | ||
|
|
5c365f1189 | ||
|
|
bd91ce8b69 |
||
|
|
c86338cc28 | ||
|
|
661786d26a | ||
|
|
b0f848841e | ||
|
|
bfd003b76d | ||
|
|
3de146fa2d | ||
|
|
f23332592b | ||
|
|
165207b40b | ||
|
|
18e019b2c4 | ||
|
|
4387dd65d0 | ||
|
|
c7eed45830 | ||
|
|
7b8b596501 | ||
|
|
8230287ec0 | ||
|
|
40895fa64b | ||
|
|
effdc229f3 | ||
|
|
d65f00f4af | ||
|
|
a33fe8d70c | ||
|
|
54c1294ee0 | ||
|
|
9f25f6e3a4 | ||
|
|
54f92ba2a0 | ||
|
|
c2f0dc48e6 | ||
|
|
8ad2a97dc7 | ||
|
|
445a625327 | ||
|
|
5b4e2e345c | ||
|
|
6911aa14f4 | ||
|
|
47f8f06f47 |
45 changed files with 481139 additions and 849 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -3,3 +3,11 @@ diffutils-2.8.1.tar.gz
|
|||
/diffutils-3.1.tar.xz
|
||||
/diffutils-3.2.tar.xz
|
||||
/diffutils-3.3.tar.xz
|
||||
/diffutils-3.5.tar.xz
|
||||
/diffutils-3.6.tar.xz
|
||||
/diffutils-3.7.tar.xz
|
||||
/diffutils-3.8.tar.xz
|
||||
/diffutils-3.9.tar.xz
|
||||
/diffutils-3.10.tar.xz
|
||||
/diffutils-3.11.tar.xz
|
||||
/diffutils-3.12.tar.xz
|
||||
|
|
|
|||
85
0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch
Normal file
85
0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
From 45a4762bf3241e7fb6a2e01d382791ae44236841 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
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
|
||||
|
||||
27
0001-sdiff-port-back-to-C17.patch
Normal file
27
0001-sdiff-port-back-to-C17.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From 686357a40ca038edc902276cb3b33f4757d8cfb2 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
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
|
||||
|
||||
7
STAGE1-diffutils
Normal file
7
STAGE1-diffutils
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
srpm $1
|
||||
mcd $BUILDDIR/$1
|
||||
$SRC/${1}-*/configure $TCONFIGARGS
|
||||
notparallel
|
||||
test -d tools/gnulib/lib && make $J V=1 -C tools/gnulib/lib
|
||||
make $J V=1
|
||||
make $J install DESTDIR=${ROOTFS}
|
||||
30
diffutils-3.12-cross-compiler-build-fail.patch
Normal file
30
diffutils-3.12-cross-compiler-build-fail.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From d9083a4cc638cf9c7dfc3cc534a7c6b4debf50ab Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Haible <bruno@clisp.org>
|
||||
Date: Thu, 10 Apr 2025 16:42:14 +0200
|
||||
Subject: strcasecmp: Support cross-compilation.
|
||||
|
||||
Reported by Rudi Heitbaum <rudi@heitbaum.com> in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00055.html>.
|
||||
|
||||
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
|
||||
65
diffutils-3.12-sdiff-continue-break.patch
Normal file
65
diffutils-3.12-sdiff-continue-break.patch
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
commit 80053ab7b57c1f0825deb4a22018dacfa62d7272
|
||||
Author: Paul Eggert <eggert@cs.ucla.edu>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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,20 +0,0 @@
|
|||
diff -up diffutils-2.8.1/src/cmp.c.cmp-s-empty diffutils-2.8.1/src/cmp.c
|
||||
--- diffutils-2.8.1/src/cmp.c.cmp-s-empty 2002-04-05 21:37:31.000000000 +0100
|
||||
+++ diffutils-2.8.1/src/cmp.c 2010-06-25 14:56:08.464802321 +0100
|
||||
@@ -316,12 +316,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,780 +0,0 @@
|
|||
diff -up diffutils-3.3/src/diff.c.i18n diffutils-3.3/src/diff.c
|
||||
--- diffutils-3.3/src/diff.c.i18n 2013-02-02 04:39:05.000000000 +0000
|
||||
+++ diffutils-3.3/src/diff.c 2013-03-26 09:40:26.213878482 +0000
|
||||
@@ -74,6 +74,8 @@ static void try_help (char const *, char
|
||||
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;
|
||||
@@ -285,6 +287,13 @@ main (int argc, char **argv)
|
||||
re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
|
||||
excluded = new_exclude ();
|
||||
|
||||
+#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, NULL)) != -1)
|
||||
diff -up diffutils-3.3/src/diff.h.i18n diffutils-3.3/src/diff.h
|
||||
--- diffutils-3.3/src/diff.h.i18n 2013-02-02 04:39:05.000000000 +0000
|
||||
+++ diffutils-3.3/src/diff.h 2013-03-26 09:42:32.941357743 +0000
|
||||
@@ -23,6 +23,17 @@
|
||||
#include <stdio.h>
|
||||
#include <unlocked-io.h>
|
||||
|
||||
+/* 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: <wchar.h> must be included before <wctype.h>. */
|
||||
+# include <wchar.h>
|
||||
+# include <wctype.h>
|
||||
+# if defined (HAVE_MBRTOWC)
|
||||
+# define HANDLE_MULTIBYTE 1
|
||||
+# endif
|
||||
+#endif
|
||||
+
|
||||
/* What kind of changes a hunk contains. */
|
||||
enum changes
|
||||
{
|
||||
@@ -365,7 +376,11 @@ extern void print_sdiff_script (struct c
|
||||
extern char const change_letter[4];
|
||||
extern char const pr_program[];
|
||||
extern char *concat (char const *, char const *, char const *);
|
||||
-extern bool lines_differ (char const *, char const *) _GL_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) _GL_ATTRIBUTE_PURE;
|
||||
+#ifdef HANDLE_MULTIBYTE
|
||||
+extern bool lines_differ_multibyte (char const *, size_t, char const *, size_t) _GL_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.3/src/io.c.i18n diffutils-3.3/src/io.c
|
||||
--- diffutils-3.3/src/io.c.i18n 2013-02-02 04:39:05.000000000 +0000
|
||||
+++ diffutils-3.3/src/io.c 2013-03-26 09:40:26.215878488 +0000
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <cmpbuf.h>
|
||||
#include <file-type.h>
|
||||
#include <xalloc.h>
|
||||
+#include <assert.h>
|
||||
|
||||
/* Rotate an unsigned value to the left. */
|
||||
#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
|
||||
@@ -208,6 +209,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)
|
||||
@@ -234,12 +257,302 @@ 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;
|
||||
+ goto hashing_done;
|
||||
+ }
|
||||
+
|
||||
+ p1 += mblength;
|
||||
+ MBC2WC (p1, suffix_begin, mblength, wc, state, convfail);
|
||||
+ if (convfail || !iswspace (wc))
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ size_t repetitions = 1;
|
||||
+
|
||||
+ if (ig_white_space & IGNORE_TAB_EXPANSION)
|
||||
+ {
|
||||
+ bool flag = 0;
|
||||
+ if (convfail)
|
||||
+ column++;
|
||||
+ else
|
||||
+ switch (wc)
|
||||
+ {
|
||||
+ case L'\b':
|
||||
+ column -= 0 < column;
|
||||
+ break;
|
||||
+
|
||||
+ case L'\t':
|
||||
+ mbc[0] = ' ';
|
||||
+ mblength = 1;
|
||||
+ flag = 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)
|
||||
+ {
|
||||
+ 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++;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ 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)
|
||||
{
|
||||
@@ -390,7 +703,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.3/src/util.c.i18n diffutils-3.3/src/util.c
|
||||
--- diffutils-3.3/src/util.c.i18n 2013-02-02 04:39:05.000000000 +0000
|
||||
+++ diffutils-3.3/src/util.c 2013-03-26 09:40:26.215878488 +0000
|
||||
@@ -408,7 +408,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;
|
||||
@@ -564,6 +565,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. */
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff -up diffutils-3.3/po/Makefile.in.in.mkdir_p diffutils-3.3/po/Makefile.in.in
|
||||
--- diffutils-3.3/po/Makefile.in.in.mkdir_p 2013-03-26 11:25:58.869375066 +0000
|
||||
+++ diffutils-3.3/po/Makefile.in.in 2013-03-26 11:26:00.114379442 +0000
|
||||
@@ -42,7 +42,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
mkinstalldirs = $(SHELL) @install_sh@ -d
|
||||
install_sh = $(SHELL) @install_sh@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
-mkdir_p = @mkdir_p@
|
||||
+mkdir_p = @MKDIR_P@
|
||||
|
||||
GMSGFMT_ = @GMSGFMT@
|
||||
GMSGFMT_no = @GMSGFMT@
|
||||
227
diffutils.spec
227
diffutils.spec
|
|
@ -1,19 +1,24 @@
|
|||
Summary: A GNU collection of diff utilities
|
||||
Summary: GNU collection of diff utilities
|
||||
Name: diffutils
|
||||
Version: 3.3
|
||||
Release: 1%{?dist}
|
||||
Group: Applications/Text
|
||||
URL: http://www.gnu.org/software/diffutils/diffutils.html
|
||||
Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
|
||||
Patch1: diffutils-cmp-s-empty.patch
|
||||
Patch2: diffutils-mkdir_p.patch
|
||||
Patch4: diffutils-i18n.patch
|
||||
License: GPLv3+
|
||||
Requires(post): info
|
||||
Requires(preun): info
|
||||
Version: 3.12
|
||||
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
|
||||
# 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)
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: gcc
|
||||
BuildRequires: help2man
|
||||
BuildRequires: autoconf, automake, texinfo
|
||||
BuildRequires: make
|
||||
|
||||
%description
|
||||
Diffutils includes four utilities: diff, cmp, diff3 and sdiff. Diff
|
||||
|
|
@ -29,48 +34,198 @@ to merge two files interactively.
|
|||
Install diffutils if you need to compare text files.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
# For 'cmp -s', compare file sizes only if both non-zero (bug #563618).
|
||||
%patch1 -p1 -b .cmp-s-empty
|
||||
%autosetup -p1
|
||||
|
||||
# Work around @mkdir_p@ build issue.
|
||||
%patch2 -p1 -b .mkdir_p
|
||||
|
||||
%patch4 -p1 -b .i18n
|
||||
# Run autoreconf for aarch64 support (bug #925256).
|
||||
autoreconf
|
||||
|
||||
%build
|
||||
%configure
|
||||
make PR_PROGRAM=%{_bindir}/pr
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%make_install
|
||||
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
%find_lang %{name}
|
||||
|
||||
%check
|
||||
# Disable update-copyright gnulib test (bug #1239428).
|
||||
>gnulib-tests/test-update-copyright.sh
|
||||
make check
|
||||
|
||||
%post
|
||||
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
fi
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING NEWS README
|
||||
%doc NEWS README
|
||||
%license COPYING
|
||||
%{_bindir}/*
|
||||
%{_mandir}/*/*
|
||||
%{_infodir}/diffutils.info*gz
|
||||
%{_infodir}/diffutils.info*
|
||||
|
||||
%changelog
|
||||
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Mon May 05 2025 Than Ngo <than@redhat.com> - 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 <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
|
||||
|
||||
* Thu Mar 27 2025 Than Ngo <than@redhat.com> - 3.11-2
|
||||
- Backported upstream patch, Fixed allocation typo leading to crash
|
||||
|
||||
* Thu Mar 27 2025 Than Ngo <than@redhat.com> - 3.11-1
|
||||
- Fixed rhbz#2343469, Update to 3.11
|
||||
|
||||
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.10-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Tue Jul 30 2024 Than Ngo <than@redhat.com> - 3.10-8
|
||||
- refresh patch for 'cmp -s'
|
||||
|
||||
* Tue Jul 23 2024 Than Ngo <than@redhat.com> - 3.10-7
|
||||
- fix a regression, 'cmp -s' returns 1 even if files are identical
|
||||
|
||||
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.10-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.10-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.10-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.10-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Wed Jul 05 2023 Than Ngo <than@redhat.com> - 3.10-2
|
||||
- Fix output of "diff -l -y" for non-ASCII input files
|
||||
|
||||
* 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
|
||||
- Fix deprecated patch rpm marco
|
||||
|
||||
* Tue Feb 21 2023 Than Ngo <than@redhat.com> - 3.9-3
|
||||
- migrated to SPDX license
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.9-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Mon Jan 16 2023 Tim Waugh <twaugh@redhat.com> - 3.9-1
|
||||
- 3.9 (bug #2161117).
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.8-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.8-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Mon Aug 2 2021 Tim Waugh <twaugh@redhat.com> - 3.8-1
|
||||
- 3.8.
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Mon Apr 12 2021 Tim Waugh <twaugh@redhat.com> - 3.7-9
|
||||
- Handle SIGSTKSZ no longer being a constant (bug #1943016).
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Thu Oct 8 2020 Tim Waugh <twaugh@redhat.com> - 3.7-7
|
||||
- Fix from gnulib upstream, commit 175e0bc (bug #1863423).
|
||||
|
||||
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-6
|
||||
- Second attempt - Rebuilt for
|
||||
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Mon Jan 07 2019 Than Ngo <than@redhat.com> - 3.7-1
|
||||
- 3.7
|
||||
|
||||
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Mon May 22 2017 Tim Waugh <twaugh@redhat.com> - 3.6-1
|
||||
- 3.6 (bug #1453019).
|
||||
|
||||
* Tue Feb 21 2017 Than Ngo <than@redhat.com> - 3.5-3
|
||||
- backport to fix FTBFs with GCC 7
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Wed Sep 21 2016 Tim Waugh <twaugh@redhat.com> - 3.5-1
|
||||
- 3.5 (bug #1365325).
|
||||
|
||||
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Mon Jul 6 2015 Tim Waugh <twaugh@redhat.com> - 3.3-12
|
||||
- Disable update-copyright gnulib test (bug #1239428).
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 3.3-10
|
||||
- Rebuilt for Fedora 23 Change
|
||||
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
|
||||
|
||||
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Fri Jul 11 2014 Tom Callaway <spot@fedoraproject.org> - 3.3-8
|
||||
- fix license handling
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Thu Mar 27 2014 Tim Waugh <twaugh@redhat.com> 3.3-6
|
||||
- Fix --help output and man page (bug #1079076).
|
||||
|
||||
* Wed Dec 4 2013 Tim Waugh <twaugh@redhat.com> 3.3-5
|
||||
- Applied upstream gnulib patch to avoid -Wformat-security warning
|
||||
(bug #1037038).
|
||||
|
||||
* Wed Oct 23 2013 Tim Waugh <twaugh@redhat.com> 3.3-4
|
||||
- Fixed multibyte handling logic for diff -Z (bug #1012075).
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Mon Apr 29 2013 Tim Waugh <twaugh@redhat.com> 3.3-2
|
||||
- Run autoreconf for aarch64 support (bug #925256).
|
||||
|
||||
* Tue Mar 26 2013 Tim Waugh <twaugh@redhat.com> 3.3-1
|
||||
- 3.3 (bug #927560).
|
||||
|
||||
|
|
|
|||
5
plans/ci.fmf
Normal file
5
plans/ci.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
99180208ec2a82ce71f55b0d7389f1b3 diffutils-3.3.tar.xz
|
||||
SHA512 (diffutils-3.12.tar.xz) = 10b17cf1dcdfa9ca0e5db91d62c4a079ebe9fd7eafa3aaebd4eb7e6206e4d753f348496622aa281e1bd7f7fcde65ce4a886dcc4acbb59332ef980f224197b4e4
|
||||
|
|
|
|||
63
tests/cmp-s-returns-1-even-if-files-are-identical/Makefile
Normal file
63
tests/cmp-s-returns-1-even-if-files-are-identical/Makefile
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical
|
||||
# Description: Test for cmp -s returns 1 even if files are identical
|
||||
# Author: Jeffrey Bastian <jbastian@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Jeffrey Bastian <jbastian@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for cmp -s returns 1 even if files are identical" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: diffutils" >> $(METADATA)
|
||||
@echo "Requires: diffutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
PURPOSE of /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical
|
||||
Description: Test for cmp -s returns 1 even if files are identical
|
||||
Author: Jeffrey Bastian <jbastian@redhat.com>
|
||||
Bug summary: cmp -s returns 1 even if files are identical
|
||||
|
||||
Description:
|
||||
'cmp -s' can return 1 even if files are identical, for example, if comparing
|
||||
a file from /proc with a copy of that file in /tmp, since all files in
|
||||
/proc have a size of 0 bytes.
|
||||
17
tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf
Normal file
17
tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf
Normal file
|
|
@ -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 <jbastian@redhat.com>
|
||||
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
|
||||
50
tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh
Executable file
50
tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical
|
||||
# Description: Test for cmp -s returns 1 even if files are identical
|
||||
# Author: Jeffrey Bastian <jbastian@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="diffutils"
|
||||
#set -x
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlAssertExists $TmpDir
|
||||
rlRun "cp /proc/version $TmpDir" 0 "Copy /proc/version to tmp directory"
|
||||
rlRun "cmp -s /proc/version $TmpDir/version" 0 "Compare /proc/version to tmp copy"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "rm -fr $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
rlJournalPrintText
|
||||
64
tests/diff-Z-hangs/Makefile
Normal file
64
tests/diff-Z-hangs/Makefile
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/diffutils/Regression/diff-Z-hangs
|
||||
# Description: Test for diffutils to check if comparing two files using diff -Z with mixed line endings doesn't hang
|
||||
# Author: Filip Holec <fholec@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/diffutils/Regression/diff-Z-hangs
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Filip Holec <fholec@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for diffutils to check if comparing two files using diff -Z with mixed line endings doesn't hang" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: diffutils" >> $(METADATA)
|
||||
@echo "Requires: diffutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: RHEL7" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
4
tests/diff-Z-hangs/PURPOSE
Normal file
4
tests/diff-Z-hangs/PURPOSE
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
PURPOSE of /CoreOS/diffutils/Regression/diff-Z-hangs
|
||||
Description: Test for diffutils to check if comparing two files using diff -Z with mixed line endings doesn't hang
|
||||
Author: Filip Holec <fholec@redhat.com>
|
||||
Bug summary: diff -Z hangs
|
||||
13
tests/diff-Z-hangs/main.fmf
Normal file
13
tests/diff-Z-hangs/main.fmf
Normal file
|
|
@ -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 <fholec@redhat.com>
|
||||
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
|
||||
55
tests/diff-Z-hangs/runtest.sh
Executable file
55
tests/diff-Z-hangs/runtest.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/diffutils/Regression/diff-Z-hangs
|
||||
# Description: Test for diffutils to check if comparing two files using diff -Z with mixed line endings doesn't hang
|
||||
# Author: Filip Holec <fholec@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGE="diffutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "diff -Z <(printf 'a\nb\n') <(printf 'a\nb\n'); echo $?" \
|
||||
0 "First simple test"
|
||||
rlRun "timeout 10s diff -Z <(printf 'a\r\nb\n') <(printf 'a\nb\r\n')" \
|
||||
0 "Main test, should not timeout (124)"
|
||||
rlRun "timeout 10s diff -Z <(echo 'a') <(echo -n 'a')" \
|
||||
0 "Second test, should not timeout (124)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
61
tests/diff-hang-long-files/Makefile
Normal file
61
tests/diff-hang-long-files/Makefile
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# Makefile - diff-hang-long-files
|
||||
# Author: Michal Fabry <mfabry@redhat.com>
|
||||
# Location: /CoreOS/diffutils/Regression/diff-hang-long-files/Makefile
|
||||
|
||||
# Description: Diff appears to hang in long file
|
||||
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
|
||||
TOPLEVEL_NAMESPACE=/CoreOS
|
||||
PACKAGE_NAME=diffutils
|
||||
RELATIVE_PATH=Regression/diff-hang-long-files
|
||||
|
||||
export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
@echo "Owner: Michal Fabry <mfabry@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: Diff appears to hang in long file" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "Requires: $(PACKAGE_NAME) words time" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
10
tests/diff-hang-long-files/PURPOSE
Normal file
10
tests/diff-hang-long-files/PURPOSE
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Test Name: diff-hang-long-files
|
||||
Author: Michal Fabry <mfabry@redhat.com>
|
||||
Location: /CoreOS/diffutils/Regression/diff-hang-long-files
|
||||
|
||||
Short Description: Diff appears to hang in long file
|
||||
|
||||
|
||||
Long Description:
|
||||
|
||||
Running 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.
|
||||
20
tests/diff-hang-long-files/main.fmf
Normal file
20
tests/diff-hang-long-files/main.fmf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
summary: Diff appears to hang in long file
|
||||
description: "Test Name: diff-hang-long-files\nAuthor: Michal Fabry <mfabry@redhat.com>\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 <mfabry@redhat.com>
|
||||
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
|
||||
78
tests/diff-hang-long-files/runtest.sh
Executable file
78
tests/diff-hang-long-files/runtest.sh
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
#!/bin/bash
|
||||
# Author: Michal Fabry <mfabry@redhat.com>
|
||||
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
|
||||
rlJournalStart
|
||||
|
||||
# ===================================================================
|
||||
# Setup - ABORT if some assert fails
|
||||
# ===================================================================
|
||||
rlPhaseStartSetup Setup
|
||||
|
||||
set -o pipefail
|
||||
|
||||
function count_lines() {
|
||||
[ ! -r "$1" ] && return 1
|
||||
wc -l "$1" | sed "s/^\s*\([0-9]\+\)\s\+.*$/\1/"
|
||||
}
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
|
||||
# ===================================================================
|
||||
# Start the test
|
||||
# ===================================================================
|
||||
# -------------------------------------------------------------------
|
||||
# Create connection
|
||||
rlPhaseStartTest "Create big file"
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
log=$( mktemp /tmp/log.XXXXXX )
|
||||
|
||||
rlRun "tr -d \"'\" <words | xargs echo >long-line" 0 "Create big file part 1"
|
||||
rlRun "for a in \$(seq 30); do cat long-line; done >long-lines" 0 "Create big file part 2"
|
||||
rlAssertExists 'long-lines'
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Test /usr/sbin/ss output
|
||||
rlPhaseEnd; rlPhaseStartTest "Test diff"
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
log2=$( mktemp /tmp/log.XXXXXX )
|
||||
now=$(date '+%s')
|
||||
rlRun "diff -bBw long-lines <(sed -e 's/ / /' long-lines) >/dev/null"
|
||||
rlAssertGreater "Less than 150 seconds" 150 `expr $now - $(date '+%s')`
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
|
||||
|
||||
# ===================================================================
|
||||
# Start the cleanup
|
||||
# ===================================================================
|
||||
rlPhaseStartCleanup Cleanup
|
||||
|
||||
rm -f $log $log2 long-line long-lines
|
||||
rlAssert0 "Remove the log" $?
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
#rlCreateLogFromJournal | tee $OUTPUTFILE
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
479828
tests/diff-hang-long-files/words
Normal file
479828
tests/diff-hang-long-files/words
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,63 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
|
||||
# Description: Test for diffutils to ensure U3000 ideographic space is treated as space when used -b or -w options
|
||||
# Author: Filip Holec <fholec@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE a b
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Filip Holec <fholec@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for diffutils to ensure U3000 ideographic space is treated as space when used -b or -w options" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: diffutils" >> $(METADATA)
|
||||
@echo "Requires: diffutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
PURPOSE of /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
|
||||
Description: Test for diffutils to ensure U3000 ideographic space is treated as space when used -b or -w options
|
||||
Author: Filip Holec <fholec@redhat.com>
|
||||
Bug summary: diff -w/-b doesn't treat U3000 (IDEOGRAPHIC SPACE) as space
|
||||
|
||||
Test for diffutils to ensure U3000 ideographic space is treated as space when used -b or -w options
|
||||
|
|
@ -0,0 +1 @@
|
|||
a b
|
||||
|
|
@ -0,0 +1 @@
|
|||
a b
|
||||
|
|
@ -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 <fholec@redhat.com>
|
||||
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
|
||||
57
tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh
Executable file
57
tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
|
||||
# Description: Test for diffutils to ensure U3000 ideographic space is treated as space when used -b or -w options
|
||||
# Author: Filip Holec <fholec@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGE="diffutils"
|
||||
|
||||
# This test requires a non-C locale. Lets make it predictable
|
||||
export LC_ALL=en_US.utf8
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp a b $TmpDir" 0 "Copy files to $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "diff -w a b >out" 0 "diff with -w option"
|
||||
rlRun "[ ! -s out ]" 0 "Output should be empty"
|
||||
rlRun "diff -b a b >out" 0 "diff with -b option"
|
||||
rlRun "[ ! -s out ]" 0 "Output should be empty"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
63
tests/sdiff-does-not-recognize-E-option/Makefile
Normal file
63
tests/sdiff-does-not-recognize-E-option/Makefile
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option
|
||||
# Description: Test for sdiff does not recognize -E option
|
||||
# Author: Martin Kyral <mkyral@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE file1 file2
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Kyral <mkyral@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for sdiff does not recognize -E option" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 10m" >> $(METADATA)
|
||||
@echo "RunFor: diffutils" >> $(METADATA)
|
||||
@echo "Requires: diffutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: yes" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
6
tests/sdiff-does-not-recognize-E-option/PURPOSE
Normal file
6
tests/sdiff-does-not-recognize-E-option/PURPOSE
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
PURPOSE of /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option
|
||||
Description: Test for sdiff does not recognize -E option
|
||||
Author: Martin Kyral <mkyral@redhat.com>
|
||||
Bug summary: sdiff does not recognize -E option
|
||||
|
||||
The 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.
|
||||
2
tests/sdiff-does-not-recognize-E-option/file1
Normal file
2
tests/sdiff-does-not-recognize-E-option/file1
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
aaa
|
||||
bbb
|
||||
2
tests/sdiff-does-not-recognize-E-option/file2
Normal file
2
tests/sdiff-does-not-recognize-E-option/file2
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
aaa
|
||||
bbb
|
||||
14
tests/sdiff-does-not-recognize-E-option/main.fmf
Normal file
14
tests/sdiff-does-not-recognize-E-option/main.fmf
Normal file
|
|
@ -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 <mkyral@redhat.com>
|
||||
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
|
||||
51
tests/sdiff-does-not-recognize-E-option/runtest.sh
Executable file
51
tests/sdiff-does-not-recognize-E-option/runtest.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option
|
||||
# Description: Test for sdiff does not recognize -E option
|
||||
# Author: Martin Kyral <mkyral@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="diffutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp file1 file2 $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "sdiff -E file1 file2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
85
tests/whitespace/Makefile
Normal file
85
tests/whitespace/Makefile
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Author: bpeck@redhat.com
|
||||
|
||||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
||||
# Example Makefile for RHTS #
|
||||
# This example is geared towards a test for a specific package #
|
||||
# It does most of the work for you, but may require further coding #
|
||||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
||||
|
||||
# The toplevel namespace within which the test lives.
|
||||
# FIXME: You will need to change this:
|
||||
TOPLEVEL_NAMESPACE=CoreOS
|
||||
|
||||
# The name of the package under test:
|
||||
# FIXME: you wil need to change this:
|
||||
PACKAGE_NAME=diffutils
|
||||
|
||||
# The path of the test below the package:
|
||||
# FIXME: you wil need to change this:
|
||||
RELATIVE_PATH=whitespace
|
||||
|
||||
# Version of the Test. Used with make tag.
|
||||
export TESTVERSION=1.1
|
||||
|
||||
# The combined namespace of the test.
|
||||
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
|
||||
|
||||
# A phony target is one that is not really the name of a file.
|
||||
# It is just a name for some commands to be executed when you
|
||||
# make an explicit request. There are two reasons to use a
|
||||
# phony target: to avoid a conflict with a file of the same
|
||||
# name, and to improve performance.
|
||||
.PHONY: all install download clean
|
||||
|
||||
# executables to be built should be added here, they will be generated on the system under test.
|
||||
BUILT_FILES=
|
||||
|
||||
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE file1 file2
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ *.rpm $(BUILT_FILES)
|
||||
|
||||
# You may need to add other targets e.g. to build executables from source code
|
||||
# Add them here:
|
||||
|
||||
|
||||
# Include Common Makefile
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
# Generate the testinfo.desc here:
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
# Change to the test owner's name
|
||||
@echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "License: GPL V2" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: diff -b should ignore whitespace ">> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
|
||||
# You may need other fields here; see the documentation
|
||||
rhts-lint $(METADATA)
|
||||
10
tests/whitespace/PURPOSE
Normal file
10
tests/whitespace/PURPOSE
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Create 2 files, f1, f2 with contents "abc" and "abc " (without quotes),
|
||||
i.e. the same line with a space on the end.
|
||||
|
||||
Diff ignoring whitespace:
|
||||
|
||||
diff -b f1 f2
|
||||
|
||||
should produce no diff output, but does on F8. Works fine on FC6.
|
||||
|
||||
version: diffutils-2.8.1-17.fc8
|
||||
1
tests/whitespace/file1
Normal file
1
tests/whitespace/file1
Normal file
|
|
@ -0,0 +1 @@
|
|||
abc
|
||||
1
tests/whitespace/file2
Normal file
1
tests/whitespace/file2
Normal file
|
|
@ -0,0 +1 @@
|
|||
abc
|
||||
15
tests/whitespace/main.fmf
Normal file
15
tests/whitespace/main.fmf
Normal file
|
|
@ -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 <bpeck@redhat.com>
|
||||
component:
|
||||
- diffutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- diffutils
|
||||
duration: 5m
|
||||
extra-summary: /CoreOS/diffutils/whitespace
|
||||
extra-task: /CoreOS/diffutils/whitespace
|
||||
36
tests/whitespace/runtest.sh
Executable file
36
tests/whitespace/runtest.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Author: Bill Peck
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="diffutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "diff -b file1 file2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "rm -fr $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
rlJournalPrintText
|
||||
Loading…
Add table
Add a link
Reference in a new issue