Accepting request 356783 from home:berny:branches:Base:System

- Update to 8.25
  (for details see included NEWS file)
- coreutils.spec (%description): Add base32, a new utility.
- Remove now-upstream patch:
  * coreutils-tests-avoid-FP-of-ls-stat-free-color.patch
- Refresh/merge all other patches:
  * coreutils-build-timeout-as-pie.patch
  * coreutils-disable_tests.patch
  * coreutils-i18n.patch
  * coreutils-invalid-ids.patch
  * coreutils-misc.patch
  * coreutils-ocfs2_reflinks.patch
  * coreutils-remove_hostname_documentation.patch
  * coreutils-remove_kill_documentation.patch
  * coreutils-skip-gnulib-test-tls.patch
  * coreutils-test_without_valgrind.patch
  * coreutils-tests-shorten-extreme-factor-tests.patch

OBS-URL: https://build.opensuse.org/request/show/356783
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=270
This commit is contained in:
Bernhard Voelker 2016-01-30 07:32:56 +00:00 committed by Git OBS Bridge
parent 378fb2110c
commit 7a83ba63d6
21 changed files with 274 additions and 343 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a2d75286a4b9ef3a13039c2da3868a61be4ee9f17d8ae380a35a97e506972170
size 5649896

View File

@ -1,17 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJVlwFSAAoJEN9v2XEwYDfZ3IwP/3KOp/R3kHQMn4XKlecernhK
1iR0sh13gVhf4gVm/TbzLYmjSnWZzxQTs2WfyEZvbsm7pjKW0ulT7hqM81tKBkNH
7VpOUWVhvQUjwLGbV3lQsPrcshFejkWq3noHRIoTR6TsbwSyNqJ67wR/Ix+aDDBR
vfrCnG544+Dpl2RWF6bvib2+moWy+ztMghkiIONcqDg2KNhTB6V45CZ64Vw2S/1Z
88kSfd48D88wk06yKtoHck4A7DNqNLE+QHKbNy2BtTkvfT4x00XYRESPv/P1wKMk
n7mmJHx6idB3cvpm1vk0xiA8Xa3h1ot8w6a47NY48B8/UuwE6AROReWAwXAVOAvW
lInr4YP9YTYLAoUsH7RhrtFVUwIBZme6rbYeKvaU59LuVgQBL6eG5zHq5a45sCHg
8Bezfx5eXak4PClS36TguN350l5wbfBqiCxfqy05g+r0xYgTaFWKujmlP8c+8AN3
nOaNle4LUioC6RIvoZu/h/nhwYl6/HIRt/dlZ5/TRvs+YKo58Y8lXAKcWixHfk7s
Rx/NZWOMwhdyKqjRDADflauzpI/YboGkafozzHkIZg+uBd3zgTAAfUCvEHSGpKvw
pVlXIH4VN2gOfNroDMUAJN2UiIxp4Weukfk/gkMFAIlxmjZAcZ7wLKjABf4Vqeq+
Iubv9MiiqMa1t/MsDDb5
=Zz9/
-----END PGP SIGNATURE-----

3
coreutils-8.25.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87
size 5725008

17
coreutils-8.25.tar.xz.sig Normal file
View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJWn2zaAAoJEN9v2XEwYDfZvPsP/0o/JM9G7sLXFBX93XO7uYWH
8q2I5hIWcQZiGc/1PZtHM+2GLkh0heiLcKcsY1Ewk/EYlRuGS5MO5M4dh5YHAeaE
LFNfJcAIvClhwgniVXvElTaEfyBDhslh9WVKJCgZ748s6AgDv0SD5dI0X7bpj4Pz
j8wpWaJdrf8kRrjNqhTJtrmO92fUbkULG9+kmp9HZZFYzPUcLyF0ZdA2j3ZxWwP0
OK9zfuY08mVdPVFlPjep1kvNX+See86xDd3HiOkxAJ3oDvHCKPzn8PzREejYAMl+
NfdHovMw85MzaQlYsqduyr9iTBQSOyO6KJ85VM3GEexjxyGqqgwgSXLw9SZgaF9L
pbzAlcvGsFxsOEJF27dllL03SSqMfvDOXs/vRKALzi8jxW/gyGRG3Ft8Dd0pW70w
1vqRwFf/XQuChTUTYsAlshcKu8MPrQbJoU6UPbZOj0odFaWxNQ/E4msoN/NT9Xbi
5buuf43mvUmMXXT+p+fwXiaATn8wuOd4G/Mzc2Q/4zpyUi4MvnmUZ0FD0F39r1WS
jZI2QS8ktpOqV11WArShZLo6X0T9tHHt40/3PLeXJE+RuddU2VR+Yzx3jqUTK8TJ
7S9/DEu+l7dgioZdaXFwS0FcenH4PvRT+V0PwmPMWwrTKDa0G/zrtva488dCJQM7
SUlh/zsEIB3hX2erMwTl
=W+ce
-----END PGP SIGNATURE-----

View File

@ -27,7 +27,7 @@ Index: src/local.mk
# The list of all programs (separated in different variables to express
# the how and when they should be installed) is defined in this makefile
@@ -276,6 +276,9 @@ src_factor_LDADD += $(LIB_GMP)
@@ -278,6 +278,9 @@ src_factor_LDADD += $(LIB_GMP)
# for getloadavg
src_uptime_LDADD += $(GETLOADAVG_LIBS)

View File

@ -4,9 +4,9 @@
Index: gnulib-tests/gnulib.mk
===================================================================
--- gnulib-tests/gnulib.mk.orig 2015-07-09 15:10:56.833805476 +0200
+++ gnulib-tests/gnulib.mk 2015-07-09 15:10:56.851805050 +0200
@@ -907,11 +907,11 @@ EXTRA_DIST += test-getloadavg.c signatur
--- gnulib-tests/gnulib.mk.orig
+++ gnulib-tests/gnulib.mk
@@ -899,11 +899,11 @@ EXTRA_DIST += test-getloadavg.c signatur
## end gnulib module getloadavg-tests
## begin gnulib module getlogin-tests

View File

