From ad4156ceaed958ef552ae497b50f2ae9a3d75222a4ed2026867ebb0be0f86fdd Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 25 Apr 2022 22:03:20 +0000 Subject: [PATCH] disabled in rings? Somebody is kidding me; REVERT OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/coreutils?expand=0&rev=144 --- coreutils-9.0.tar.xz | 3 + coreutils-9.0.tar.xz.sig | 16 + coreutils-9.1.tar.xz | 3 - coreutils-9.1.tar.xz.sig | 16 - ...s-chmod-fix-exit-status-ign-symlinks.patch | 119 +++ coreutils-disable_tests.patch | 2 +- coreutils-i18n.patch | 754 +++++++----------- coreutils-skip-gnulib-test-tls.patch | 2 +- coreutils-sysinfo.patch | 6 +- ...s-tests-shorten-extreme-factor-tests.patch | 2 +- coreutils.changes | 77 -- coreutils.spec | 29 +- gnulib-simple-backup-fix.patch | 93 --- 13 files changed, 456 insertions(+), 666 deletions(-) create mode 100644 coreutils-9.0.tar.xz create mode 100644 coreutils-9.0.tar.xz.sig delete mode 100644 coreutils-9.1.tar.xz delete mode 100644 coreutils-9.1.tar.xz.sig create mode 100644 coreutils-chmod-fix-exit-status-ign-symlinks.patch delete mode 100644 gnulib-simple-backup-fix.patch diff --git a/coreutils-9.0.tar.xz b/coreutils-9.0.tar.xz new file mode 100644 index 0000000..e65a07f --- /dev/null +++ b/coreutils-9.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce30acdf4a41bc5bb30dd955e9eaa75fa216b4e3deb08889ed32433c7b3b97ce +size 5612752 diff --git a/coreutils-9.0.tar.xz.sig b/coreutils-9.0.tar.xz.sig new file mode 100644 index 0000000..8fe032e --- /dev/null +++ b/coreutils-9.0.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEbDfcEhIaUAa8HbgE32/ZcTBgN9kFAmFN1c4ACgkQ32/ZcTBg +N9mtfw/8D8BJrt2Ver2xdPfow5FYHT/zakUQ2b3ZIHP0Es62W56+pWtGombphrZu +4PkI1x6i4S8z06O9rWPIDGMPjyPV9UJbzAiGC7Px6tW6RFHZx0M+GNsKfcjmhtf7 +0v3jFF0g1IdrikFG1aYCAHZHy7n+yOm7xsfSmlYVlKcOVbCFN92ZBw0IohOSriSq +nJN6IOY8I3frhuI5kchY4wM6RMQ+ztNtG8odNvJI3kWCCL9pQFxzD8uorrvTiAcp +Qdbfz5TDnlVcXKR1gu6AAP+XThUYuxG5t/2Kghlril1zxnbDBZJsGteevyHsS7kY +grAWY4XqSvKVURGaKSSUhXlriQilPknBaichwEhAXvrUk1giviAzZ8CXB6WzzTvn +E9+ofC8RqTu345+ixkdZZu0TauOZWYIUVzKsD7W0ooQOT7OZeIQfb3+pbves/I+k +ZyiRLxfiUkAkKMUDrMr+okhqFA9fo/GCkFmHWj9m2NAc15kifEpSiCktfgoChbeG +ZiQFXQz090P+L1pk82qBXVgTjUyS5VEnXZoIkTWGzkHKySwreiaIjPQhS3cU2xAm +24i53zidj84Ib62Xa4jwxX7BzZqYRdbWAa/BUUNMov75W4dfkPlZ6qbRXtKnoOZf +u0ok3fgFvopGzwbw3l/HFp58jpaYL5S28gy10PpdOnxeO54XBn0= +=3TCC +-----END PGP SIGNATURE----- diff --git a/coreutils-9.1.tar.xz b/coreutils-9.1.tar.xz deleted file mode 100644 index 734640d..0000000 --- a/coreutils-9.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423 -size 5712104 diff --git a/coreutils-9.1.tar.xz.sig b/coreutils-9.1.tar.xz.sig deleted file mode 100644 index 3ce7c5d..0000000 --- a/coreutils-9.1.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEbDfcEhIaUAa8HbgE32/ZcTBgN9kFAmJZ7qQACgkQ32/ZcTBg -N9mseQ/9HIe1s2ZCGOonUKI7HPp/x/qZXrq2R2/BL8+m9dMPfoIXa42DKu/LMpCK -amMuDIgfDbVp2Zky1cQ80d/lvYmkZXAIwUl0POrQiQkZ8fBsmZjQPKs4hTE4RmkX -7Y4n+KbOYPVkT+ROSq8O2fOL4++1kPoLFC6rkgylAR1t4836WzcNM33QCloyQlFU -CYQe57uSPfabDhswIQFraEPhIH0ZRQLAmcT2xuvlrbD8Uy9uakFrM8CFBVA9TpNu -KC7dShDErrTxfxlNfWLMD8vJu140if3hgGD45tNEM2VFSOhvQ07uoexwhLVSa+fw -cl114IAwAeBtz6ssE80vku8+pWmsAgfeqncn8DtEZ87Fa56N8u2QKuMZ/FjrxYwS -X9gHANJg5dzvVUB8ICvopGIs5iWXY5GhwaCuutSy/tsLp32Ytzv0FMtiKI1a6Msf -p8ojsFGnzQ2e4QRUBPKB2yxAZIlUvArFpsnebEPC47UBWbh4q/q6GA8omdLTF7N+ -xQsaCyUCcRov3S8lD/4p/r0NfYnL2Tnjq39v6dH8gAQpDB/xDCnP3jG6mufKp7tu -mf0Q/Jws+4FKs7yVyq6DCOtFiJnx410fMhsHpDnzEegldWD1K9TIjDEW4E3yotwt -I8mGBRbgYc19TEUmTIr40MLc0vE3up7pY5/TY1kRdsYFlOPLbiA= -=Npyd ------END PGP SIGNATURE----- diff --git a/coreutils-chmod-fix-exit-status-ign-symlinks.patch b/coreutils-chmod-fix-exit-status-ign-symlinks.patch new file mode 100644 index 0000000..0f458cd --- /dev/null +++ b/coreutils-chmod-fix-exit-status-ign-symlinks.patch @@ -0,0 +1,119 @@ +Upstream patch - remove with version >9.0: +chmod: fix exit status when ignoring symlinks + +As a deviation from the upstream patch, the entry in the NEWS files uses a +different section header. + +------------------------------------------------------------------- +Upstream patch: + https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=e8b56ebd5 + +From e8b56ebd536e82b15542a00c888109471936bfda Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?P=C3=A1draig=20Brady?= +Date: Fri, 24 Sep 2021 20:57:41 +0100 +Subject: [PATCH] chmod: fix exit status when ignoring symlinks + +* src/chmod.c: Reorder enum so CH_NOT_APPLIED +can be treated as a non error. +* tests/chmod/ignore-symlink.sh: A new test. +* tests/local.mk: Reference the new test. +* NEWS: Mention the bug fix. +Fixes https://bugs.gnu.org/50784 + +--- + NEWS | 9 +++++++++ + src/chmod.c | 4 ++-- + tests/chmod/ignore-symlink.sh | 31 +++++++++++++++++++++++++++++++ + tests/local.mk | 1 + + 4 files changed, 43 insertions(+), 2 deletions(-) + +Index: NEWS +=================================================================== +--- NEWS.orig ++++ NEWS +@@ -1,5 +1,14 @@ + GNU coreutils NEWS -*- outline -*- + ++* Noteworthy downstream changes on top of release 9.0 ++ ++** Bug fixes ++ ++ chmod -R no longer exits with error status when encountering symlinks. ++ All files would be processed correctly, but the exit status was incorrect. ++ [bug introduced in coreutils-9.0] ++ ++ + * Noteworthy changes in release 9.0 (2021-09-24) [stable] + + ** Bug fixes +Index: src/chmod.c +=================================================================== +--- src/chmod.c.orig ++++ src/chmod.c +@@ -44,8 +44,8 @@ struct change_status + enum + { + CH_NO_STAT, +- CH_NOT_APPLIED, + CH_FAILED, ++ CH_NOT_APPLIED, + CH_NO_CHANGE_REQUESTED, + CH_SUCCEEDED + } +@@ -322,7 +322,7 @@ process_file (FTS *fts, FTSENT *ent) + if ( ! recurse) + fts_set (fts, ent, FTS_SKIP); + +- return CH_NO_CHANGE_REQUESTED <= ch.status; ++ return CH_NOT_APPLIED <= ch.status; + } + + /* Recursively change the modes of the specified FILES (the last entry +Index: tests/chmod/ignore-symlink.sh +=================================================================== +--- /dev/null ++++ tests/chmod/ignore-symlink.sh +@@ -0,0 +1,31 @@ ++#!/bin/sh ++# Test for proper exit code of chmod on a processed symlink. ++ ++# Copyright (C) 2021 Free Software Foundation, Inc. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# 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, see . ++ ++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src ++print_ver_ chmod ++ ++mkdir dir || framework_failure_ ++touch dir/f || framework_failure_ ++ln -s f dir/l || framework_failure_ ++ ++# This operation ignores symlinks but should succeed. ++chmod u+w -R dir 2> out || fail=1 ++ ++compare /dev/null out || fail=1 ++ ++Exit $fail +Index: tests/local.mk +=================================================================== +--- tests/local.mk.orig ++++ tests/local.mk +@@ -458,6 +458,7 @@ all_tests = \ + tests/chmod/c-option.sh \ + tests/chmod/equal-x.sh \ + tests/chmod/equals.sh \ ++ tests/chmod/ignore-symlink.sh \ + tests/chmod/inaccessible.sh \ + tests/chmod/octal.sh \ + tests/chmod/setgid.sh \ diff --git a/coreutils-disable_tests.patch b/coreutils-disable_tests.patch index a087dc1..111ae6a 100644 --- a/coreutils-disable_tests.patch +++ b/coreutils-disable_tests.patch @@ -6,7 +6,7 @@ Index: gnulib-tests/gnulib.mk =================================================================== --- gnulib-tests/gnulib.mk.orig +++ gnulib-tests/gnulib.mk -@@ -1073,10 +1073,10 @@ EXTRA_DIST += test-getloadavg.c signatur +@@ -1035,10 +1035,10 @@ EXTRA_DIST += test-getloadavg.c signatur ## begin gnulib module getlogin-tests diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index 059f254..6e54250 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -1,48 +1,48 @@ - bootstrap.conf | 1 + - configure.ac | 2 + - lib/linebuffer.h | 8 + - lib/mbfile.c | 3 + - lib/mbfile.h | 255 ++++++++++++ - m4/mbfile.m4 | 14 + - src/cut.c | 508 +++++++++++++++++++++-- - src/expand-common.c | 114 ++++++ - src/expand-common.h | 12 + - src/expand.c | 90 +++- - src/fold.c | 312 ++++++++++++-- - src/join.c | 359 ++++++++++++++-- - src/local.mk | 4 +- - src/pr.c | 443 ++++++++++++++++++-- - src/sort.c | 792 +++++++++++++++++++++++++++++++++--- - src/unexpand.c | 101 ++++- - src/uniq.c | 119 +++++- - tests/Coreutils.pm | 3 + - tests/expand/mb.sh | 183 +++++++++ - tests/i18n/sort.sh | 29 ++ - tests/local.mk | 4 + - tests/misc/expand.pl | 42 ++ - tests/misc/fold.pl | 50 ++- - tests/misc/join.pl | 50 +++ - tests/misc/sort-mb-tests.sh | 45 ++ - tests/misc/sort-merge.pl | 42 ++ - tests/misc/sort.pl | 40 +- - tests/misc/unexpand.pl | 39 ++ - tests/misc/uniq.pl | 55 +++ - tests/pr/pr-tests.pl | 49 +++ - tests/unexpand/mb.sh | 172 ++++++++ - 31 files changed, 3698 insertions(+), 242 deletions(-) + bootstrap.conf | 1 + configure.ac | 2 + lib/linebuffer.h | 8 + lib/mbfile.c | 3 + lib/mbfile.h | 255 ++++++++++++++ + m4/mbfile.m4 | 14 + src/cut.c | 441 ++++++++++++++++++++++++- + src/expand-common.c | 114 ++++++ + src/expand-common.h | 12 + src/expand.c | 90 ++++- + src/fold.c | 312 ++++++++++++++++- + src/join.c | 359 +++++++++++++++++--- + src/local.mk | 4 + src/pr.c | 443 ++++++++++++++++++++++--- + src/sort.c | 772 +++++++++++++++++++++++++++++++++++++++++--- + src/unexpand.c | 101 ++++- + src/uniq.c | 119 ++++++ + tests/Coreutils.pm | 3 + tests/expand/mb.sh | 183 ++++++++++ + tests/i18n/sort.sh | 29 + + tests/local.mk | 4 + tests/misc/expand.pl | 42 ++ + tests/misc/fold.pl | 50 ++ + tests/misc/join.pl | 50 ++ + tests/misc/sort-mb-tests.sh | 45 ++ + tests/misc/sort-merge.pl | 42 ++ + tests/misc/sort.pl | 40 ++ + tests/misc/unexpand.pl | 39 ++ + tests/misc/uniq.pl | 55 +++ + tests/pr/pr-tests.pl | 49 ++ + tests/unexpand/mb.sh | 172 +++++++++ + 31 files changed, 3640 insertions(+), 213 deletions(-) create mode 100644 lib/mbfile.c create mode 100644 lib/mbfile.h create mode 100644 m4/mbfile.m4 - create mode 100755 tests/expand/mb.sh - create mode 100755 tests/i18n/sort.sh - create mode 100755 tests/misc/sort-mb-tests.sh - create mode 100755 tests/unexpand/mb.sh + create mode 100644 tests/expand/mb.sh + create mode 100644 tests/i18n/sort.sh + create mode 100644 tests/misc/sort-mb-tests.sh + create mode 100644 tests/unexpand/mb.sh -diff --git a/bootstrap.conf b/bootstrap.conf -index c1399e3..60b39cf 100644 ---- a/bootstrap.conf -+++ b/bootstrap.conf -@@ -162,6 +162,7 @@ gnulib_modules=" +Index: bootstrap.conf +=================================================================== +--- bootstrap.conf.orig ++++ bootstrap.conf +@@ -156,6 +156,7 @@ gnulib_modules=" maintainer-makefile malloc-gnu manywarnings @@ -50,11 +50,11 @@ index c1399e3..60b39cf 100644 mbrlen mbrtowc mbsalign -diff --git a/configure.ac b/configure.ac -index 7e4afc9..4656a35 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -476,6 +476,8 @@ fi +Index: configure.ac +=================================================================== +--- configure.ac.orig ++++ configure.ac +@@ -457,6 +457,8 @@ fi # I'm leaving it here for now. This whole thing needs to be modernized... gl_WINSIZE_IN_PTEM @@ -63,10 +63,10 @@ index 7e4afc9..4656a35 100644 gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ -diff --git a/lib/linebuffer.h b/lib/linebuffer.h -index 07d45ca..af62e6c 100644 ---- a/lib/linebuffer.h -+++ b/lib/linebuffer.h +Index: lib/linebuffer.h +=================================================================== +--- lib/linebuffer.h.orig ++++ lib/linebuffer.h @@ -22,6 +22,11 @@ # include "idx.h" # include @@ -89,20 +89,18 @@ index 07d45ca..af62e6c 100644 }; /* Initialize linebuffer LINEBUFFER for use. */ -diff --git a/lib/mbfile.c b/lib/mbfile.c -new file mode 100644 -index 0000000..b0a468e +Index: lib/mbfile.c +=================================================================== --- /dev/null -+++ b/lib/mbfile.c ++++ lib/mbfile.c @@ -0,0 +1,3 @@ +#include +#define MBFILE_INLINE _GL_EXTERN_INLINE +#include "mbfile.h" -diff --git a/lib/mbfile.h b/lib/mbfile.h -new file mode 100644 -index 0000000..11f1b12 +Index: lib/mbfile.h +=================================================================== --- /dev/null -+++ b/lib/mbfile.h ++++ lib/mbfile.h @@ -0,0 +1,255 @@ +/* Multibyte character I/O: macros for multi-byte encodings. + Copyright (C) 2001, 2005, 2009-2015 Free Software Foundation, Inc. @@ -359,11 +357,10 @@ index 0000000..11f1b12 +_GL_INLINE_HEADER_BEGIN + +#endif /* _MBFILE_H */ -diff --git a/m4/mbfile.m4 b/m4/mbfile.m4 -new file mode 100644 -index 0000000..8589902 +Index: m4/mbfile.m4 +=================================================================== --- /dev/null -+++ b/m4/mbfile.m4 ++++ m4/mbfile.m4 @@ -0,0 +1,14 @@ +# mbfile.m4 serial 7 +dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. @@ -379,10 +376,10 @@ index 0000000..8589902 + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + : +]) -diff --git a/src/cut.c b/src/cut.c -index 6fd8978..faef877 100644 ---- a/src/cut.c -+++ b/src/cut.c +Index: src/cut.c +=================================================================== +--- src/cut.c.orig ++++ src/cut.c @@ -28,6 +28,11 @@ #include #include @@ -477,26 +474,23 @@ index 6fd8978..faef877 100644 /* 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 -@@ -72,6 +138,29 @@ static char *field_1_buffer; - /* The number of bytes allocated for FIELD_1_BUFFER. */ - static size_t field_1_bufsize; +@@ -76,15 +142,25 @@ enum operating_mode + { + undefined_mode, -+enum operating_mode -+ { -+ undefined_mode, -+ +- /* Output characters that are in the given bytes. */ + /* Output bytes that are at the given positions. */ -+ byte_mode, -+ + byte_mode, + + /* Output characters that are at the given positions. */ + character_mode, + -+ /* Output the given delimiter-separated fields. */ -+ field_mode -+ }; -+ -+static enum operating_mode operating_mode; -+ + /* Output the given delimiter-separated fields. */ + field_mode + }; + + static enum operating_mode operating_mode; + +/* If nonzero, when in byte mode, don't split multibyte characters. */ +static int byte_mode_character_aware; + @@ -507,7 +501,7 @@ index 6fd8978..faef877 100644 /* If true do not output lines containing no delimiter characters. Otherwise, all such lines are printed. This option is valid only with field mode. */ -@@ -83,10 +172,16 @@ static bool complement; +@@ -96,6 +172,9 @@ static bool complement; /* The delimiter character for field mode. */ static unsigned char delim; @@ -517,24 +511,7 @@ index 6fd8978..faef877 100644 /* The delimiter for each line/record. */ static unsigned char line_delim = '\n'; - -+/* True if the --output-delimiter=STRING option was specified. */ -+static bool output_delimiter_specified; -+ - /* The length of output_delimiter_string. */ - static size_t output_delimiter_length; - -@@ -94,9 +189,6 @@ static size_t output_delimiter_length; - string consisting of the input delimiter. */ - static char *output_delimiter_string; - --/* The output delimiter string contents, if the default. */ --static char output_delimiter_default[1]; -- - /* True if we have ever read standard input. */ - static bool have_read_stdin; - -@@ -150,7 +242,7 @@ Print selected parts of lines from each FILE to standard output.\n\ +@@ -163,7 +242,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\ @@ -543,16 +520,7 @@ index 6fd8978..faef877 100644 "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ -@@ -250,7 +342,7 @@ cut_bytes (FILE *stream) - next_item (&byte_idx); - if (print_kth (byte_idx)) - { -- if (output_delimiter_string != output_delimiter_default) -+ if (output_delimiter_specified) - { - if (print_delimiter && is_range_start_index (byte_idx)) - { -@@ -266,6 +358,82 @@ cut_bytes (FILE *stream) +@@ -279,6 +358,82 @@ cut_bytes (FILE *stream) } } @@ -635,11 +603,10 @@ index 6fd8978..faef877 100644 /* Read from stream STREAM, printing to standard output any selected fields. */ static void -@@ -411,11 +579,218 @@ cut_fields (FILE *stream) +@@ -424,13 +579,211 @@ cut_fields (FILE *stream) } } --/* Process file FILE to standard output, using CUT_STREAM. +#if HAVE_MBRTOWC +static void +cut_fields_mb (FILE *stream) @@ -797,9 +764,11 @@ index 6fd8978..faef877 100644 +} +#endif + -+static void -+cut_stream (FILE *stream) -+{ + static void + cut_stream (FILE *stream) + { +- if (operating_mode == byte_mode) +- cut_bytes (stream); +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1 && !force_singlebyte_mode) + { @@ -837,7 +806,8 @@ index 6fd8978..faef877 100644 + abort (); + } + } -+ else + else +- cut_fields (stream); +#endif + { + if (operating_mode == field_mode) @@ -845,51 +815,29 @@ index 6fd8978..faef877 100644 + else + cut_bytes (stream); + } -+} -+ -+/* Process file FILE to standard output. - Return true if successful. */ + } - static bool --cut_file (char const *file, void (*cut_stream) (FILE *)) -+cut_file (char const *file) - { - FILE *stream; - -@@ -459,8 +834,8 @@ main (int argc, char **argv) - int optc; + /* Process file FILE to standard output. +@@ -482,6 +835,7 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; -- bool byte_mode = false; -- char *spec_list_string = NULL; -+ char *spec_list_string IF_LINT ( = NULL); + char *spec_list_string IF_LINT ( = NULL); + char mbdelim[MB_LEN_MAX + 1]; initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -470,6 +845,8 @@ main (int argc, char **argv) - - atexit (close_stdout); - -+ operating_mode = undefined_mode; -+ - /* By default, all non-delimited lines are printed. */ - suppress_non_delimited = false; - -@@ -481,35 +858,77 @@ main (int argc, char **argv) +@@ -504,7 +858,6 @@ main (int argc, char **argv) switch (optc) { case 'b': - case 'c': /* Build the byte list. */ -- byte_mode = true; -- FALLTHROUGH; -+ if (operating_mode != undefined_mode) -+ FATAL_ERROR (_("only one type of list may be specified")); -+ operating_mode = byte_mode; -+ spec_list_string = optarg; -+ break; -+ + if (operating_mode != undefined_mode) + FATAL_ERROR (_("only one type of list may be specified")); +@@ -512,6 +865,14 @@ main (int argc, char **argv) + spec_list_string = optarg; + break; + + case 'c': + /* Build the character list. */ + if (operating_mode != undefined_mode) @@ -900,14 +848,8 @@ index 6fd8978..faef877 100644 + case 'f': /* Build the field list. */ -- if (spec_list_string) -- FATAL_ERROR (_("only one list may be specified")); -+ if (operating_mode != undefined_mode) -+ FATAL_ERROR (_("only one type of list may be specified")); -+ operating_mode = field_mode; - spec_list_string = optarg; - break; - + if (operating_mode != undefined_mode) +@@ -523,10 +884,38 @@ main (int argc, char **argv) case 'd': /* New delimiter. */ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */ @@ -950,13 +892,7 @@ index 6fd8978..faef877 100644 break; case OUTPUT_DELIMITER_OPTION: -+ output_delimiter_specified = true; - /* Interpret --output-delimiter='' to mean - 'use the NUL byte as the delimiter.' */ - output_delimiter_length = (optarg[0] == '\0' - ? 1 : strlen (optarg)); -- output_delimiter_string = optarg; -+ output_delimiter_string = xstrdup (optarg); +@@ -539,6 +928,7 @@ main (int argc, char **argv) break; case 'n': @@ -964,34 +900,8 @@ index 6fd8978..faef877 100644 break; case 's': -@@ -533,40 +952,57 @@ main (int argc, char **argv) - } - } - -- if (!spec_list_string) -+ if (operating_mode == undefined_mode) - FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); - -- if (byte_mode) -- { -- if (delim_specified) -- FATAL_ERROR (_("an input delimiter may be specified only\ -+ if (delim_specified && operating_mode != field_mode) -+ FATAL_ERROR (_("an input delimiter may be specified only\ - when operating on fields")); - -- if (suppress_non_delimited) -- FATAL_ERROR (_("suppressing non-delimited lines makes sense\n\ -+ if (suppress_non_delimited && operating_mode != field_mode) -+ FATAL_ERROR (_("suppressing non-delimited lines makes sense\n\ - \tonly when operating on fields")); -- } - - set_fields (spec_list_string, -- ((byte_mode ? SETFLD_ERRMSG_USE_POS : 0) -- | (complement ? SETFLD_COMPLEMENT : 0))); -+ ( (operating_mode == field_mode) ? 0 : SETFLD_ERRMSG_USE_POS) -+ | (complement ? SETFLD_COMPLEMENT : 0) ); +@@ -578,15 +968,34 @@ main (int argc, char **argv) + | (complement ? SETFLD_COMPLEMENT : 0) ); if (!delim_specified) - delim = '\t'; @@ -1007,8 +917,10 @@ index 6fd8978..faef877 100644 if (output_delimiter_string == NULL) { -- output_delimiter_default[0] = delim; -- output_delimiter_string = output_delimiter_default; +- static char dummy[2]; +- dummy[0] = delim; +- dummy[1] = '\0'; +- output_delimiter_string = dummy; - output_delimiter_length = 1; +#ifdef HAVE_MBRTOWC + if (MB_CUR_MAX > 1 && !force_singlebyte_mode) @@ -1028,21 +940,11 @@ index 6fd8978..faef877 100644 + } } -- void (*cut_stream) (FILE *) = byte_mode ? cut_bytes : cut_fields; if (optind == argc) -- ok = cut_file ("-", cut_stream); -+ ok = cut_file ("-"); - else - for (ok = true; optind < argc; optind++) -- ok &= cut_file (argv[optind], cut_stream); -+ ok &= cut_file (argv[optind]); - - - if (have_read_stdin && fclose (stdin) == EOF) -diff --git a/src/expand-common.c b/src/expand-common.c -index deec1bd..b39f740 100644 ---- a/src/expand-common.c -+++ b/src/expand-common.c +Index: src/expand-common.c +=================================================================== +--- src/expand-common.c.orig ++++ src/expand-common.c @@ -19,6 +19,7 @@ #include #include @@ -1171,10 +1073,10 @@ index deec1bd..b39f740 100644 /* Add the comma or blank separated list of tab stops STOPS to the list of tab stops. */ extern void -diff --git a/src/expand-common.h b/src/expand-common.h -index 5f59a0e..835b9d5 100644 ---- a/src/expand-common.h -+++ b/src/expand-common.h +Index: src/expand-common.h +=================================================================== +--- src/expand-common.h.orig ++++ src/expand-common.h @@ -25,6 +25,18 @@ extern size_t max_column_width; /* The desired exit status. */ extern int exit_status; @@ -1194,10 +1096,10 @@ index 5f59a0e..835b9d5 100644 /* Add tab stop TABVAL to the end of 'tab_list'. */ extern void add_tab_stop (uintmax_t tabval); -diff --git a/src/expand.c b/src/expand.c -index ed78ca8..a4cefa1 100644 ---- a/src/expand.c -+++ b/src/expand.c +Index: src/expand.c +=================================================================== +--- src/expand.c.orig ++++ src/expand.c @@ -37,6 +37,9 @@ #include #include @@ -1239,12 +1141,12 @@ index ed78ca8..a4cefa1 100644 + } + } + -+ + + if (found_bom == true) + { + print_bom(); + } - ++ + while (true) + { /* If true, perform translations. */ @@ -1350,10 +1252,10 @@ index ed78ca8..a4cefa1 100644 } } -diff --git a/src/fold.c b/src/fold.c -index f07a90b..d32dbfd 100644 ---- a/src/fold.c -+++ b/src/fold.c +Index: src/fold.c +=================================================================== +--- src/fold.c.orig ++++ src/fold.c @@ -22,12 +22,34 @@ #include #include @@ -1435,7 +1337,7 @@ index f07a90b..d32dbfd 100644 {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -76,6 +119,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ +@@ -76,6 +119,7 @@ Wrap input lines in each FILE, writing t fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -1443,7 +1345,7 @@ index f07a90b..d32dbfd 100644 -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -93,7 +137,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ +@@ -93,7 +137,7 @@ Wrap input lines in each FILE, writing t static size_t adjust_column (size_t column, char c) { @@ -1485,7 +1387,7 @@ index f07a90b..d32dbfd 100644 fadvise (istream, FADVISE_SEQUENTIAL); -@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t width) +@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t bool found_blank = false; size_t logical_end = offset_out; @@ -1501,7 +1403,7 @@ index f07a90b..d32dbfd 100644 /* Look for the last blank. */ while (logical_end) { -@@ -215,13 +252,225 @@ fold_file (char const *filename, size_t width) +@@ -215,13 +252,225 @@ fold_file (char const *filename, size_t line_out[offset_out++] = c; } @@ -1756,10 +1658,10 @@ index f07a90b..d32dbfd 100644 break; case 's': /* Break at word boundaries. */ -diff --git a/src/join.c b/src/join.c -index f2fd172..6c7d1ed 100644 ---- a/src/join.c -+++ b/src/join.c +Index: src/join.c +=================================================================== +--- src/join.c.orig ++++ src/join.c @@ -22,19 +22,33 @@ #include #include @@ -1812,7 +1714,7 @@ index f2fd172..6c7d1ed 100644 /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -280,13 +296,14 @@ xfields (struct line *line) +@@ -276,13 +292,14 @@ xfields (struct line *line) if (ptr == lim) return; @@ -1830,7 +1732,7 @@ index f2fd172..6c7d1ed 100644 { /* Skip leading blanks before the first field. */ while (field_sep (*ptr)) -@@ -310,6 +327,147 @@ xfields (struct line *line) +@@ -306,6 +323,147 @@ xfields (struct line *line) extract_field (line, ptr, lim - ptr); } @@ -1978,7 +1880,7 @@ index f2fd172..6c7d1ed 100644 static void freeline (struct line *line) { -@@ -331,56 +489,133 @@ keycmp (struct line const *line1, struct line const *line2, +@@ -327,56 +485,133 @@ keycmp (struct line const *line1, struct size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -2135,7 +2037,7 @@ index f2fd172..6c7d1ed 100644 } /* Check that successive input lines PREV and CURRENT from input file -@@ -472,6 +707,11 @@ get_line (FILE *fp, struct line **linep, int which) +@@ -468,6 +703,11 @@ get_line (FILE *fp, struct line **linep, } ++line_no[which - 1]; @@ -2147,7 +2049,7 @@ index f2fd172..6c7d1ed 100644 xfields (line); if (prevline[which - 1]) -@@ -567,21 +807,28 @@ prfield (size_t n, struct line const *line) +@@ -563,21 +803,28 @@ prfield (size_t n, struct line const *li /* Output all the fields in line, other than the join field. */ @@ -2179,7 +2081,7 @@ index f2fd172..6c7d1ed 100644 prfield (i, line); } } -@@ -592,7 +839,6 @@ static void +@@ -588,7 +835,6 @@ static void prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -2187,7 +2089,7 @@ index f2fd172..6c7d1ed 100644 size_t field; struct line const *line; -@@ -626,7 +872,7 @@ prjoin (struct line const *line1, struct line const *line2) +@@ -622,7 +868,7 @@ prjoin (struct line const *line1, struct o = o->next; if (o == NULL) break; @@ -2196,7 +2098,7 @@ index f2fd172..6c7d1ed 100644 } putchar (eolchar); } -@@ -1102,20 +1348,43 @@ main (int argc, char **argv) +@@ -1098,20 +1344,43 @@ main (int argc, char **argv) case 't': { @@ -2249,25 +2151,10 @@ index f2fd172..6c7d1ed 100644 } break; -diff --git a/src/local.mk b/src/local.mk -index e1d15ce..1a5ffaa 100644 ---- a/src/local.mk -+++ b/src/local.mk -@@ -434,8 +434,8 @@ src_base32_CPPFLAGS = -DBASE_TYPE=32 $(AM_CPPFLAGS) - src_basenc_SOURCES = src/basenc.c - src_basenc_CPPFLAGS = -DBASE_TYPE=42 $(AM_CPPFLAGS) - --src_expand_SOURCES = src/expand.c src/expand-common.c --src_unexpand_SOURCES = src/unexpand.c src/expand-common.c -+src_expand_SOURCES = src/expand.c src/expand-common.c lib/mbfile.c -+src_unexpand_SOURCES = src/unexpand.c src/expand-common.c lib/mbfile.c - - src_wc_SOURCES = src/wc.c - if USE_AVX2_WC_LINECOUNT -diff --git a/src/pr.c b/src/pr.c -index 4c17c00..b4fab1c 100644 ---- a/src/pr.c -+++ b/src/pr.c +Index: src/pr.c +=================================================================== +--- src/pr.c.orig ++++ src/pr.c @@ -311,6 +311,24 @@ #include @@ -2403,7 +2290,7 @@ index 4c17c00..b4fab1c 100644 static char *column_separator = (char *) " "; static char *line_separator = (char *) "\t"; -@@ -853,6 +906,13 @@ separator_string (char const *optarg_S) +@@ -852,6 +905,13 @@ separator_string (char const *optarg_S) integer_overflow (); col_sep_length = len; col_sep_string = optarg_S; @@ -2417,7 +2304,7 @@ index 4c17c00..b4fab1c 100644 } int -@@ -877,6 +937,21 @@ main (int argc, char **argv) +@@ -876,6 +936,21 @@ main (int argc, char **argv) atexit (close_stdout); @@ -2439,7 +2326,7 @@ index 4c17c00..b4fab1c 100644 n_files = 0; file_names = (argc > 1 ? xnmalloc (argc - 1, sizeof (char *)) -@@ -953,8 +1028,12 @@ main (int argc, char **argv) +@@ -952,8 +1027,12 @@ main (int argc, char **argv) break; case 'e': if (optarg) @@ -2454,7 +2341,7 @@ index 4c17c00..b4fab1c 100644 /* Could check tab width > 0. */ untabify_input = true; break; -@@ -967,8 +1046,12 @@ main (int argc, char **argv) +@@ -966,8 +1045,12 @@ main (int argc, char **argv) break; case 'i': if (optarg) @@ -2469,7 +2356,7 @@ index 4c17c00..b4fab1c 100644 /* Could check tab width > 0. */ tabify_output = true; break; -@@ -986,8 +1069,8 @@ main (int argc, char **argv) +@@ -985,8 +1068,8 @@ main (int argc, char **argv) case 'n': numbered_lines = true; if (optarg) @@ -2480,7 +2367,7 @@ index 4c17c00..b4fab1c 100644 break; case 'N': skip_count = false; -@@ -1012,6 +1095,7 @@ main (int argc, char **argv) +@@ -1011,6 +1094,7 @@ main (int argc, char **argv) /* Reset an additional input of -s, -S dominates -s */ col_sep_string = ""; col_sep_length = 0; @@ -2488,7 +2375,7 @@ index 4c17c00..b4fab1c 100644 use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1166,10 +1250,45 @@ getoptnum (char const *n_str, int min, int *num, char const *err) +@@ -1166,10 +1250,45 @@ getoptnum (char const *n_str, int min, i a number. */ static void @@ -2706,7 +2593,7 @@ index 4c17c00..b4fab1c 100644 /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2284,7 +2415,7 @@ print_clump (COLUMN *p, int n, char *clump) +@@ -2284,7 +2415,7 @@ print_clump (COLUMN *p, int n, char *clu required number of tabs and spaces. */ static void @@ -3030,10 +2917,10 @@ index 4c17c00..b4fab1c 100644 /* We've just printed some files and need to clean up things before looking for more options and printing the next batch of files. -diff --git a/src/sort.c b/src/sort.c -index 3b775d6..a0ba243 100644 ---- a/src/sort.c -+++ b/src/sort.c +Index: src/sort.c +=================================================================== +--- src/sort.c.orig ++++ src/sort.c @@ -29,6 +29,14 @@ #include #include @@ -3049,9 +2936,9 @@ index 3b775d6..a0ba243 100644 #include "system.h" #include "argmatch.h" #include "die.h" -@@ -159,14 +167,39 @@ static int thousands_sep; - /* We currently ignore multi-byte grouping chars. */ - static bool thousands_sep_ignored; +@@ -157,14 +165,39 @@ static int decimal_point; + /* Thousands separator; if -1, then there isn't one. */ + static int thousands_sep; +/* True if -f is specified. */ +static bool folding; @@ -3090,9 +2977,9 @@ index 3b775d6..a0ba243 100644 /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -343,13 +376,11 @@ static bool stable; - /* An int value outside char range. */ - enum { NON_CHAR = CHAR_MAX + 1 }; +@@ -338,13 +371,11 @@ static bool reverse; + they were read if all keys compare equal. */ + static bool stable; -/* If TAB has this value, blanks separate fields. */ -enum { TAB_DEFAULT = CHAR_MAX + 1 }; @@ -3107,7 +2994,7 @@ index 3b775d6..a0ba243 100644 /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -805,6 +836,46 @@ reap_all (void) +@@ -802,6 +833,46 @@ reap_all (void) reap (-1); } @@ -3154,7 +3041,7 @@ index 3b775d6..a0ba243 100644 /* Clean up any remaining temporary files. */ static void -@@ -1272,7 +1343,7 @@ zaptemp (char const *name) +@@ -1269,7 +1340,7 @@ zaptemp (char const *name) free (node); } @@ -3163,7 +3050,7 @@ index 3b775d6..a0ba243 100644 static int struct_month_cmp (void const *m1, void const *m2) -@@ -1287,7 +1358,7 @@ struct_month_cmp (void const *m1, void const *m2) +@@ -1284,7 +1355,7 @@ struct_month_cmp (void const *m1, void c /* Initialize the character class tables. */ static void @@ -3172,7 +3059,7 @@ index 3b775d6..a0ba243 100644 { size_t i; -@@ -1299,7 +1370,7 @@ inittables (void) +@@ -1296,7 +1367,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -3181,7 +3068,7 @@ index 3b775d6..a0ba243 100644 /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1381,6 +1452,84 @@ specify_nmerge (int oi, char c, char const *s) +@@ -1378,6 +1449,84 @@ specify_nmerge (int oi, char c, char con xstrtol_fatal (e, oi, c, long_options, s); } @@ -3266,7 +3153,7 @@ index 3b775d6..a0ba243 100644 /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1612,7 +1761,7 @@ buffer_linelim (struct buffer const *buf) +@@ -1609,7 +1758,7 @@ buffer_linelim (struct buffer const *buf by KEY in LINE. */ static char * @@ -3275,7 +3162,7 @@ index 3b775d6..a0ba243 100644 { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1621,10 +1770,10 @@ begfield (struct line const *line, struct keyfield const *key) +@@ -1618,10 +1767,10 @@ begfield (struct line const *line, struc /* The leading field separator itself is included in a field when -t is absent. */ @@ -3288,7 +3175,7 @@ index 3b775d6..a0ba243 100644 ++ptr; if (ptr < lim) ++ptr; -@@ -1650,12 +1799,71 @@ begfield (struct line const *line, struct keyfield const *key) +@@ -1647,11 +1796,70 @@ begfield (struct line const *line, struc return ptr; } @@ -3354,14 +3241,13 @@ index 3b775d6..a0ba243 100644 /* Return the limit of (a pointer to the first character after) the field in LINE specified by KEY. */ - ATTRIBUTE_PURE - static char * + static char * _GL_ATTRIBUTE_PURE -limfield (struct line const *line, struct keyfield const *key) +limfield_uni (struct line const *line, struct keyfield const *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1670,10 +1878,10 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1666,10 +1874,10 @@ limfield (struct line const *line, struc 'beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first 'blank' character after the preceding field. */ @@ -3374,7 +3260,7 @@ index 3b775d6..a0ba243 100644 ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1719,10 +1927,10 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1715,10 +1923,10 @@ limfield (struct line const *line, struc */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -3387,7 +3273,7 @@ index 3b775d6..a0ba243 100644 if (newlim) lim = newlim; } -@@ -1753,6 +1961,130 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1749,6 +1957,130 @@ limfield (struct line const *line, struc return ptr; } @@ -3518,7 +3404,7 @@ index 3b775d6..a0ba243 100644 /* Fill BUF reading from FP, moving buf->left bytes from the end of buf->buf to the beginning first. If EOF is reached and the file wasn't terminated by a newline, supply one. Set up BUF's line -@@ -1839,8 +2171,22 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file) +@@ -1835,8 +2167,22 @@ fillbuf (struct buffer *buf, FILE *fp, c else { if (key->skipsblanks) @@ -3543,9 +3429,9 @@ index 3b775d6..a0ba243 100644 line->keybeg = line_start; } } -@@ -1976,12 +2322,10 @@ find_unit_order (char const *number) +@@ -1970,12 +2316,10 @@ find_unit_order (char const *number) + < K/k < M < G < T < P < E < Z < Y */ - ATTRIBUTE_PURE static int -human_numcompare (char const *a, char const *b) +human_numcompare (char *a, char *b) @@ -3559,16 +3445,16 @@ index 3b775d6..a0ba243 100644 int diff = find_unit_order (a) - find_unit_order (b); return (diff ? diff : strnumcmp (a, b, decimal_point, thousands_sep)); -@@ -1993,7 +2337,7 @@ human_numcompare (char const *a, char const *b) +@@ -1986,7 +2330,7 @@ human_numcompare (char const *a, char co + hideously fast. */ - ATTRIBUTE_PURE static int -numcompare (char const *a, char const *b) +numcompare_uni (const char *a, const char *b) { while (blanks[to_uchar (*a)]) a++; -@@ -2003,6 +2347,25 @@ numcompare (char const *a, char const *b) +@@ -1996,6 +2340,25 @@ numcompare (char const *a, char const *b return strnumcmp (a, b, decimal_point, thousands_sep); } @@ -3594,7 +3480,7 @@ index 3b775d6..a0ba243 100644 /* Work around a problem whereby the long double value returned by glibc's strtold ("NaN", ...) contains uninitialized bits: clear all bytes of A and B before calling strtold. FIXME: remove this function if -@@ -2053,7 +2416,7 @@ general_numcompare (char const *sa, char const *sb) +@@ -2046,7 +2409,7 @@ general_numcompare (char const *sa, char Return 0 if the name in S is not recognized. */ static int @@ -3603,7 +3489,7 @@ index 3b775d6..a0ba243 100644 { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2329,15 +2692,14 @@ debug_key (struct line const *line, struct keyfield const *key) +@@ -2322,15 +2685,14 @@ debug_key (struct line const *line, stru char saved = *lim; *lim = '\0'; @@ -3621,7 +3507,7 @@ index 3b775d6..a0ba243 100644 else if (key->general_numeric) ignore_value (strtold (beg, &tighter_lim)); else if (key->numeric || key->human_numeric) -@@ -2483,7 +2845,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2464,7 +2826,7 @@ key_warnings (struct keyfield const *gke /* Warn about significant leading blanks. */ bool implicit_skip = key_numeric (key) || key->month; bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ @@ -3630,66 +3516,7 @@ index 3b775d6..a0ba243 100644 && ((!key->skipsblanks && !implicit_skip) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2531,9 +2893,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) - bool number_locale_warned = false; - if (basic_numeric_field_span) - { -- if (tab == TAB_DEFAULT -- ? thousands_sep != NON_CHAR && (isblank (to_uchar (thousands_sep))) -- : tab == thousands_sep) -+ if (tab_length -+ ? tab[0] == thousands_sep -+ : thousands_sep != NON_CHAR && (isblank (to_uchar (thousands_sep)))) - { - error (0, 0, - _("field separator %s is treated as a " -@@ -2544,9 +2906,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) - } - if (basic_numeric_field_span || general_numeric_field_span) - { -- if (tab == TAB_DEFAULT -- ? thousands_sep != NON_CHAR && (isblank (to_uchar (decimal_point))) -- : tab == decimal_point) -+ if (tab_length -+ ? tab[0] == decimal_point -+ : thousands_sep != NON_CHAR && (isblank (to_uchar (decimal_point)))) - { - error (0, 0, - _("field separator %s is treated as a " -@@ -2554,19 +2916,19 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) - quote (((char []) {decimal_point, 0}))); - number_locale_warned = true; - } -- else if (tab == '-') -+ else if (tab_length && tab[0] == '-') - { - error (0, 0, - _("field separator %s is treated as a " - "minus sign in numbers"), -- quote (((char []) {tab, 0}))); -+ quote (((char []) {tab[0], 0}))); - } -- else if (general_numeric_field_span && tab == '+') -+ else if (general_numeric_field_span && tab_length && tab[0] == '+') - { - error (0, 0, - _("field separator %s is treated as a " - "plus sign in numbers"), -- quote (((char []) {tab, 0}))); -+ quote (((char []) {tab[0], 0}))); - } - } - -@@ -2577,7 +2939,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) - { - error (0, 0, - _("%snumbers use %s as a decimal point in this locale"), -- tab == decimal_point ? "" : _("note "), -+ (tab_length && tab[0] == decimal_point) ? "" : _("note "), - quote (((char []) {decimal_point, 0}))); - - } -@@ -2610,11 +2972,87 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2522,11 +2884,87 @@ key_warnings (struct keyfield const *gke error (0, 0, _("option '-r' only applies to last-resort comparison")); } @@ -3778,7 +3605,7 @@ index 3b775d6..a0ba243 100644 { struct keyfield *key = keylist; -@@ -2699,7 +3137,7 @@ keycompare (struct line const *a, struct line const *b) +@@ -2611,7 +3049,7 @@ keycompare (struct line const *a, struct else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -3787,7 +3614,7 @@ index 3b775d6..a0ba243 100644 else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2815,6 +3253,211 @@ keycompare (struct line const *a, struct line const *b) +@@ -2727,6 +3165,211 @@ keycompare (struct line const *a, struct return key->reverse ? -diff : diff; } @@ -3999,7 +3826,7 @@ index 3b775d6..a0ba243 100644 /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -2842,7 +3485,7 @@ compare (struct line const *a, struct line const *b) +@@ -2754,7 +3397,7 @@ compare (struct line const *a, struct li diff = - NONZERO (blen); else if (blen == 0) diff = 1; @@ -4008,7 +3835,7 @@ index 3b775d6..a0ba243 100644 { /* xmemcoll0 is a performance enhancement as it will not unconditionally write '\0' after the -@@ -4226,6 +4869,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype) +@@ -4144,6 +4787,7 @@ set_ordering (char const *s, struct keyf break; case 'f': key->translate = fold_toupper; @@ -4016,7 +3843,7 @@ index 3b775d6..a0ba243 100644 break; case 'g': key->general_numeric = true; -@@ -4305,7 +4949,7 @@ main (int argc, char **argv) +@@ -4223,7 +4867,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -4025,8 +3852,8 @@ index 3b775d6..a0ba243 100644 hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4328,6 +4972,29 @@ main (int argc, char **argv) - thousands_sep = NON_CHAR; +@@ -4244,6 +4888,29 @@ main (int argc, char **argv) + thousands_sep = -1; } +#if HAVE_MBRTOWC @@ -4055,7 +3882,7 @@ index 3b775d6..a0ba243 100644 have_read_stdin = false; inittables (); -@@ -4602,13 +5269,34 @@ main (int argc, char **argv) +@@ -4518,13 +5185,34 @@ main (int argc, char **argv) case 't': { @@ -4094,7 +3921,7 @@ index 3b775d6..a0ba243 100644 else { /* Provoke with 'sort -txx'. Complain about -@@ -4619,9 +5307,11 @@ main (int argc, char **argv) +@@ -4535,9 +5223,11 @@ main (int argc, char **argv) quote (optarg)); } } @@ -4108,10 +3935,23 @@ index 3b775d6..a0ba243 100644 } break; -diff --git a/src/unexpand.c b/src/unexpand.c -index 7d6100f..04cd646 100644 ---- a/src/unexpand.c -+++ b/src/unexpand.c +@@ -4766,12 +5456,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) + sort_die (_("close failed"), "-"); +Index: src/unexpand.c +=================================================================== +--- src/unexpand.c.orig ++++ src/unexpand.c @@ -38,6 +38,9 @@ #include #include @@ -4144,11 +3984,11 @@ index 7d6100f..04cd646 100644 return; + mbf_init (mbf, fp); + found_bom=check_bom(fp,&mbf); -+ + + if (using_utf_locale == false && found_bom == true) + { + /*try using some predefined locale */ - ++ + if (set_utf_locale () != 0) + { + error (EXIT_FAILURE, errno, _("cannot set UTF-8 locale")); @@ -4314,10 +4154,10 @@ index 7d6100f..04cd646 100644 } } -diff --git a/src/uniq.c b/src/uniq.c -index e5996f0..871d47c 100644 ---- a/src/uniq.c -+++ b/src/uniq.c +Index: src/uniq.c +=================================================================== +--- src/uniq.c.orig ++++ src/uniq.c @@ -21,6 +21,17 @@ #include #include @@ -4366,16 +4206,16 @@ index e5996f0..871d47c 100644 static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -254,7 +281,7 @@ size_opt (char const *opt, char const *msgid) +@@ -253,7 +280,7 @@ size_opt (char const *opt, char const *m + return a pointer to the beginning of the line's field to be compared. */ - ATTRIBUTE_PURE - static char * + static char * _GL_ATTRIBUTE_PURE -find_field (struct linebuffer const *line) +find_field_uni (struct linebuffer *line) { size_t count; char const *lp = line->buffer; -@@ -274,6 +301,83 @@ find_field (struct linebuffer const *line) +@@ -273,6 +300,83 @@ find_field (struct linebuffer const *lin return line->buffer + i; } @@ -4459,7 +4299,7 @@ index e5996f0..871d47c 100644 /* 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. -@@ -494,6 +598,19 @@ main (int argc, char **argv) +@@ -493,6 +597,19 @@ main (int argc, char **argv) atexit (close_stdout); @@ -4479,25 +4319,10 @@ index e5996f0..871d47c 100644 skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; -diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm -index fad7ab9..c9021a6 100644 ---- a/tests/Coreutils.pm -+++ b/tests/Coreutils.pm -@@ -264,6 +264,9 @@ sub run_tests ($$$$$) - # Yes, this is an arbitrary limit. If it causes trouble, - # consider removing it. - my $max = 30; -+ # The downstream i18n multi-byte tests have a "-mb" suffix. -+ # Therefore add 3 to the maximum test name length. -+ $max += 3; - if ($max < length $test_name) - { - warn "$program_name: $test_name: test name is too long (> $max)\n"; -diff --git a/tests/expand/mb.sh b/tests/expand/mb.sh -new file mode 100755 -index 0000000..dd6007c +Index: tests/expand/mb.sh +=================================================================== --- /dev/null -+++ b/tests/expand/mb.sh ++++ tests/expand/mb.sh @@ -0,0 +1,183 @@ +#!/bin/sh + @@ -4682,11 +4507,10 @@ index 0000000..dd6007c +compare exp out > /dev/null 2>&1 || fail=1 + +exit $fail -diff --git a/tests/i18n/sort.sh b/tests/i18n/sort.sh -new file mode 100755 -index 0000000..26c95de +Index: tests/i18n/sort.sh +=================================================================== --- /dev/null -+++ b/tests/i18n/sort.sh ++++ tests/i18n/sort.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -4717,11 +4541,11 @@ index 0000000..26c95de + + +Exit $fail -diff --git a/tests/local.mk b/tests/local.mk -index 0f77786..dbe1843 100644 ---- a/tests/local.mk -+++ b/tests/local.mk -@@ -377,6 +377,8 @@ all_tests = \ +Index: tests/local.mk +=================================================================== +--- tests/local.mk.orig ++++ tests/local.mk +@@ -375,6 +375,8 @@ all_tests = \ tests/misc/sort-discrim.sh \ tests/misc/sort-files0-from.pl \ tests/misc/sort-float.sh \ @@ -4730,7 +4554,7 @@ index 0f77786..dbe1843 100644 tests/misc/sort-h-thousands-sep.sh \ tests/misc/sort-merge.pl \ tests/misc/sort-merge-fdlimit.sh \ -@@ -576,6 +578,7 @@ all_tests = \ +@@ -573,6 +575,7 @@ all_tests = \ tests/du/threshold.sh \ tests/du/trailing-slash.sh \ tests/du/two-args.sh \ @@ -4738,7 +4562,7 @@ index 0f77786..dbe1843 100644 tests/id/gnu-zero-uids.sh \ tests/id/no-context.sh \ tests/id/context.sh \ -@@ -727,6 +730,7 @@ all_tests = \ +@@ -724,6 +727,7 @@ all_tests = \ tests/touch/read-only.sh \ tests/touch/relative.sh \ tests/touch/trailing-slash.sh \ @@ -4746,10 +4570,10 @@ index 0f77786..dbe1843 100644 $(all_root_tests) # See tests/factor/create-test.sh. -diff --git a/tests/misc/expand.pl b/tests/misc/expand.pl -index 7a77e6f..27f6652 100755 ---- a/tests/misc/expand.pl -+++ b/tests/misc/expand.pl +Index: tests/misc/expand.pl +=================================================================== +--- tests/misc/expand.pl.orig ++++ tests/misc/expand.pl @@ -27,6 +27,15 @@ my $prog = 'expand'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -4813,10 +4637,10 @@ index 7a77e6f..27f6652 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/misc/fold.pl b/tests/misc/fold.pl -index 2834f92..bc1616a 100755 ---- a/tests/misc/fold.pl -+++ b/tests/misc/fold.pl +Index: tests/misc/fold.pl +=================================================================== +--- tests/misc/fold.pl.orig ++++ tests/misc/fold.pl @@ -20,9 +20,18 @@ use strict; (my $program_name = $0) =~ s|.*/||; @@ -4886,10 +4710,10 @@ index 2834f92..bc1616a 100755 -my $prog = 'fold'; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); exit $fail; -diff --git a/tests/misc/join.pl b/tests/misc/join.pl -index 06ad777..be40204 100755 ---- a/tests/misc/join.pl -+++ b/tests/misc/join.pl +Index: tests/misc/join.pl +=================================================================== +--- tests/misc/join.pl.orig ++++ tests/misc/join.pl @@ -25,6 +25,15 @@ my $limits = getlimits (); my $prog = 'join'; @@ -4956,11 +4780,10 @@ index 06ad777..be40204 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/misc/sort-mb-tests.sh b/tests/misc/sort-mb-tests.sh -new file mode 100755 -index 0000000..11836ba +Index: tests/misc/sort-mb-tests.sh +=================================================================== --- /dev/null -+++ b/tests/misc/sort-mb-tests.sh ++++ tests/misc/sort-mb-tests.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -5007,10 +4830,10 @@ index 0000000..11836ba +compare exp out || { fail=1; cat out; } + +Exit $fail -diff --git a/tests/misc/sort-merge.pl b/tests/misc/sort-merge.pl -index 7eb4574..eda884c 100755 ---- a/tests/misc/sort-merge.pl -+++ b/tests/misc/sort-merge.pl +Index: tests/misc/sort-merge.pl +=================================================================== +--- tests/misc/sort-merge.pl.orig ++++ tests/misc/sort-merge.pl @@ -26,6 +26,15 @@ my $prog = 'sort'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -5067,10 +4890,10 @@ index 7eb4574..eda884c 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/misc/sort.pl b/tests/misc/sort.pl -index 0b0adca..fd27821 100755 ---- a/tests/misc/sort.pl -+++ b/tests/misc/sort.pl +Index: tests/misc/sort.pl +=================================================================== +--- tests/misc/sort.pl.orig ++++ tests/misc/sort.pl @@ -24,10 +24,15 @@ my $prog = 'sort'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -5135,10 +4958,10 @@ index 0b0adca..fd27821 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/misc/unexpand.pl b/tests/misc/unexpand.pl -index 2e1906f..fe66012 100755 ---- a/tests/misc/unexpand.pl -+++ b/tests/misc/unexpand.pl +Index: tests/misc/unexpand.pl +=================================================================== +--- tests/misc/unexpand.pl.orig ++++ tests/misc/unexpand.pl @@ -27,6 +27,14 @@ my $limits = getlimits (); my $prog = 'unexpand'; @@ -5192,10 +5015,10 @@ index 2e1906f..fe66012 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/misc/uniq.pl b/tests/misc/uniq.pl -index aa163cd..91d617d 100755 ---- a/tests/misc/uniq.pl -+++ b/tests/misc/uniq.pl +Index: tests/misc/uniq.pl +=================================================================== +--- tests/misc/uniq.pl.orig ++++ tests/misc/uniq.pl @@ -23,9 +23,17 @@ my $limits = getlimits (); my $prog = 'uniq'; my $try = "Try '$prog --help' for more information.\n"; @@ -5268,10 +5091,10 @@ index aa163cd..91d617d 100755 @Tests = add_z_variants \@Tests; @Tests = triple_test \@Tests; -diff --git a/tests/pr/pr-tests.pl b/tests/pr/pr-tests.pl -index 7ac6d4c..ae6cc35 100755 ---- a/tests/pr/pr-tests.pl -+++ b/tests/pr/pr-tests.pl +Index: tests/pr/pr-tests.pl +=================================================================== +--- tests/pr/pr-tests.pl.orig ++++ tests/pr/pr-tests.pl @@ -24,6 +24,15 @@ use strict; my $prog = 'pr'; my $normalize_strerror = "s/': .*/'/"; @@ -5337,11 +5160,10 @@ index 7ac6d4c..ae6cc35 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff --git a/tests/unexpand/mb.sh b/tests/unexpand/mb.sh -new file mode 100755 -index 0000000..8a82d74 +Index: tests/unexpand/mb.sh +=================================================================== --- /dev/null -+++ b/tests/unexpand/mb.sh ++++ tests/unexpand/mb.sh @@ -0,0 +1,172 @@ +#!/bin/sh + @@ -5515,6 +5337,32 @@ index 0000000..8a82d74 + +LC_ALL=C unexpand in in > out || fail=1 +compare exp out > /dev/null 2>&1 || fail=1 --- -2.34.1 - +Index: tests/Coreutils.pm +=================================================================== +--- tests/Coreutils.pm.orig ++++ tests/Coreutils.pm +@@ -264,6 +264,9 @@ sub run_tests ($$$$$) + # Yes, this is an arbitrary limit. If it causes trouble, + # consider removing it. + my $max = 30; ++ # The downstream i18n multi-byte tests have a "-mb" suffix. ++ # Therefore add 3 to the maximum test name length. ++ $max += 3; + if ($max < length $test_name) + { + warn "$program_name: $test_name: test name is too long (> $max)\n"; +Index: src/local.mk +=================================================================== +--- src/local.mk.orig ++++ src/local.mk +@@ -429,8 +429,8 @@ src_base32_CPPFLAGS = -DBASE_TYPE=32 $(A + src_basenc_SOURCES = src/basenc.c + src_basenc_CPPFLAGS = -DBASE_TYPE=42 $(AM_CPPFLAGS) + +-src_expand_SOURCES = src/expand.c src/expand-common.c +-src_unexpand_SOURCES = src/unexpand.c src/expand-common.c ++src_expand_SOURCES = src/expand.c src/expand-common.c lib/mbfile.c ++src_unexpand_SOURCES = src/unexpand.c src/expand-common.c lib/mbfile.c + + src_wc_SOURCES = src/wc.c + if USE_AVX2_WC_LINECOUNT diff --git a/coreutils-skip-gnulib-test-tls.patch b/coreutils-skip-gnulib-test-tls.patch index 4474006..b166d4c 100644 --- a/coreutils-skip-gnulib-test-tls.patch +++ b/coreutils-skip-gnulib-test-tls.patch @@ -21,7 +21,7 @@ Index: gnulib-tests/gnulib.mk =================================================================== --- gnulib-tests/gnulib.mk.orig +++ gnulib-tests/gnulib.mk -@@ -2676,9 +2676,10 @@ EXTRA_DIST += test-timespec.c macros.h +@@ -2615,9 +2615,10 @@ EXTRA_DIST += test-timespec.c macros.h ## begin gnulib module tls-tests diff --git a/coreutils-sysinfo.patch b/coreutils-sysinfo.patch index 0d80ce9..c3fbb74 100644 --- a/coreutils-sysinfo.patch +++ b/coreutils-sysinfo.patch @@ -6,8 +6,8 @@ Index: src/uname.c =================================================================== --- src/uname.c.orig +++ src/uname.c -@@ -341,6 +341,36 @@ main (int argc, char **argv) - element = processor; +@@ -338,6 +338,36 @@ main (int argc, char **argv) + # endif } #endif + if (element == unknown) @@ -43,7 +43,7 @@ Index: src/uname.c if (! (toprint == UINT_MAX && element == unknown)) print_element (element); } -@@ -366,6 +396,18 @@ main (int argc, char **argv) +@@ -363,6 +393,18 @@ main (int argc, char **argv) element = hardware_platform; } #endif diff --git a/coreutils-tests-shorten-extreme-factor-tests.patch b/coreutils-tests-shorten-extreme-factor-tests.patch index 1461d65..17f1e38 100644 --- a/coreutils-tests-shorten-extreme-factor-tests.patch +++ b/coreutils-tests-shorten-extreme-factor-tests.patch @@ -16,7 +16,7 @@ Index: tests/local.mk =================================================================== --- tests/local.mk.orig +++ tests/local.mk -@@ -736,14 +736,9 @@ all_tests = \ +@@ -733,14 +733,9 @@ all_tests = \ # See tests/factor/create-test.sh. tf = tests/factor factor_tests = \ diff --git a/coreutils.changes b/coreutils.changes index 2764b89..3203727 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,80 +1,3 @@ -------------------------------------------------------------------- -Sun Apr 24 09:49:04 UTC 2022 - Bernhard Voelker - -- gnulib-simple-backup-fix.patch: Add patch to make simple backups in correct - directory; broken in 9.1. See https://bugs.gnu.org/55029 - -------------------------------------------------------------------- -Thu Apr 21 20:58:30 UTC 2022 - Dirk Müller - -- update to 9.1: - * chmod -R no longer exits with error status when encountering symlinks. - All files would be processed correctly, but the exit status was incorrect. - * If 'cp -Z A B' checks B's status and some other process then removes B, - cp no longer creates B with a too-generous SELinux security context - before adjusting it to the correct value. - * 'cp --preserve=ownership A B' no longer ignores the umask when creating B. - Also, 'cp --preserve-xattr A B' is less likely to temporarily chmod u+w B. - * 'id xyz' now uses the name 'xyz' to determine groups, instead of xyz's uid. - * 'ls -v' and 'sort -V' no longer mishandle corner cases like "a..a" vs "a.+" - or lines containing NULs. Their behavior now matches the documentation - for file names like ".m4" that consist entirely of an extension, - and the documentation has been clarified for unusual cases. - * 'mv -T --backup=numbered A B/' no longer miscalculates the backup number - for B when A is a directory, possibly inflooping. - * cat now uses the copy_file_range syscall if available, when doing - simple copies between regular files. This may be more efficient, by avoiding - user space copies, and possibly employing copy offloading or reflinking. - * chown and chroot now warn about usages like "chown root.root f", - which have the nonstandard and long-obsolete "." separator that - causes problems on platforms where user names contain ".". - Applications should use ":" instead of ".". - * cksum no longer allows abbreviated algorithm names, - so that forward compatibility and robustness is improved. - * date +'%-N' now suppresses excess trailing digits, instead of always - padding them with zeros to 9 digits. It uses clock_getres and - clock_gettime to infer the clock resolution. - * dd conv=fsync now synchronizes output even after a write error, - and similarly for dd conv=fdatasync. - * dd now counts bytes instead of blocks if a block count ends in "B". - For example, 'dd count=100KiB' now copies 100 KiB of data, not - 102,400 blocks of data. The flags count_bytes, skip_bytes and - seek_bytes are therefore obsolescent and are no longer documented, - though they still work. - * ls no longer colors files with capabilities by default, as file-based - capabilties are very rarely used, and lookup increases processing per file by - about 30%. It's best to use getcap [-r] to identify files with capabilities. - * ls no longer tries to automount files, reverting to the behavior - before the statx() call was introduced in coreutils-8.32. - * stat no longer tries to automount files by default, reverting to the - behavior before the statx() call was introduced in coreutils-8.32. - Only `stat --cached=never` will continue to automount files. - * timeout --foreground --kill-after=... will now exit with status 137 - if the kill signal was sent, which is consistent with the behavior - when the --foreground option is not specified. This allows users to - distinguish if the command was more forcefully terminated. - * dd now supports the aliases iseek=N for skip=N, and oseek=N for seek=N, - like FreeBSD and other operating systems. - * dircolors takes a new --print-ls-colors option to display LS_COLORS - entries, on separate lines, colored according to the entry color code. - * dircolors will now also match COLORTERM in addition to TERM environment - variables. The default config will apply colors with any COLORTERM set. - * cp, mv, and install now use openat-like syscalls when copying to a directory. - * This avoids some race conditions and should be more efficient. - * The new 'date' option --resolution outputs the timestamp resolution. - * With conv=fdatasync or conv=fsync, dd status=progress now reports - any extra final progress just before synchronizing output data, - since synchronizing can take a long time. - * printf now supports printing the numeric value of multi-byte characters. - * sort --debug now diagnoses issues with --field-separator characters - that conflict with characters possibly used in numbers. - * 'tail -f file | filter' now exits on Solaris when filter exits. - * root invoked coreutils, that are built and run in single binary mode, - now adjust /proc/$pid/cmdline to be more specific to the utility - being run, rather than using the general "coreutils" binary name. -- coreutils-i18n.patch: Re-sync the patch with Fedora. -- drop coreutils-chmod-fix-exit-status-ign-symlinks.patch (upstream) - ------------------------------------------------------------------- Mon Oct 4 22:15:01 UTC 2021 - Bernhard Voelker diff --git a/coreutils.spec b/coreutils.spec index b816c65..2f819e9 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,20 +19,16 @@ # there are more fancy ways to define a package name using magic # macros but OBS and the bots that rely on parser information from # OBS can't deal with all of them -%global flavor @BUILD_FLAVOR@%{nil} - +%define flavor @BUILD_FLAVOR@%{nil} %bcond_with ringdisabled +%if "%{flavor}" != "" +%define name_suffix -%{flavor} %if %{with ringdisabled} ExclusiveArch: do_not_build %endif - -%if "%{flavor}" != "" -%define psuffix -%{flavor} -%else -%define psuffix %{nil} %endif -Name: coreutils%{psuffix} -Version: 9.1 +Name: coreutils%{?name_suffix} +Version: 9.0 Release: 0 Summary: GNU Core Utilities License: GPL-3.0-or-later @@ -63,14 +59,11 @@ Patch303: coreutils-tests-shorten-extreme-factor-tests.patch Patch304: coreutils-use-python3.patch Patch500: coreutils-disable_tests.patch Patch501: coreutils-test_without_valgrind.patch - -# Downstream patch to skip a test failing on OBS. +# Upstream patch - remove with version >9.0: +# chmod: fix exit status when ignoring symlinks +Patch800: coreutils-chmod-fix-exit-status-ign-symlinks.patch # tests: skip tests/rm/ext3-perf.sh temporarily as it hangs on OBS. Patch810: coreutils-skip-tests-rm-ext3-perf.patch - -# Upstream patch - remove with version >9.1: -Patch850: gnulib-simple-backup-fix.patch - BuildRequires: automake BuildRequires: gmp-devel BuildRequires: libacl-devel @@ -141,7 +134,7 @@ This package contains the documentation for the GNU Core Utilities. %prep %setup -q -n coreutils-%{version} -%patch4 -p1 +%patch4 %patch1 %patch3 %patch8 @@ -164,8 +157,8 @@ This package contains the documentation for the GNU Core Utilities. %patch500 %patch501 +%patch800 %patch810 -%patch850 # ================================================ %build diff --git a/gnulib-simple-backup-fix.patch b/gnulib-simple-backup-fix.patch deleted file mode 100644 index aa70c2d..0000000 --- a/gnulib-simple-backup-fix.patch +++ /dev/null @@ -1,93 +0,0 @@ -Upstream patch on top of coreutils-9.1; remove with >9.1. -Fixes: https://bugs.gnu.org/55029 - -Two commits: - -* https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=e087525091b - - commit e087525091b8f0a15eb2354f71032597d5271599 - Author: Paul Eggert - Date: Wed Apr 20 19:44:56 2022 -0700 - - mv: test Bug#55029 - - * tests/mv/backup-dir.sh: New test for Bug#55029, - reported by Steve Ward. - -* https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=7347caeb9d90 - - commit 7347caeb9d902d3fca2c11f69a55a3e578d93bfe - Author: Paul Eggert - Date: Wed Apr 20 19:34:57 2022 -0700 - - backupfile: fix bug when renaming simple backups - - * lib/backupfile.c (backupfile_internal): Fix bug when RENAME - and when doing simple backups. Problem reported by Steve Ward in: - https://bugs.gnu.org/55029 - ---- - NEWS | 8 ++++++++ - lib/backupfile.c | 7 +++---- - tests/mv/backup-dir.sh | 6 ++++++ - 3 files changed, 17 insertions(+), 4 deletions(-) - -Index: lib/backupfile.c -=================================================================== ---- lib/backupfile.c.orig -+++ lib/backupfile.c -@@ -332,7 +332,7 @@ backupfile_internal (int dir_fd, char co - return s; - - DIR *dirp = NULL; -- int sdir = AT_FDCWD; -+ int sdir = dir_fd; - idx_t base_max = 0; - while (true) - { -@@ -371,10 +371,9 @@ backupfile_internal (int dir_fd, char co - if (! rename) - break; - -- int olddirfd = sdir < 0 ? dir_fd : sdir; -- idx_t offset = sdir < 0 ? 0 : base_offset; -+ idx_t offset = backup_type == simple_backups ? 0 : base_offset; - unsigned flags = backup_type == simple_backups ? 0 : RENAME_NOREPLACE; -- if (renameatu (olddirfd, file + offset, sdir, s + offset, flags) == 0) -+ if (renameatu (sdir, file + offset, sdir, s + offset, flags) == 0) - break; - int e = errno; - if (! (e == EEXIST && extended)) -Index: tests/mv/backup-dir.sh -=================================================================== ---- tests/mv/backup-dir.sh.orig -+++ tests/mv/backup-dir.sh -@@ -36,4 +36,10 @@ mkdir C D E || framework_failure_ - mv -T --backup=numbered C E/ || fail=1 - mv -T --backup=numbered D E/ || fail=1 - -+# Bug#55029 -+mkdir F && echo 1 >1 && echo 2 >2 && cp 1 F/X && cp 2 X || framework_failure_ -+mv --backup=simple X F/ || fail=1 -+compare 1 F/X~ || fail=1 -+compare 2 F/X || fail=1 -+ - Exit $fail -Index: NEWS -=================================================================== ---- NEWS.orig -+++ NEWS -@@ -1,5 +1,13 @@ - GNU coreutils NEWS -*- outline -*- - -+* Downstream changes on top of release 9.1 -+ -+** Bug fixes -+ -+ 'mv --backup=simple f d/' no longer mistakenly backs up d/f to f~. -+ [bug introduced in coreutils-9.1] -+ -+ - * Noteworthy changes in release 9.1 (2022-04-15) [stable] - - ** Bug fixes