@ -1,12 +1,12 @@
lib/linebuffer.h | 8
src/cut.c | 443 ++++++++++++++++++++++++-
src/cut.c | 441 ++++++++++++++++++++++++-
src/expand.c | 165 +++++++++
src/fold.c | 308 ++++++++++++++++-
src/join.c | 363 ++++++++++++++++++--
src/pr.c | 444 +++++++++++++++++++++++--
src/sort.c | 763 +++++++++++++++++++++++++++++++++++++++++---
src/sort.c | 765 +++++++++++++++++++++++++++++++++++++++++---
src/unexpand.c | 228 +++++++++++++
src/uniq.c | 265 ++++++++++++++-
src/uniq.c | 263 ++++++++++++++-
tests/i18n/sort-month.sh | 34 +
tests/i18n/sort.sh | 29 +
tests/local.mk | 3
@ -20,7 +20,7 @@
tests/misc/unexpand.pl | 39 ++
tests/misc/uniq.pl | 55 +++
tests/pr/pr-tests.pl | 49 ++
22 files changed, 3290 insertions(+), 180 deletions(-)
22 files changed, 3287 insertions(+), 181 deletions(-)
Index: lib/linebuffer.h
===================================================================
@ -64,9 +64,9 @@ Index: src/cut.c
#include "system.h"
#include "error.h"
@@ -37,6 +42,18 @@
#include "quote.h"
#include "xstrndup.h"
@@ -38,6 +43,18 @@
#include "set-fields.h"
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */
@ -83,7 +83,7 @@ Index: src/cut.c
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cut"
@@ -53,6 +70,52 @@
@@ -54,6 +71,52 @@
} \
while (0)
@ -134,18 +134,19 @@ Index: src/cut.c
+ while (0)
+
struct range_pair
{
@@ -75,6 +138,8 @@ static size_t n_rp;
/* Number of `struct range_pair's allocated. */
static size_t n_rp_allocated;
/* Pointer inside RP. When checking if a byte or field is selected
by a finite range, we check if it is between CURRENT_RP.LO
@@ -61,6 +124,9 @@
CURRENT_RP.HI then we make CURRENT_RP to point to the next range pair. */
static struct field_range_pair *current_rp;
+/* Length of the delimiter given as argument to -d. */
+size_t delimlen;
/* Append LOW, HIGH to the list RP of range pairs, allocating additional
space if necessary. Update global variable N_RP. When allocating,
@@ -106,15 +171,25 @@ enum operating_mode
+
/* This buffer is used to support the semantics of the -s option
(or lack of same) when the specified field list includes (does
not include) the first field. In both of those cases, the entire
@@ -77,15 +143,25 @@ enum operating_mode
{
undefined_mode,
@ -172,7 +173,7 @@ Index: src/cut.c
/* If true do not output lines containing no delimiter characters.
Otherwise, all such lines are printed. This option is valid only
with field mode. */
@@ -126,6 +201,9 @@ static bool complement;
@@ -97,6 +173,9 @@ static bool complement;
/* The delimiter character for field mode. */
static unsigned char delim;
@ -180,9 +181,9 @@ Index: src/cut.c
+static wchar_t wcdelim;
+#endif
/* True if the --output-delimiter=STRING option was specified. */
static bool output_delimiter_specified;
@@ -189,7 +267,7 @@ Print selected parts of lines from each
/* The delimiter for each line/record. */
static unsigned char line_delim = '\n';
@@ -164,7 +243,7 @@ Print selected parts of lines from each
-f, --fields=LIST select only these fields; also print any line\n\
that contains no delimiter character, unless\n\
the -s option is specified\n\
@ -191,17 +192,7 @@ Index: src/cut.c
"), stdout);
fputs (_("\
--complement complement the set of selected bytes, characters\n\
@@ -380,6 +458,9 @@ set_fields (const char *fieldstr)
if (operating_mode == byte_mode)
error (0, 0,
_("byte offset %s is too large"), quote (bad_num));
+ else if (operating_mode == character_mode)
+ error (0, 0,
+ _("character offset %s is too large"), quote (bad_num));
else
error (0, 0,
_("field number %s is too large"), quote (bad_num));
@@ -504,6 +585,82 @@ cut_bytes (FILE *stream)
@@ -280,6 +359,82 @@ cut_bytes (FILE *stream)
}
}
@ -235,7 +226,7 @@ Index: src/cut.c
+ bufpos = buf;
+ memset (&state, '\0', sizeof(mbstate_t));
+
+ current_rp = rp;
+ current_rp = frp;
+
+ while (1)
+ {
@ -247,15 +238,15 @@ Index: src/cut.c
+ if (wc == WEOF)
+ {
+ if (idx > 0)
+ putchar ('\n');
+ putchar (line_delim);
+ break;
+ }
+ else if (wc == L'\n')
+ else if (wc == line_delim)
+ {
+ putchar ('\n');
+ putchar (line_delim);
+ idx = 0;
+ print_delimiter = false;
+ current_rp = rp;
+ current_rp = frp;
+ }
+ else
+ {
@ -284,7 +275,7 @@ Index: src/cut.c
/* Read from stream STREAM, printing to standard output any selected fields. */
static void
@@ -648,13 +805,211 @@ cut_fields (FILE *stream)
@@ -425,13 +580,211 @@ cut_fields (FILE *stream)
}
}
@ -306,7 +297,7 @@ Index: src/cut.c
+ mbstate_t state; /* State of the stream. */
+ bool convfail = false; /* true, when conversion failed. Otherwise false. */
+
+ current_rp = rp;
+ current_rp = frp;
+
+ found_any_selected_field = 0;
+ field_idx = 1;
@ -354,7 +345,7 @@ Index: src/cut.c
+ buflen -= mblength;
+ bufpos += mblength;
+
+ if (!convfail && (wc == L'\n' || wc == wcdelim))
+ if (!convfail && (wc == line_delim || wc == wcdelim))
+ break;
+ }
+
@ -374,8 +365,8 @@ Index: src/cut.c
+ {
+ fwrite (field_1_buffer, sizeof (char), len, stdout);
+ /* Make sure the output line is newline terminated. */
+ if (convfail || (!convfail && wc != L'\n'))
+ putchar ('\n');
+ if (convfail || (!convfail && wc != line_delim))
+ putchar (line_delim);
+ }
+ continue;
+ }
@ -410,7 +401,7 @@ Index: src/cut.c
+
+ if (wc == WEOF)
+ break;
+ else if (!convfail && (wc == wcdelim || wc == L'\n'))
+ else if (!convfail && (wc == wcdelim || wc == line_delim))
+ {
+ buflen -= mblength;
+ bufpos += mblength;
@ -425,20 +416,20 @@ Index: src/cut.c
+ }
+ }
+
+ if ((!convfail || wc == L'\n') && buflen < 1)
+ if ((!convfail || wc == line_delim) && buflen < 1)
+ wc = WEOF;
+
+ if (!convfail && wc == wcdelim)
+ next_item (&field_idx);
+ else if (wc == WEOF || (!convfail && wc == L'\n'))
+ else if (wc == WEOF || (!convfail && wc == line_delim))
+ {
+ if (found_any_selected_field
+ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
+ putchar ('\n');
+ putchar (line_delim);
+ if (wc == WEOF)
+ break;
+ field_idx = 1;
+ current_rp = rp;
+ current_rp = frp;
+ found_any_selected_field = 0;
+ }
+ }
@ -499,7 +490,7 @@ Index: src/cut.c
}
/* Process file FILE to standard output.
@@ -706,6 +1061,7 @@ main (int argc, char **argv)
@@ -483,6 +836,7 @@ main (int argc, char **argv)
bool ok;
bool delim_specified = false;
char *spec_list_string IF_LINT ( = NULL);
@ -507,7 +498,7 @@ Index: src/cut.c
initialize_main (&argc, &argv);
set_program_name (argv[0]);
@@ -728,7 +1084,6 @@ main (int argc, char **argv)
@@ -505,7 +859,6 @@ main (int argc, char **argv)
switch (optc)
{
case 'b':
@ -515,7 +506,7 @@ Index: src/cut.c
/* Build the byte list. */
if (operating_mode != undefined_mode)
FATAL_ERROR (_("only one type of list may be specified"));
@@ -736,6 +1091,14 @@ main (int argc, char **argv)
@@ -513,6 +866,14 @@ main (int argc, char **argv)
spec_list_string = optarg;
break;
@ -530,7 +521,7 @@ Index: src/cut.c
case 'f':
/* Build the field list. */
if (operating_mode != undefined_mode)
@@ -747,10 +1110,38 @@ main (int argc, char **argv)
@@ -524,10 +885,38 @@ main (int argc, char **argv)
case 'd':
/* New delimiter. */
/* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
@ -573,7 +564,7 @@ Index: src/cut.c
break;
case OUTPUT_DELIMITER_OPTION:
@@ -763,6 +1154,7 @@ main (int argc, char **argv)
@@ -540,6 +929,7 @@ main (int argc, char **argv)
break;
case 'n':
@ -581,8 +572,8 @@ Index: src/cut.c
break;
case 's':
@@ -802,15 +1194,34 @@ main (int argc, char **argv)
}
@@ -579,15 +969,34 @@ main (int argc, char **argv)
| (complement ? SETFLD_COMPLEMENT : 0) );
if (!delim_specified)
- delim = '\t';
@ -946,7 +937,7 @@ Index: src/fold.c
-
- if (istream == NULL)
- {
- error (0, errno, "%s", filename);
- error (0, errno, "%s", quotef (filename));
- return false;
- }
@ -1176,7 +1167,7 @@ Index: src/fold.c
+
+ if (istream == NULL)
+ {
+ error (0, errno, "%s", filename);
+ error (0, errno, "%s", quotef (filename));
+ return 1;
+ }
+
@ -1190,7 +1181,7 @@ Index: src/fold.c
+
if (ferror (istream))
{
error (0, saved_errno, "%s", filename);
error (0, saved_errno, "%s", quotef (filename));
@@ -251,7 +498,8 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -1290,7 +1281,7 @@ Index: src/join.c
+ else
{
/* Skip leading blanks before the first field. */
while (isblank (to_uchar (*ptr)))
while (field_sep (*ptr))
@@ -305,6 +322,147 @@ xfields (struct line *line)
extract_field (line, ptr, lim - ptr);
}
@ -1359,7 +1350,7 @@ Index: src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
+ if (!iswblank(wc))
+ if (!iswblank(wc) && wc != '\n')
+ break;
+ ptr += mblength;
+ }
@ -1390,7 +1381,7 @@ Index: src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
+ if (iswblank (wc))
+ if (iswblank (wc) || wc == '\n')
+ break;
+
+ sep += mblength;
@ -1423,7 +1414,7 @@ Index: src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
+ if (!iswblank (wc))
+ if (!iswblank (wc) && wc != '\n')
+ break;
+
+ ptr += mblength;
@ -1718,7 +1709,7 @@ Index: src/pr.c
===================================================================
--- src/pr.c.orig
+++ src/pr.c
@@ -312,6 +312,24 @@
@@ -311,6 +311,24 @@
#include <getopt.h>
#include <sys/types.h>
@ -1743,7 +1734,7 @@ Index: src/pr.c
#include "system.h"
#include "error.h"
#include "fadvise.h"
@@ -324,6 +342,18 @@
@@ -323,6 +341,18 @@
#include "xstrtol.h"
#include "xdectoint.h"
@ -1762,7 +1753,7 @@ Index: src/pr.c
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "pr"
@@ -416,7 +446,20 @@ struct COLUMN
@@ -415,7 +445,20 @@ struct COLUMN
typedef struct COLUMN COLUMN;
@ -1784,7 +1775,7 @@ Index: src/pr.c
static bool read_line (COLUMN *p);
static bool print_page (void);
static bool print_stored (COLUMN *p);
@@ -428,6 +471,7 @@ static void add_line_number (COLUMN *p);
@@ -427,6 +470,7 @@ static void add_line_number (COLUMN *p);
static void getoptnum (const char *n_str, int min, int *num,
const char *errfmt);
static void getoptarg (char *arg, char switch_char, char *character,
@ -1792,7 +1783,7 @@ Index: src/pr.c
int *number);
static void print_files (int number_of_files, char **av);
static void init_parameters (int number_of_files);
@@ -441,7 +485,6 @@ static void store_char (char c);
@@ -440,7 +484,6 @@ static void store_char (char c);
static void pad_down (unsigned int lines);
static void read_rest_of_line (COLUMN *p);
static void skip_read (COLUMN *p, int column_number);
@ -1800,7 +1791,7 @@ Index: src/pr.c
static void cleanup (void);
static void print_sep_string (void);
static void separator_string (const char *optarg_S);
@@ -453,7 +496,7 @@ static COLUMN *column_vector;
@@ -452,7 +495,7 @@ static COLUMN *column_vector;
we store the leftmost columns contiguously in buff.
To print a line from buff, get the index of the first character
from line_vector[i], and print up to line_vector[i + 1]. */
@ -1809,7 +1800,7 @@ Index: src/pr.c
/* Index of the position in buff where the next character
will be stored. */
@@ -557,7 +600,7 @@ static int chars_per_column;
@@ -556,7 +599,7 @@ static int chars_per_column;
static bool untabify_input = false;
/* (-e) The input tab character. */
@ -1818,7 +1809,7 @@ Index: src/pr.c
/* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
where the leftmost column is 1. */
@@ -567,7 +610,10 @@ static int chars_per_input_tab = 8;
@@ -566,7 +609,10 @@ static int chars_per_input_tab = 8;
static bool tabify_output = false;
/* (-i) The output tab character. */
@ -1830,7 +1821,7 @@ Index: src/pr.c
/* (-i) The width of the output tab. */
static int chars_per_output_tab = 8;
@@ -637,7 +683,13 @@ static int line_number;
@@ -636,7 +682,13 @@ static int line_number;
static bool numbered_lines = false;
/* (-n) Character which follows each line number. */
@ -1845,7 +1836,7 @@ Index: src/pr.c
/* (-n) line counting starts with 1st line of input file (not with 1st
line of 1st page printed). */
@@ -690,6 +742,7 @@ static bool use_col_separator = false;
@@ -689,6 +741,7 @@ static bool use_col_separator = false;
-a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */
static char *col_sep_string = (char *) "";
static int col_sep_length = 0;
@ -1853,7 +1844,7 @@ Index: src/pr.c
static char *column_separator = (char *) " ";
static char *line_separator = (char *) "\t";
@@ -840,6 +893,13 @@ separator_string (const char *optarg_S)
@@ -839,6 +892,13 @@ separator_string (const char *optarg_S)
col_sep_length = (int) strlen (optarg_S);
col_sep_string = xmalloc (col_sep_length + 1);
strcpy (col_sep_string, optarg_S);
@ -1867,7 +1858,7 @@ Index: src/pr.c
}
int
@@ -864,6 +924,21 @@ main (int argc, char **argv)
@@ -863,6 +923,21 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -1889,7 +1880,7 @@ Index: src/pr.c
n_files = 0;
file_names = (argc > 1
? xmalloc ((argc - 1) * sizeof (char *))
@@ -940,8 +1015,12 @@ main (int argc, char **argv)
@@ -939,8 +1014,12 @@ main (int argc, char **argv)
break;
case 'e':
if (optarg)
@ -1904,7 +1895,7 @@ Index: src/pr.c
/* Could check tab width > 0. */
untabify_input = true;
break;
@@ -954,8 +1033,12 @@ main (int argc, char **argv)
@@ -953,8 +1032,12 @@ main (int argc, char **argv)
break;
case 'i':
if (optarg)
@ -1919,7 +1910,7 @@ Index: src/pr.c
/* Could check tab width > 0. */
tabify_output = true;
break;
@@ -973,8 +1056,8 @@ main (int argc, char **argv)
@@ -972,8 +1055,8 @@ main (int argc, char **argv)
case 'n':
numbered_lines = true;
if (optarg)
@ -1930,7 +1921,7 @@ Index: src/pr.c
break;
case 'N':
skip_count = false;
@@ -998,7 +1081,7 @@ main (int argc, char **argv)
@@ -997,7 +1080,7 @@ main (int argc, char **argv)
old_s = false;
/* Reset an additional input of -s, -S dominates -s */
col_sep_string = bad_cast ("");
@ -2038,7 +2029,7 @@ Index: src/pr.c
- clump_buff = xmalloc (MAX (8, chars_per_input_tab));
+ clump_buff = xmalloc (mb_len * MAX (8, chars_per_input_tab));
}
/* Open the necessary files,
@@ -1383,7 +1506,7 @@ init_funcs (void)
@ -2500,7 +2491,7 @@ Index: src/sort.c
#include "system.h"
#include "argmatch.h"
#include "error.h"
@@ -164,14 +172,39 @@ static int decimal_point;
@@ -163,14 +171,39 @@ static int decimal_point;
/* Thousands separator; if -1, then there isn't one. */
static int thousands_sep;
@ -2541,7 +2532,7 @@ Index: src/sort.c
/* The kind of blanks for '-b' to skip in various options. */
enum blanktype { bl_start, bl_end, bl_both };
@@ -345,13 +378,11 @@ static bool reverse;
@@ -344,13 +377,11 @@ static bool reverse;
they were read if all keys compare equal. */
static bool stable;
@ -2598,7 +2589,7 @@ Index: src/sort.c
+ }
+
+ *length = (mblength < 1) ? 1 : mblength;
+ return iswblank (wc);
+ return iswblank (wc) || wc == '\n';
+}
+#endif
+
@ -3037,7 +3028,7 @@ Index: src/sort.c
{
size_t lo = 0;
size_t hi = MONTHS_PER_YEAR;
@@ -2279,15 +2644,14 @@ debug_key (struct line const *line, stru
@@ -2280,15 +2645,14 @@ debug_key (struct line const *line, stru
char saved = *lim;
*lim = '\0';
@ -3055,7 +3046,7 @@ Index: src/sort.c
else if (key->general_numeric)
ignore_value (strtold (beg, &tighter_lim));
else if (key->numeric || key->human_numeric)
@@ -2431,7 +2795,7 @@ key_warnings (struct keyfield const *gke
@@ -2432,7 +2796,7 @@ key_warnings (struct keyfield const *gke
bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key)
&& !(key->schar || key->echar);
bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */
@ -3064,7 +3055,7 @@ Index: src/sort.c
&& ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
|| (!key->skipsblanks && key->schar)
|| (!key->skipeblanks && key->echar)))
@@ -2489,11 +2853,87 @@ key_warnings (struct keyfield const *gke
@@ -2490,11 +2854,87 @@ key_warnings (struct keyfield const *gke
error (0, 0, _("option '-r' only applies to last-resort comparison"));
}
@ -3153,7 +3144,7 @@ Index: src/sort.c
{
struct keyfield *key = keylist;
@@ -2578,7 +3018,7 @@ keycompare (struct line const *a, struct
@@ -2579,7 +3019,7 @@ keycompare (struct line const *a, struct
else if (key->human_numeric)
diff = human_numcompare (ta, tb);
else if (key->month)
@ -3162,7 +3153,7 @@ Index: src/sort.c
else if (key->random)
diff = compare_random (ta, tlena, tb, tlenb);
else if (key->version)
@@ -2694,6 +3134,211 @@ keycompare (struct line const *a, struct
@@ -2695,6 +3135,211 @@ keycompare (struct line const *a, struct
return key->reverse ? -diff : diff;
}
@ -3374,7 +3365,7 @@ Index: src/sort.c
/* Compare two lines A and B, returning negative, zero, or positive
depending on whether A compares less than, equal to, or greater than B. */
@@ -2721,7 +3366,7 @@ compare (struct line const *a, struct li
@@ -2722,7 +3367,7 @@ compare (struct line const *a, struct li
diff = - NONZERO (blen);
else if (blen == 0)
diff = 1;
@ -3383,7 +3374,7 @@ Index: src/sort.c
{
/* Note xmemcoll0 is a performance enhancement as
it will not unconditionally write '\0' after the
@@ -4120,6 +4765,7 @@ set_ordering (char const *s, struct keyf
@@ -4121,6 +4766,7 @@ set_ordering (char const *s, struct keyf
break;
case 'f':
key->translate = fold_toupper;
@ -3391,7 +3382,7 @@ Index: src/sort.c
break;
case 'g':
key->general_numeric = true;
@@ -4197,7 +4843,7 @@ main (int argc, char **argv)
@@ -4199,7 +4845,7 @@ main (int argc, char **argv)
initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE);
@ -3400,7 +3391,7 @@ Index: src/sort.c
hard_LC_TIME = hard_locale (LC_TIME);
#endif
@@ -4218,6 +4864,29 @@ main (int argc, char **argv)
@@ -4220,6 +4866,29 @@ main (int argc, char **argv)
thousands_sep = -1;
}
@ -3430,7 +3421,7 @@ Index: src/sort.c
have_read_stdin = false;
inittables ();
@@ -4492,13 +5161,34 @@ main (int argc, char **argv)
@@ -4494,13 +5163,34 @@ main (int argc, char **argv)
case 't':
{
@ -3469,7 +3460,7 @@ Index: src/sort.c
else
{
/* Provoke with 'sort -txx'. Complain about
@@ -4509,9 +5199,12 @@ main (int argc, char **argv)
@@ -4511,9 +5201,12 @@ main (int argc, char **argv)
quote (optarg));
}
}
@ -3484,6 +3475,19 @@ Index: src/sort.c
}
break;
@@ -4751,12 +5444,10 @@ main (int argc, char **argv)
sort (files, nfiles, outfile, nthreads);
}
-#ifdef lint
if (files_from)
readtokens0_free (&tok);
else
free (files);
-#endif
if (have_read_stdin && fclose (stdin) == EOF)
die (_("close failed"), "-");
Index: src/unexpand.c
===================================================================
--- src/unexpand.c.orig
@ -3765,11 +3769,10 @@ Index: src/uniq.c
#include "system.h"
#include "argmatch.h"
#include "linebuffer.h"
@@ -32,7 +43,19 @@
#include "stdio--.h"
#include "xmemcoll.h"
@@ -33,6 +44,18 @@
#include "xstrtol.h"
-#include "memcasecmp.h"
#include "memcasecmp.h"
#include "quote.h"
+#include "xmemcoll.h"
+
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
@ -3782,7 +3785,6 @@ Index: src/uniq.c
+#if HAVE_MBRTOWC && defined mbstate_t
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
+#endif
+
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "uniq"
@ -3797,7 +3799,7 @@ Index: src/uniq.c
static struct option const longopts[] =
{
{"count", no_argument, NULL, 'c'},
@@ -251,7 +278,7 @@ size_opt (char const *opt, char const *m
@@ -252,7 +279,7 @@ size_opt (char const *opt, char const *m
return a pointer to the beginning of the line's field to be compared. */
static char * _GL_ATTRIBUTE_PURE
@ -3806,7 +3808,7 @@ Index: src/uniq.c
{
size_t count;
char const *lp = line->buffer;
@@ -271,6 +298,83 @@ find_field (struct linebuffer const *lin
@@ -272,6 +299,83 @@ find_field (struct linebuffer const *lin
return line->buffer + i;
}
@ -3857,7 +3859,7 @@ Index: src/uniq.c
+ {
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
+
+ if (convfail || !iswblank (wc))
+ if (convfail || !(iswblank (wc) || wc == '\n'))
+ {
+ pos += mblength;
+ break;
@ -3869,7 +3871,7 @@ Index: src/uniq.c
+ {
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
+
+ if (!convfail && iswblank (wc))
+ if (!convfail && (iswblank (wc) || wc == '\n'))
+ break;
+
+ pos += mblength;
@ -3890,7 +3892,7 @@ Index: src/uniq.c
/* Return false if two strings OLD and NEW match, true if not.
OLD and NEW point not to the beginnings of the lines
but rather to the beginnings of the fields to compare.
@@ -279,6 +383,8 @@ find_field (struct linebuffer const *lin
@@ -280,6 +384,8 @@ find_field (struct linebuffer const *lin
static bool
different (char *old, char *new, size_t oldlen, size_t newlen)
{
@ -3899,7 +3901,7 @@ Index: src/uniq.c
if (check_chars < oldlen)
oldlen = check_chars;
if (check_chars < newlen)
@@ -286,14 +392,103 @@ different (char *old, char *new, size_t
@@ -287,15 +393,104 @@ different (char *old, char *new, size_t
if (ignore_case)
{
@ -3931,8 +3933,8 @@ Index: src/uniq.c
+
+ return xmemcoll (copy_old, oldlen, copy_new, newlen);
+
+}
+
}
+#if HAVE_MBRTOWC
+static int
+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
@ -4003,12 +4005,13 @@ Index: src/uniq.c
+ free (copy[1]);
+ return rc;
+
}
+}
+#endif
+
/* Output the line in linebuffer LINE to standard output
provided that the switches say it should be output.
@@ -358,19 +553,38 @@ check_file (const char *infile, const ch
MATCH is true if the line matches the previous line.
@@ -359,19 +554,38 @@ check_file (const char *infile, const ch
char *prevfield IF_LINT ( = NULL);
size_t prevlen IF_LINT ( = 0);
bool first_group_printed = false;
@ -4047,7 +4050,7 @@ Index: src/uniq.c
new_group = (prevline->length == 0
|| different (thisfield, prevfield, thislen, prevlen));
@@ -388,6 +602,10 @@ check_file (const char *infile, const ch
@@ -389,6 +603,10 @@ check_file (const char *infile, const ch
SWAP_LINES (prevline, thisline);
prevfield = thisfield;
prevlen = thislen;
@ -4058,7 +4061,7 @@ Index: src/uniq.c
first_group_printed = true;
}
}
@@ -400,17 +618,26 @@ check_file (const char *infile, const ch
@@ -401,17 +619,26 @@ check_file (const char *infile, const ch
size_t prevlen;
uintmax_t match_count = 0;
bool first_delimiter = true;
@ -4085,7 +4088,7 @@ Index: src/uniq.c
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
{
if (ferror (stdin))
@@ -419,6 +646,14 @@ check_file (const char *infile, const ch
@@ -420,6 +647,14 @@ check_file (const char *infile, const ch
}
thisfield = find_field (thisline);
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
@ -4100,7 +4103,7 @@ Index: src/uniq.c
match = !different (thisfield, prevfield, thislen, prevlen);
match_count += match;
@@ -451,6 +686,9 @@ check_file (const char *infile, const ch
@@ -452,6 +687,9 @@ check_file (const char *infile, const ch
SWAP_LINES (prevline, thisline);
prevfield = thisfield;
prevlen = thislen;
@ -4110,7 +4113,7 @@ Index: src/uniq.c
if (!match)
match_count = 0;
}
@@ -497,6 +735,19 @@ main (int argc, char **argv)
@@ -498,6 +736,19 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -4130,6 +4133,45 @@ Index: src/uniq.c
skip_chars = 0;
skip_fields = 0;
check_chars = SIZE_MAX;
Index: tests/i18n/sort-month.sh
===================================================================
--- /dev/null
+++ tests/i18n/sort-month.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Verify sort -M multi-byte support.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ sort
+require_valgrind_
+
+# Skip this test if some deallocations are
+# avoided at process end.
+grep '^#define lint 1' $CONFIG_HEADER > /dev/null ||
+ skip_ 'Allocation checks only work reliably in "lint" mode'
+
+export LC_ALL=en_US.UTF-8
+locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
+ || skip_ "No UTF-8 locale available"
+
+# Note the use of ɑ here which expands to
+# a wider representation upon case conversion
+# which triggered an assertion in sort -M
+cat <<EOF > exp
+.
+ɑ
+EOF
+
+
+# check large mem leak with --month-sort
+# https://bugzilla.redhat.com/show_bug.cgi?id=1259942
+valgrind --leak-check=full \
+ --error-exitcode=1 --errors-for-leak-kinds=definite \
+ sort -M < exp > out || fail=1
+compare exp out || { fail=1; cat out; }
+
+
+Exit $fail
Index: tests/i18n/sort.sh
===================================================================
--- /dev/null
@ -4168,7 +4210,7 @@ Index: tests/local.mk
===================================================================
--- tests/local.mk.orig
+++ tests/local.mk
@@ -341,6 +341,9 @@ all_tests = \
@@ -344,6 +344,9 @@ all_tests = \
tests/misc/sort-discrim.sh \
tests/misc/sort-files0-from.pl \
tests/misc/sort-float.sh \
@ -4196,7 +4238,7 @@ Index: tests/misc/cut.pl
my $prog = 'cut';
my $try = "Try '$prog --help' for more information.\n";
@@ -227,6 +229,7 @@ if ($mb_locale ne 'C')
@@ -240,6 +242,7 @@ if ($mb_locale ne 'C')
my @new_t = @$t;
my $test_name = shift @new_t;
@ -4355,7 +4397,7 @@ Index: tests/misc/join.pl
my $delim = chr 0247;
sub t_subst ($)
{
@@ -326,8 +335,49 @@ foreach my $t (@tv)
@@ -329,8 +338,49 @@ foreach my $t (@tv)
push @Tests, $new_ent;
}
@ -4536,7 +4578,7 @@ Index: tests/misc/sort.pl
# Since each test is run with a file name and with redirected stdin,
# the name in the diagnostic is either the file name or "-".
# Normalize each diagnostic to use '-'.
@@ -419,6 +424,38 @@ foreach my $t (@Tests)
@@ -424,6 +429,38 @@ foreach my $t (@Tests)
}
}
@ -4575,7 +4617,7 @@ Index: tests/misc/sort.pl
@Tests = triple_test \@Tests;
# Remember that triple_test creates from each test with exactly one "IN"
@@ -428,6 +465,7 @@ foreach my $t (@Tests)
@@ -433,6 +470,7 @@ foreach my $t (@Tests)
# Remove the IN_PIPE version of the "output-is-input" test above.
# The others aren't susceptible because they have three inputs each.
@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests;
@ -4662,7 +4704,7 @@ Index: tests/misc/uniq.pl
# When possible, create a "-z"-testing variant of each test.
sub add_z_variants($)
{
@@ -261,6 +269,53 @@ foreach my $t (@Tests)
@@ -262,6 +270,53 @@ foreach my $t (@Tests)
and push @$t, {ENV=>'_POSIX2_VERSION=199209'};
}
@ -4785,42 +4827,3 @@ Index: tests/pr/pr-tests.pl
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
Index: tests/i18n/sort-month.sh
===================================================================
--- /dev/null
+++ tests/i18n/sort-month.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Verify sort -M multi-byte support.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ sort
+require_valgrind_
+
+# Skip this test if some deallocations are
+# avoided at process end.
+grep '^#define lint 1' $CONFIG_HEADER > /dev/null ||
+ skip_ 'Allocation checks only work reliably in "lint" mode'
+
+export LC_ALL=en_US.UTF-8
+locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
+ || skip_ "No UTF-8 locale available"
+
+# Note the use of ɑ here which expands to
+# a wider representation upon case conversion
+# which triggered an assertion in sort -M
+cat <<EOF > exp
+.
+ɑ
+EOF
+
+
+# check large mem leak with --month-sort
+# https://bugzilla.redhat.com/show_bug.cgi?id=1259942
+valgrind --leak-check=full \
+ --error-exitcode=1 --errors-for-leak-kinds=definite \
+ sort -M < exp > out || fail=1
+compare exp out || { fail=1; cat out; }
+
+
+Exit $fail

View File

@ -25,6 +25,6 @@ Index: src/chgrp.c
if (! (xstrtoul (name, NULL, 10, &tmp, "") == LONGINT_OK
- && tmp <= GID_T_MAX))
+ && tmp <= GID_T_MAX && (gid_t) tmp != (gid_t) -1))
error (EXIT_FAILURE, 0, _("invalid group: %s"), quote (name));
error (EXIT_FAILURE, 0, _("invalid group: %s"),
quote (name));
gid = tmp;
}

View File

@ -6,8 +6,8 @@
Index: gnulib-tests/test-isnanl.h
===================================================================
--- gnulib-tests/test-isnanl.h.orig 2015-07-09 14:59:20.897259261 +0200
+++ gnulib-tests/test-isnanl.h 2015-07-09 15:04:01.173639553 +0200
--- gnulib-tests/test-isnanl.h.orig
+++ gnulib-tests/test-isnanl.h
@@ -47,7 +47,7 @@ main ()
/* Quiet NaN. */
ASSERT (isnanl (NaNl ()));
@ -35,9 +35,9 @@ Index: gnulib-tests/test-isnanl.h
}
Index: tests/misc/help-version.sh
===================================================================
--- tests/misc/help-version.sh.orig 2015-07-09 14:59:20.897259261 +0200
+++ tests/misc/help-version.sh 2015-07-09 14:59:27.227110899 +0200
@@ -237,6 +237,7 @@ parted_setup () { args="-s $tmp_in mklab
--- tests/misc/help-version.sh.orig
+++ tests/misc/help-version.sh
@@ -238,6 +238,7 @@ parted_setup () { args="-s $tmp_in mklab
for i in $built_programs; do
# Skip these.
case $i in chroot|stty|tty|false|chcon|runcon|coreutils) continue;; esac
@ -47,8 +47,8 @@ Index: tests/misc/help-version.sh
echo z |gzip > $zin
Index: tests/other-fs-tmpdir
===================================================================
--- tests/other-fs-tmpdir.orig 2015-07-09 14:59:20.898259238 +0200
+++ tests/other-fs-tmpdir 2015-07-09 14:59:27.227110899 +0200
--- tests/other-fs-tmpdir.orig
+++ tests/other-fs-tmpdir
@@ -43,6 +43,9 @@ for d in $CANDIDATE_TMP_DIRS; do
done

View File

@ -11,14 +11,14 @@ Subject: [PATCH 1/1] copy: add OCFS2 reflink support
Signed-off-by: Jie Liu <jeff....@oracle.com>
---
src/copy.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 91 insertions(+), 8 deletions(-)
src/copy.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 81 insertions(+), 1 deletion(-)
Index: src/copy.c
===================================================================
--- src/copy.c.orig 2015-06-26 19:05:22.000000000 +0200
+++ src/copy.c 2015-07-09 14:58:48.105027875 +0200
@@ -324,6 +324,47 @@ sparse_copy (int src_fd, int dest_fd, ch
--- src/copy.c.orig
+++ src/copy.c
@@ -315,6 +315,47 @@ sparse_copy (int src_fd, int dest_fd, ch
return true;
}
@ -66,7 +66,7 @@ Index: src/copy.c
/* Perform the O(1) btrfs clone operation, if possible.
Upon success, return 0. Otherwise, return -1 and set errno. */
static inline int
@@ -1040,6 +1081,45 @@ copy_reg (char const *src_name, char con
@@ -1049,6 +1090,45 @@ copy_reg (char const *src_name, char con
goto close_src_desc;
}
@ -102,7 +102,7 @@ Index: src/copy.c
+ if (errno == EEXIST)
+ {
+ error (0, errno, _("failed to reflink %s from %s"),
+ quote_n (0, dst_name), quote_n (1, src_name));
+ quoteaf_n (0, dst_name), quoteaf_n (1, src_name));
+ return_val = false;
+ goto close_src_desc;
+ }
@ -112,32 +112,12 @@ Index: src/copy.c
/* The semantics of the following open calls are mandated
by the specs for both cp and mv. */
if (! *new_dst)
@@ -1185,17 +1265,20 @@ copy_reg (char const *src_name, char con
/* --attributes-only overrides --reflink. */
if (data_copy_required && x->reflink_mode)
{
- bool clone_ok = clone_file (dest_desc, source_desc) == 0;
- if (clone_ok || x->reflink_mode == REFLINK_ALWAYS)
+ if (! reflink_ok)
{
- if (!clone_ok)
+ bool clone_ok = clone_file (dest_desc, source_desc) == 0;
+ if (clone_ok || x->reflink_mode == REFLINK_ALWAYS)
{
- error (0, errno, _("failed to clone %s from %s"),
- quote_n (0, dst_name), quote_n (1, src_name));
- return_val = false;
- goto close_src_and_dst_desc;
+ if (!clone_ok)
+ {
+ error (0, errno, _("failed to clone %s from %s"),
+ quote_n (0, dst_name), quote_n (1, src_name));
+ return_val = false;
+ goto close_src_and_dst_desc;
+ }
+ data_copy_required = false;
}
- data_copy_required = false;
}
@@ -1192,7 +1272,7 @@ copy_reg (char const *src_name, char con
}
/* --attributes-only overrides --reflink. */
- if (data_copy_required && x->reflink_mode)
+ if (data_copy_required && x->reflink_mode && ! reflink_ok)
{
bool clone_ok = clone_file (dest_desc, source_desc) == 0;
if (clone_ok || x->reflink_mode == REFLINK_ALWAYS)

View File

@ -4,8 +4,8 @@
Index: doc/coreutils.texi
===================================================================
--- doc/coreutils.texi.orig 2015-06-26 19:05:22.000000000 +0200
+++ doc/coreutils.texi 2015-07-09 14:53:28.486520508 +0200
--- doc/coreutils.texi.orig
+++ doc/coreutils.texi
@@ -69,7 +69,6 @@
* groups: (coreutils)groups invocation. Print group names a user is in.
* head: (coreutils)head invocation. Output the first part of files.
@ -23,7 +23,7 @@ Index: doc/coreutils.texi
* SELinux context:: chcon runcon
* Modified command invocation:: chroot env nice nohup stdbuf timeout
* Process control:: kill
@@ -420,7 +419,6 @@ System context
@@ -421,7 +420,6 @@ System context
* date invocation:: Print or set system date and time
* nproc invocation:: Print the number of processors
* uname invocation:: Print system information
@ -31,7 +31,7 @@ Index: doc/coreutils.texi
* hostid invocation:: Print numeric host identifier
* uptime invocation:: Print system uptime and load
@@ -14793,7 +14791,6 @@ information.
@@ -14986,7 +14984,6 @@ information.
* arch invocation:: Print machine hardware name.
* nproc invocation:: Print the number of processors.
* uname invocation:: Print system information.
@ -39,7 +39,7 @@ Index: doc/coreutils.texi
* hostid invocation:: Print numeric host identifier.
* uptime invocation:: Print system uptime and load.
@end menu
@@ -15618,15 +15615,6 @@ easily available, as is the case with Li
@@ -15815,15 +15812,6 @@ Note this is non-portable (even across G
Print the machine hardware name (sometimes called the hardware class
or hardware type).
@ -55,7 +55,7 @@ Index: doc/coreutils.texi
@item -p
@itemx --processor
@opindex -p
@@ -15680,34 +15668,6 @@ Print the kernel version.
@@ -15877,34 +15865,6 @@ Print the kernel version.
@exitstatus

View File

@ -4,8 +4,8 @@
Index: doc/coreutils.texi
===================================================================
--- doc/coreutils.texi.orig 2015-07-09 14:53:50.295009198 +0200
+++ doc/coreutils.texi 2015-07-09 14:54:48.805637437 +0200
--- doc/coreutils.texi.orig
+++ doc/coreutils.texi
@@ -72,7 +72,6 @@
* id: (coreutils)id invocation. Print user identity.
* install: (coreutils)install invocation. Copy files and set attributes.
@ -22,7 +22,7 @@ Index: doc/coreutils.texi
* Delaying:: sleep
* Numeric operations:: factor numfmt seq
* File permissions:: Access modes
@@ -447,10 +445,6 @@ Modified command invocation
@@ -448,10 +446,6 @@ Modified command invocation
* stdbuf invocation:: Run a command with modified I/O buffering
* timeout invocation:: Run a command with a time limit
@ -33,7 +33,7 @@ Index: doc/coreutils.texi
Delaying
* sleep invocation:: Delay for a specified time
@@ -16602,90 +16596,6 @@ the exit status of @var{command} otherwi
@@ -16799,90 +16793,6 @@ the exit status of @var{command} otherwi
@end display

View File

@ -19,9 +19,9 @@ with a diagnostic like:
Index: gnulib-tests/gnulib.mk
===================================================================
--- gnulib-tests/gnulib.mk.orig 2015-06-19 13:24:05.000000000 +0200
+++ gnulib-tests/gnulib.mk 2015-07-09 15:11:24.099160681 +0200
@@ -2238,9 +2238,10 @@ EXTRA_DIST += test-time.c
--- gnulib-tests/gnulib.mk.orig
+++ gnulib-tests/gnulib.mk
@@ -2242,9 +2242,10 @@ EXTRA_DIST += test-timespec.c macros.h
## begin gnulib module tls-tests

View File

@ -4,8 +4,8 @@
Index: tests/misc/shuf-reservoir.sh
===================================================================
--- tests/misc/shuf-reservoir.sh.orig 2015-07-09 16:52:02.577880662 +0200
+++ tests/misc/shuf-reservoir.sh 2015-07-09 16:59:38.928158153 +0200
--- tests/misc/shuf-reservoir.sh.orig
+++ tests/misc/shuf-reservoir.sh
@@ -37,8 +37,7 @@ run_shuf_n()
# Critical memory-related bugs will cause a segfault here

View File

@ -1,84 +0,0 @@
Upstream patch on top of v8.24 to avoid a FP test failure with glibc>=2.22:
http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=fd5f2b1569
Patch to be removed with v8.25.
From fd5f2b1569e2e0b31be755e14e236a7a02478fc0 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Sun, 30 Aug 2015 22:49:35 +0200
Subject: [PATCH] tests: avoid FP of ls/stat-free-color.sh with newer glibc
Since glibc-2.22, specifically commit [0], the opendir() implementation
implicitly makes an additional stat call thus leading to a FP.
Seen on openSUSE:Tumbleweed since snapshot 20150821.
[0]
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a
* tests/ls/stat-free-color.sh: Change the test to verify that ls(1)
needs the same number of stat-like calls for a single, empty directory
argument as for one with a few directory entries (sub-directory,
regular file, symlink, etc.).
---
tests/ls/stat-free-color.sh | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
Index: tests/ls/stat-free-color.sh
===================================================================
--- tests/ls/stat-free-color.sh.orig
+++ tests/ls/stat-free-color.sh
@@ -27,8 +27,6 @@ stats='stat,lstat,stat64,lstat64,newfsta
require_strace_ $stats
require_dirent_d_type_
-ln -s nowhere dangle || framework_failure_
-
# Disable enough features via LS_COLORS so that ls --color
# can do its job without calling stat (other than the obligatory
# one-call-per-command-line argument).
@@ -54,22 +52,33 @@ EOF
eval $(dircolors -b color-without-stat)
# The system may perform additional stat-like calls before main.
-# To avoid counting those, first get a baseline count by running
-# ls with only the --help option. Then, compare that with the
+# Furthermore, underlying library functions may also implicitly
+# add an extra stat call, e.g. opendir since glibc-2.21-360-g46f894d.
+# To avoid counting those, first get a baseline count for running
+# ls with one empty directory argument. Then, compare that with the
# invocation under test.
-strace -o log-help -e $stats ls --help >/dev/null || fail=1
-n_lines_help=$(wc -l < log-help)
+mkdir d || framework_failure_
-strace -o log -e $stats ls --color=always . || fail=1
-n_lines=$(wc -l < log)
+strace -o log1 -e $stats ls --color=always d || fail=1
+n_stat1=$(wc -l < log1) || framework_failure_
-n_stat=$(expr $n_lines - $n_lines_help)
+test $n_stat1 = 0 \
+ && skip_ 'No stat calls recognized on this platform'
-# Expect one stat call.
-case $n_stat in
- 0) skip_ 'No stat calls recognized on this platform' ;;
- 1) ;; # Corresponding to stat(".")
- *) fail=1; head -n30 log* ;;
-esac
+# Populate the test directory.
+mkdir d/subdir \
+ && touch d/regf \
+ && ln d/regf d/hlink \
+ && ln -s regf d/slink \
+ && ln -s nowhere d/dangle \
+ || framework_failure_
+
+# Invocation under test.
+strace -o log2 -e $stats ls --color=always d || fail=1
+n_stat2=$(wc -l < log2) || framework_failure_
+
+# Expect the same number of stat calls.
+test $n_stat1 = $n_stat2 \
+ || { fail=1; head -n30 log*; }
Exit $fail

View File

@ -16,7 +16,7 @@ Index: tests/local.mk
===================================================================
--- tests/local.mk.orig
+++ tests/local.mk
@@ -679,14 +679,9 @@ all_tests = \
@@ -680,14 +680,9 @@ all_tests = \
# See tests/factor/create-test.sh.
tf = tests/factor
factor_tests = \

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Jan 29 22:08:45 UTC 2016 - mail@bernhard-voelker.de
- Update to 8.25
(for details see included NEWS file)
- coreutils.spec (%description): Add base32, a new utility.
- Remove now-upstream patch:
* coreutils-tests-avoid-FP-of-ls-stat-free-color.patch
- Refresh/merge all other patches:
* coreutils-build-timeout-as-pie.patch
* coreutils-disable_tests.patch
* coreutils-i18n.patch
* coreutils-invalid-ids.patch
* coreutils-misc.patch
* coreutils-ocfs2_reflinks.patch
* coreutils-remove_hostname_documentation.patch
* coreutils-remove_kill_documentation.patch
* coreutils-skip-gnulib-test-tls.patch
* coreutils-test_without_valgrind.patch
* coreutils-tests-shorten-extreme-factor-tests.patch
-------------------------------------------------------------------
Sun Sep 20 15:22:45 UTC 2015 - mail@bernhard-voelker.de

View File

@ -1,7 +1,7 @@
#
# spec file for package coreutils-testsuite
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,7 +21,7 @@ Summary: GNU Core Utilities
License: GPL-3.0+
Group: System/Base
Url: http://www.gnu.org/software/coreutils/
Version: 8.24
Version: 8.25
Release: 0
#################################################################
@ -128,15 +128,13 @@ Patch303: coreutils-tests-shorten-extreme-factor-tests.patch
Patch500: coreutils-disable_tests.patch
Patch501: coreutils-test_without_valgrind.patch
Patch600: coreutils-tests-avoid-FP-of-ls-stat-free-color.patch
# ================================================
%description
These are the GNU core utilities. This package is the union of
the GNU fileutils, sh-utils, and textutils packages.
[ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
csplit cut date dd df dir dircolors dirname du echo env expand expr
[ arch base32 base64 basename cat chcon chgrp chmod chown chroot cksum comm
cp csplit cut date dd df dir dircolors dirname du echo env expand expr
factor false fmt fold groups head hostid id install join
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink
@ -172,9 +170,6 @@ the GNU fileutils, sh-utils, and textutils packages.
%patch500
%patch501
# Upstream patch on top of v8.24 to fix a FP test failure with glibc>=2.22.
%patch600
#???## We need to statically link to gmp, otherwise we have a build loop
#???#sed -i s,'$(LIB_GMP)',%%{_libdir}/libgmp.a,g Makefile.in

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Jan 29 22:08:45 UTC 2016 - mail@bernhard-voelker.de
- Update to 8.25
(for details see included NEWS file)
- coreutils.spec (%description): Add base32, a new utility.
- Remove now-upstream patch:
* coreutils-tests-avoid-FP-of-ls-stat-free-color.patch
- Refresh/merge all other patches:
* coreutils-build-timeout-as-pie.patch
* coreutils-disable_tests.patch
* coreutils-i18n.patch
* coreutils-invalid-ids.patch
* coreutils-misc.patch
* coreutils-ocfs2_reflinks.patch
* coreutils-remove_hostname_documentation.patch
* coreutils-remove_kill_documentation.patch
* coreutils-skip-gnulib-test-tls.patch
* coreutils-test_without_valgrind.patch
* coreutils-tests-shorten-extreme-factor-tests.patch
-------------------------------------------------------------------
Sun Sep 20 15:22:45 UTC 2015 - mail@bernhard-voelker.de

Binary file not shown.

View File

@ -1,7 +1,7 @@
#
# spec file for package coreutils
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,7 +21,7 @@ Summary: GNU Core Utilities
License: GPL-3.0+
Group: System/Base
Url: http://www.gnu.org/software/coreutils/
Version: 8.24
Version: 8.25
Release: 0
#################################################################
@ -128,15 +128,13 @@ Patch303: coreutils-tests-shorten-extreme-factor-tests.patch
Patch500: coreutils-disable_tests.patch
Patch501: coreutils-test_without_valgrind.patch
Patch600: coreutils-tests-avoid-FP-of-ls-stat-free-color.patch
# ================================================
%description
These are the GNU core utilities. This package is the union of
the GNU fileutils, sh-utils, and textutils packages.
[ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
csplit cut date dd df dir dircolors dirname du echo env expand expr
[ arch base32 base64 basename cat chcon chgrp chmod chown chroot cksum comm
cp csplit cut date dd df dir dircolors dirname du echo env expand expr
factor false fmt fold groups head hostid id install join
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink
@ -172,9 +170,6 @@ the GNU fileutils, sh-utils, and textutils packages.
%patch500
%patch501
# Upstream patch on top of v8.24 to fix a FP test failure with glibc>=2.22.
%patch600
#???## We need to statically link to gmp, otherwise we have a build loop
#???#sed -i s,'$(LIB_GMP)',%%{_libdir}/libgmp.a,g Makefile.in