From 531c7c759fc225a5d7c4ea1cbbf715799487906c Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Fri, 11 Apr 2025 17:29:36 +0800 Subject: [PATCH] 9.7 --- backport-cat-fix-plain-cat-bug.patch | 81 ------- backport-ls-fix-crash-with-context.patch | 80 ------- backport-who-m-systemd.patch | 25 --- bugfix-dummy_help2man.patch | 6 +- ...ils-9.6-sw.patch => coreutils-9.7-sw.patch | 91 ++++---- coreutils-9.6.tar.xz => coreutils-9.7.tar.xz | 4 +- coreutils-i18n.patch | 204 ++++++++++-------- coreutils.spec | 16 +- 8 files changed, 171 insertions(+), 336 deletions(-) delete mode 100644 backport-cat-fix-plain-cat-bug.patch delete mode 100644 backport-ls-fix-crash-with-context.patch delete mode 100644 backport-who-m-systemd.patch rename coreutils-9.6-sw.patch => coreutils-9.7-sw.patch (77%) rename coreutils-9.6.tar.xz => coreutils-9.7.tar.xz (32%) diff --git a/backport-cat-fix-plain-cat-bug.patch b/backport-cat-fix-plain-cat-bug.patch deleted file mode 100644 index a5808e8..0000000 --- a/backport-cat-fix-plain-cat-bug.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 7386c291be8e2de115f2e161886e872429edadd7 Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Fri, 14 Feb 2025 13:10:02 -0800 -Subject: =?UTF-8?q?cat:=20fix=20plain=20=E2=80=98cat=E2=80=99=20bug?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -* src/cat.c (main): Do not fail with plain ‘cat’ where input and -output are both /dev/tty, if the output happens to have O_APPEND set. -Problem reported by lilydjwg . -Also, don’t report an error if the seek position is at or after EOF, -even if O_APPEND is set. ---- - src/cat.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -(limited to 'src/cat.c') - -diff --git a/src/cat.c b/src/cat.c -index 274f844..c022103 100644 ---- a/src/cat.c -+++ b/src/cat.c -@@ -646,9 +646,15 @@ - idx_t outsize = io_blksize (&stat_buf); - - /* Device, I-node number and lazily-acquired flags of the output. */ -- dev_t out_dev = stat_buf.st_dev; -- ino_t out_ino = stat_buf.st_ino; -+ dev_t out_dev; -+ ino_t out_ino; - int out_flags = -2; -+ bool have_out_dev = ! (S_TYPEISSHM (&stat_buf) || S_TYPEISTMO (&stat_buf)); -+ if (have_out_dev) -+ { -+ out_dev = stat_buf.st_dev; -+ out_ino = stat_buf.st_ino; -+ } - - /* True if the output is a regular file. */ - bool out_isreg = S_ISREG (stat_buf.st_mode) != 0; -@@ -706,22 +712,25 @@ - output device. It's better to catch this error earlier - rather than later. */ - -- if (stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino) -+ if (! (S_ISFIFO (stat_buf.st_mode) || S_ISSOCK (stat_buf.st_mode) -+ || S_TYPEISSHM (&stat_buf) || S_TYPEISTMO (&stat_buf)) -+ && have_out_dev -+ && stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino) - { -- if (out_flags < -1) -- out_flags = fcntl (STDOUT_FILENO, F_GETFL); -- bool exhausting = 0 <= out_flags && out_flags & O_APPEND; -- if (!exhausting) -- { -- off_t in_pos = lseek (input_desc, 0, SEEK_CUR); -- if (0 <= in_pos) -- exhausting = in_pos < lseek (STDOUT_FILENO, 0, SEEK_CUR); -- } -- if (exhausting) -+ off_t in_pos = lseek (input_desc, 0, SEEK_CUR); -+ if (0 <= in_pos) - { -- error (0, 0, _("%s: input file is output file"), quotef (infile)); -- ok = false; -- goto contin; -+ if (out_flags < -1) -+ out_flags = fcntl (STDOUT_FILENO, F_GETFL); -+ int whence = (0 <= out_flags && out_flags & O_APPEND -+ ? SEEK_END : SEEK_CUR); -+ if (in_pos < lseek (STDOUT_FILENO, 0, whence)) -+ { -+ error (0, 0, _("%s: input file is output file"), -+ quotef (infile)); -+ ok = false; -+ goto contin; -+ } - } - } - diff --git a/backport-ls-fix-crash-with-context.patch b/backport-ls-fix-crash-with-context.patch deleted file mode 100644 index bab7a9b..0000000 --- a/backport-ls-fix-crash-with-context.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 915004f403cb25fadb207ddfdbe6a2f43bd44fac Mon Sep 17 00:00:00 2001 -From: =?utf8?q?P=C3=A1draig=20Brady?= -Date: Fri, 17 Jan 2025 17:29:34 +0000 -Subject: [PATCH] ls: fix crash with --context - -* src/ls.c (main): Flag that we need to stat() -if we're going to get security context (call file_has_aclinfo_cache). -(file_has_aclinfo_cache): Be defensive and only lookup the device -for the file if the stat has been performed. -(has_capability_cache): Likewise. -* tests/ls/selinux-segfault.sh: Add a test case. -Reported by Bruno Haible. ---- - src/ls.c | 10 +++++----- - tests/ls/selinux-segfault.sh | 3 +++ - 2 files changed, 13 insertions(+), 5 deletions(-) - -diff --git a/src/ls.c b/src/ls.c -index 321536021..f67167f16 100644 ---- a/src/ls.c -+++ b/src/ls.c -@@ -1768,7 +1768,7 @@ main (int argc, char **argv) - - format_needs_stat = ((sort_type == sort_time) | (sort_type == sort_size) - | (format == long_format) -- | print_block_size | print_hyperlink); -+ | print_block_size | print_hyperlink | print_scontext); - format_needs_type = ((! format_needs_stat) - & (recursive | print_with_color | print_scontext - | directories_first -@@ -3309,7 +3309,7 @@ file_has_aclinfo_cache (char const *file, struct fileinfo *f, - static int unsupported_scontext_err; - static dev_t unsupported_device; - -- if (f->stat.st_dev == unsupported_device) -+ if (f->stat_ok && f->stat.st_dev == unsupported_device) - { - ai->buf = ai->u.__gl_acl_ch; - ai->size = 0; -@@ -3322,7 +3322,7 @@ file_has_aclinfo_cache (char const *file, struct fileinfo *f, - errno = 0; - int n = file_has_aclinfo (file, ai, flags); - int err = errno; -- if (n <= 0 && !acl_errno_valid (err)) -+ if (f->stat_ok && n <= 0 && !acl_errno_valid (err)) - { - unsupported_return = n; - unsupported_scontext = ai->scontext; -@@ -3342,14 +3342,14 @@ has_capability_cache (char const *file, struct fileinfo *f) - found that has_capability fails indicating lack of support. */ - static dev_t unsupported_device; - -- if (f->stat.st_dev == unsupported_device) -+ if (f->stat_ok && f->stat.st_dev == unsupported_device) - { - errno = ENOTSUP; - return 0; - } - - bool b = has_capability (file); -- if ( !b && !acl_errno_valid (errno)) -+ if (f->stat_ok && !b && !acl_errno_valid (errno)) - unsupported_device = f->stat.st_dev; - return b; - } -diff --git a/tests/ls/selinux-segfault.sh b/tests/ls/selinux-segfault.sh -index 11623acb3..1cac2b5fc 100755 ---- a/tests/ls/selinux-segfault.sh -+++ b/tests/ls/selinux-segfault.sh -@@ -30,4 +30,7 @@ mkdir sedir || framework_failure_ - ln -sf missing sedir/broken || framework_failure_ - returns_ 1 ls -L -R -Z -m sedir > out || fail=1 - -+# ls 9.6 would segfault with the following -+ls -Z . > out || fail=1 -+ - Exit $fail --- -2.34.1 - diff --git a/backport-who-m-systemd.patch b/backport-who-m-systemd.patch deleted file mode 100644 index 5d43364..0000000 --- a/backport-who-m-systemd.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 24450e5eecf012bc1ea8cab8d677a45fa42c1778 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= -Date: Mon, 24 Feb 2025 10:36:35 +0100 -Subject: who: fix -m with guessed tty names - -* who.c (scan_entries): Account for guessed tty names (e.g. -'sshd pts/1') from the readutmp module when using the systemd backend. -Addresses https://bugzilla.redhat.com/2343998 ---- - src/who.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/who.c b/src/who.c -index b56a1ac..17c1e34 100644 ---- a/src/who.c -+++ b/src/who.c -@@ -583,7 +583,7 @@ scan_entries (idx_t n, struct gl_utmp const *utmp_buf) - while (n--) - { - if (!my_line_only -- || STREQ (ttyname_b, utmp_buf->ut_line)) -+ || str_endswith (utmp_buf->ut_line, ttyname_b)) - { - if (need_users && IS_USER_PROCESS (utmp_buf)) - print_user (utmp_buf, boottime); diff --git a/bugfix-dummy_help2man.patch b/bugfix-dummy_help2man.patch index 936162e..0b5c1d9 100644 --- a/bugfix-dummy_help2man.patch +++ b/bugfix-dummy_help2man.patch @@ -2,7 +2,7 @@ diff --git a/man/local.mk b/man/local.mk index 05d4401..601f459 100644 --- a/man/local.mk +++ b/man/local.mk -@@ -23,14 +23,14 @@ if CROSS_COMPILING +@@ -23,14 +23,14 @@ run_help2man = $(SHELL) $(srcdir)/man/dummy-man else ## Graceful degradation for systems lacking perl. @@ -10,13 +10,13 @@ index 05d4401..601f459 100644 -if BOLD_MAN_REFS -help2man_OPTS=--bold-refs -endif --run_help2man = $(PERL) -- $(srcdir)/man/help2man $(help2man_OPTS) +-run_help2man = $(PERL) -- $(srcdir)/man/help2man --loose-indent $(help2man_OPTS) -else +#if HAVE_PERL +#if BOLD_MAN_REFS +#help2man_OPTS=--bold-refs +#endif -+#run_help2man = $(PERL) -- $(srcdir)/man/help2man $(help2man_OPTS) ++#run_help2man = $(PERL) -- $(srcdir)/man/help2man --loose-indent $(help2man_OPTS) +#else run_help2man = $(SHELL) $(srcdir)/man/dummy-man -endif diff --git a/coreutils-9.6-sw.patch b/coreutils-9.7-sw.patch similarity index 77% rename from coreutils-9.6-sw.patch rename to coreutils-9.7-sw.patch index 9db13df..61bf943 100755 --- a/coreutils-9.6-sw.patch +++ b/coreutils-9.7-sw.patch @@ -1,7 +1,8 @@ -diff -ur coreutils-9.6.orig/build-aux/config.guess coreutils-9.6/build-aux/config.guess ---- coreutils-9.6.orig/build-aux/config.guess 2024-09-02 09:08:54.651545374 +0800 -+++ coreutils-9.6/build-aux/config.guess 2024-09-02 09:10:13.785486378 +0800 -@@ -1008,6 +1008,14 @@ +diff --git a/build-aux/config.guess b/build-aux/config.guess +index 48a6846..1458c12 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -1010,6 +1010,14 @@ EOF UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; @@ -16,10 +17,11 @@ diff -ur coreutils-9.6.orig/build-aux/config.guess coreutils-9.6/build-aux/confi alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; -diff -ur coreutils-9.6.orig/build-aux/config.sub coreutils-9.6/build-aux/config.sub ---- coreutils-9.6.orig/build-aux/config.sub 2024-09-02 09:08:54.652545386 +0800 -+++ coreutils-9.6/build-aux/config.sub 2024-09-02 09:10:31.238693918 +0800 -@@ -1254,6 +1254,7 @@ +diff --git a/build-aux/config.sub b/build-aux/config.sub +index 4aaae46..6ecc757 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1254,6 +1254,7 @@ case $cpu-$vendor in | aarch64_be \ | aarch64c \ | abacus \ @@ -27,10 +29,11 @@ diff -ur coreutils-9.6.orig/build-aux/config.sub coreutils-9.6/build-aux/config. | alpha \ | alpha64 \ | alpha64ev56 \ -diff -ur coreutils-9.6.orig/configure coreutils-9.6/configure ---- coreutils-9.6.orig/configure 2024-09-02 09:08:53.994537562 +0800 -+++ coreutils-9.6/configure 2024-09-02 09:12:45.750293437 +0800 -@@ -8769,6 +8769,12 @@ +diff --git a/configure b/configure +index 9eae25a..76a757f 100755 +--- a/configure ++++ b/configure +@@ -9156,6 +9156,12 @@ printf '%s\n' "#define _LINUX_SOURCE_COMPAT 1" >>confdefs.h # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 # and the GCC 4.1.2 manual). case "$host_cpu" in @@ -43,7 +46,7 @@ diff -ur coreutils-9.6.orig/configure coreutils-9.6/configure alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at -@@ -23004,7 +23010,7 @@ +@@ -24675,7 +24681,7 @@ else case e in #( ;; # CPUs that only support a 64-bit ABI. @@ -52,19 +55,20 @@ diff -ur coreutils-9.6.orig/configure coreutils-9.6/configure | mmix ) gl_cv_host_cpu_c_abi_32bit=no ;; -@@ -23014,7 +23020,7 @@ +@@ -24685,7 +24691,7 @@ else case e in #( case "$gl_cv_host_cpu_c_abi" in - i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | loongarch32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) gl_cv_host_cpu_c_abi_32bit=yes ;; -- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) -+ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) +- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | loongarch64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) ++ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | loongarch64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) gl_cv_host_cpu_c_abi_32bit=no ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; -diff -ur coreutils-9.6.orig/lib/uname.c coreutils-9.6/lib/uname.c ---- coreutils-9.6.orig/lib/uname.c 2024-09-02 09:08:54.765546730 +0800 -+++ coreutils-9.6/lib/uname.c 2024-09-02 09:13:34.891877792 +0800 -@@ -228,6 +228,10 @@ +diff --git a/lib/uname.c b/lib/uname.c +index c80a1fe..d142f16 100644 +--- a/lib/uname.c ++++ b/lib/uname.c +@@ -228,6 +228,10 @@ uname (struct utsname *buf) case PROCESSOR_ARCHITECTURE_MIPS: strcpy (buf->machine, "mips"); break; @@ -75,10 +79,11 @@ diff -ur coreutils-9.6.orig/lib/uname.c coreutils-9.6/lib/uname.c case PROCESSOR_ARCHITECTURE_ALPHA: case PROCESSOR_ARCHITECTURE_ALPHA64: strcpy (buf->machine, "alpha"); -diff -ur coreutils-9.6.orig/m4/fpieee.m4 coreutils-9.6/m4/fpieee.m4 ---- coreutils-9.6.orig/m4/fpieee.m4 2024-09-02 09:08:54.055538287 +0800 -+++ coreutils-9.6/m4/fpieee.m4 2024-09-02 09:14:22.824447773 +0800 -@@ -30,6 +30,12 @@ +diff --git a/m4/fpieee.m4 b/m4/fpieee.m4 +index ccece00..b03f9bc 100644 +--- a/m4/fpieee.m4 ++++ b/m4/fpieee.m4 +@@ -32,6 +32,12 @@ AC_DEFUN([gl_FP_IEEE], # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 # and the GCC 4.1.2 manual). case "$host_cpu" in @@ -91,23 +96,24 @@ diff -ur coreutils-9.6.orig/m4/fpieee.m4 coreutils-9.6/m4/fpieee.m4 alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at -diff -ur coreutils-9.6.orig/m4/host-cpu-c-abi.m4 coreutils-9.6/m4/host-cpu-c-abi.m4 ---- coreutils-9.6.orig/m4/host-cpu-c-abi.m4 2024-09-02 09:08:54.075538525 +0800 -+++ coreutils-9.6/m4/host-cpu-c-abi.m4 2024-09-02 09:16:15.858791895 +0800 -@@ -91,6 +91,12 @@ +diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 +index f97ba73..6148418 100644 +--- a/m4/host-cpu-c-abi.m4 ++++ b/m4/host-cpu-c-abi.m4 +@@ -92,6 +92,12 @@ changequote([,])dnl + [gl_cv_host_cpu_c_abi=i386]) ;; - changequote(,)dnl ++changequote(,)dnl + sw_64* ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=sw_64 + ;; + -+changequote(,)dnl + changequote(,)dnl alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) changequote([,])dnl - gl_cv_host_cpu_c_abi=alpha -@@ -355,6 +361,9 @@ +@@ -357,6 +363,9 @@ EOF #ifndef __x86_64__ #undef __x86_64__ #endif @@ -117,7 +123,7 @@ diff -ur coreutils-9.6.orig/m4/host-cpu-c-abi.m4 coreutils-9.6/m4/host-cpu-c-abi #ifndef __alpha__ #undef __alpha__ #endif -@@ -491,7 +500,7 @@ +@@ -496,7 +505,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT], # CPUs that only support a 64-bit ABI. changequote(,)dnl @@ -126,19 +132,20 @@ diff -ur coreutils-9.6.orig/m4/host-cpu-c-abi.m4 coreutils-9.6/m4/host-cpu-c-abi | mmix ) changequote([,])dnl gl_cv_host_cpu_c_abi_32bit=no -@@ -503,7 +512,7 @@ +@@ -508,7 +517,7 @@ changequote([,])dnl case "$gl_cv_host_cpu_c_abi" in - i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | loongarch32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) gl_cv_host_cpu_c_abi_32bit=yes ;; -- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) -+ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) +- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | loongarch64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) ++ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | loongarch64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) gl_cv_host_cpu_c_abi_32bit=no ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; -diff -ur coreutils-9.6.orig/src/longlong.h coreutils-9.6/src/longlong.h ---- coreutils-9.6.orig/src/longlong.h 2024-09-02 09:08:53.933536836 +0800 -+++ coreutils-9.6/src/longlong.h 2024-09-02 09:17:29.550668195 +0800 -@@ -170,6 +170,92 @@ +diff --git a/src/longlong.h b/src/longlong.h +index d851811..c6d9f89 100644 +--- a/src/longlong.h ++++ b/src/longlong.h +@@ -170,6 +170,92 @@ along with this file. If not, see https://www.gnu.org/licenses/. */ don't need to be under !NO_ASM */ #if ! defined (NO_ASM) diff --git a/coreutils-9.6.tar.xz b/coreutils-9.7.tar.xz similarity index 32% rename from coreutils-9.6.tar.xz rename to coreutils-9.7.tar.xz index 0d191ea..a74bfd7 100644 --- a/coreutils-9.6.tar.xz +++ b/coreutils-9.7.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7a0124327b398fd9eb1a6abde583389821422c744ffa10734b24f557610d3283 -size 6134764 +oid sha256:e8bb26ad0293f9b5a1fc43fb42ba970e312c66ce92c1b0b16713d7500db251bf +size 6158960 diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index e7699c1..38b871c 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -1,4 +1,4 @@ -From a153c65067f6c09cf2cf38dc7c149aa1521c615a Mon Sep 17 00:00:00 2001 +From 3d25791ec9cc357a34620516d1c024ef17a4dd75 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Wed, 30 Aug 2023 17:19:58 +0200 Subject: [PATCH] coreutils-i18n.patch @@ -8,11 +8,11 @@ Subject: [PATCH] coreutils-i18n.patch configure.ac | 6 + lib/linebuffer.h | 8 + lib/mbchar.c | 23 ++ - lib/mbchar.h | 373 +++++++++++++++++ + lib/mbchar.h | 383 +++++++++++++++++ lib/mbfile.c | 20 + - lib/mbfile.h | 267 ++++++++++++ - m4/mbchar.m4 | 13 + - m4/mbfile.m4 | 14 + + lib/mbfile.h | 283 +++++++++++++ + m4/mbchar.m4 | 15 + + m4/mbfile.m4 | 16 + src/cut.c | 508 +++++++++++++++++++++-- src/expand-common.c | 114 ++++++ src/expand-common.h | 12 + @@ -20,21 +20,21 @@ Subject: [PATCH] coreutils-i18n.patch src/fold.c | 311 ++++++++++++-- src/local.mk | 4 +- src/pr.c | 443 ++++++++++++++++++-- - src/sort.c | 792 +++++++++++++++++++++++++++++++++--- + src/sort.c | 790 +++++++++++++++++++++++++++++++++--- src/unexpand.c | 101 ++++- 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 | 51 ++- + tests/misc/fold.pl | 50 ++- tests/misc/sort-mb-tests.sh | 45 ++ tests/misc/unexpand.pl | 39 ++ tests/pr/pr-tests.pl | 49 +++ tests/sort/sort-merge.pl | 42 ++ tests/sort/sort.pl | 40 +- tests/unexpand/mb.sh | 172 ++++++++ - 30 files changed, 3603 insertions(+), 197 deletions(-) + 30 files changed, 3632 insertions(+), 195 deletions(-) create mode 100644 lib/mbchar.c create mode 100644 lib/mbchar.h create mode 100644 lib/mbfile.c @@ -47,10 +47,10 @@ Subject: [PATCH] coreutils-i18n.patch create mode 100644 tests/unexpand/mb.sh diff --git a/bootstrap.conf b/bootstrap.conf -index 380fa11..ca80e6f 100644 +index 94c164e..cecbf26 100644 --- a/bootstrap.conf +++ b/bootstrap.conf -@@ -165,6 +165,8 @@ gnulib_modules=" +@@ -166,6 +166,8 @@ gnulib_modules=" maintainer-makefile malloc-gnu manywarnings @@ -60,10 +60,10 @@ index 380fa11..ca80e6f 100644 mbrtoc32 mbrtowc diff --git a/configure.ac b/configure.ac -index bf6da2a..321016d 100644 +index 775c4cc..e6b5c9c 100644 --- a/configure.ac +++ b/configure.ac -@@ -505,6 +505,12 @@ fi +@@ -504,6 +504,12 @@ fi # I'm leaving it here for now. This whole thing needs to be modernized... gl_WINSIZE_IN_PTEM @@ -104,11 +104,11 @@ index ca56f80..509b7e6 100644 /* Initialize linebuffer LINEBUFFER for use. */ diff --git a/lib/mbchar.c b/lib/mbchar.c new file mode 100644 -index 0000000..d94b7c3 +index 0000000..713c2f7 --- /dev/null +++ b/lib/mbchar.c @@ -0,0 +1,23 @@ -+/* Copyright (C) 2001, 2006, 2009-2024 Free Software Foundation, Inc. ++/* Copyright (C) 2001, 2006, 2009-2025 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as @@ -133,12 +133,12 @@ index 0000000..d94b7c3 +#include "mbchar.h" diff --git a/lib/mbchar.h b/lib/mbchar.h new file mode 100644 -index 0000000..c06ef11 +index 0000000..d77168e --- /dev/null +++ b/lib/mbchar.h -@@ -0,0 +1,373 @@ +@@ -0,0 +1,383 @@ +/* Multibyte character data type. -+ Copyright (C) 2001, 2005-2007, 2009-2024 Free Software Foundation, Inc. ++ Copyright (C) 2001, 2005-2007, 2009-2025 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as @@ -296,6 +296,11 @@ index 0000000..c06ef11 +# define MBCHAR_INLINE _GL_INLINE +#endif + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ +/* The longest multibyte characters, nowadays, are 4 bytes long. + Regardless of the values of MB_CUR_MAX and MB_LEN_MAX. */ +#define MBCHAR_BUF_SIZE 4 @@ -507,17 +512,22 @@ index 0000000..c06ef11 + +#endif + ++ ++#ifdef __cplusplus ++} ++#endif ++ +_GL_INLINE_HEADER_END + +#endif /* _MBCHAR_H */ diff --git a/lib/mbfile.c b/lib/mbfile.c new file mode 100644 -index 0000000..8d2957b +index 0000000..f4e3e77 --- /dev/null +++ b/lib/mbfile.c @@ -0,0 +1,20 @@ +/* Multibyte character I/O: macros for multi-byte encodings. -+ Copyright (C) 2012-2023 Free Software Foundation, Inc. ++ Copyright (C) 2012-2025 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as @@ -538,12 +548,12 @@ index 0000000..8d2957b +#include "mbfile.h" diff --git a/lib/mbfile.h b/lib/mbfile.h new file mode 100644 -index 0000000..ad61c19 +index 0000000..c852f31 --- /dev/null +++ b/lib/mbfile.h -@@ -0,0 +1,267 @@ +@@ -0,0 +1,283 @@ +/* Multibyte character I/O: macros for multi-byte encodings. -+ Copyright (C) 2001, 2005, 2009-2023 Free Software Foundation, Inc. ++ Copyright (C) 2001, 2005, 2009-2025 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as @@ -598,6 +608,7 @@ index 0000000..ad61c19 + +#include +#include ++#include +#include +#include + @@ -608,14 +619,22 @@ index 0000000..ad61c19 +# define MBFILE_INLINE _GL_INLINE +#endif + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++/* Guarantee two characters of pushback. */ ++#define MBFILE_MAX_PUSHBACK 2 ++ +struct mbfile_multi { + FILE *fp; + bool eof_seen; -+ bool have_pushback; ++ unsigned int pushback_count; /* <= MBFILE_MAX_PUSHBACK */ + mbstate_t state; + unsigned int bufcount; + char buf[MBCHAR_BUF_SIZE]; -+ struct mbchar pushback; ++ struct mbchar pushback[MBFILE_MAX_PUSHBACK]; +}; + +MBFILE_INLINE void @@ -624,19 +643,19 @@ index 0000000..ad61c19 + unsigned int new_bufcount; + size_t bytes; + -+ /* If EOF has already been seen, don't use getc. This matters if -+ mbf->fp is connected to an interactive tty. */ -+ if (mbf->eof_seen) -+ goto eof; -+ + /* Return character pushed back, if there is one. */ -+ if (mbf->have_pushback) ++ if (mbf->pushback_count > 0) + { -+ mb_copy (mbc, &mbf->pushback); -+ mbf->have_pushback = false; ++ mb_copy (mbc, &mbf->pushback[mbf->pushback_count - 1]); ++ mbf->pushback_count--; + return; + } + ++ /* If EOF has already been seen, don't use getc. This matters if ++ mbf->fp is connected to an interactive tty. */ ++ if (mbf->eof_seen) ++ goto eof; ++ + new_bufcount = mbf->bufcount; + + /* If mbf->state is not in an initial state, some more 32-bit wide character @@ -785,8 +804,10 @@ index 0000000..ad61c19 +MBFILE_INLINE void +mbfile_multi_ungetc (const struct mbchar *mbc, struct mbfile_multi *mbf) +{ -+ mb_copy (&mbf->pushback, mbc); -+ mbf->have_pushback = true; ++ if (mbf->pushback_count == MBFILE_MAX_PUSHBACK) ++ abort (); ++ mb_copy (&mbf->pushback[mbf->pushback_count], mbc); ++ mbf->pushback_count++; +} + +typedef struct mbfile_multi mb_file_t; @@ -796,7 +817,7 @@ index 0000000..ad61c19 +#define mbf_init(mbf, stream) \ + ((mbf).fp = (stream), \ + (mbf).eof_seen = false, \ -+ (mbf).have_pushback = false, \ ++ (mbf).pushback_count = 0, \ + mbszero (&(mbf).state), \ + (mbf).bufcount = 0) + @@ -806,20 +827,27 @@ index 0000000..ad61c19 + +#define mb_iseof(mbc) ((mbc).bytes == 0) + ++ ++#ifdef __cplusplus ++} ++#endif ++ +_GL_INLINE_HEADER_END + +#endif /* _MBFILE_H */ diff --git a/m4/mbchar.m4 b/m4/mbchar.m4 new file mode 100644 -index 0000000..471e8c4 +index 0000000..b76f1d7 --- /dev/null +++ b/m4/mbchar.m4 -@@ -0,0 +1,13 @@ -+# mbchar.m4 serial 9 -+dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc. +@@ -0,0 +1,15 @@ ++# mbchar.m4 ++# serial 9 ++dnl Copyright (C) 2005-2007, 2009-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. ++dnl This file is offered as-is, without any warranty. + +dnl autoconf tests required for use of mbchar.m4 +dnl From Bruno Haible. @@ -830,15 +858,17 @@ index 0000000..471e8c4 +]) diff --git a/m4/mbfile.m4 b/m4/mbfile.m4 new file mode 100644 -index 0000000..83068a9 +index 0000000..1d126e0 --- /dev/null +++ b/m4/mbfile.m4 -@@ -0,0 +1,14 @@ -+# mbfile.m4 serial 7 -+dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc. +@@ -0,0 +1,16 @@ ++# mbfile.m4 ++# serial 7 ++dnl Copyright (C) 2005, 2008-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. ++dnl This file is offered as-is, without any warranty. + +dnl autoconf tests required for use of mbfile.h +dnl From Bruno Haible. @@ -1509,7 +1539,7 @@ index b424997..c9f181c 100644 if (have_read_stdin && fclose (stdin) == EOF) diff --git a/src/expand-common.c b/src/expand-common.c -index 2dbbbe4..91a90a3 100644 +index 732123f..fdbef3f 100644 --- a/src/expand-common.c +++ b/src/expand-common.c @@ -19,6 +19,7 @@ @@ -3008,7 +3038,7 @@ index e7081a0..19e0268 100644 looking for more options and printing the next batch of files. diff --git a/src/sort.c b/src/sort.c -index 0928fd5..8c43fd4 100644 +index b10183b..fbf325b 100644 --- a/src/sort.c +++ b/src/sort.c @@ -29,6 +29,14 @@ @@ -3084,7 +3114,7 @@ index 0928fd5..8c43fd4 100644 /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -807,6 +838,46 @@ reap_all (void) +@@ -806,6 +837,46 @@ reap_all (void) reap (-1); } @@ -3131,7 +3161,7 @@ index 0928fd5..8c43fd4 100644 /* Clean up any remaining temporary files. */ static void -@@ -1274,7 +1345,7 @@ zaptemp (char const *name) +@@ -1273,7 +1344,7 @@ zaptemp (char const *name) free (node); } @@ -3140,7 +3170,7 @@ index 0928fd5..8c43fd4 100644 static int struct_month_cmp (void const *m1, void const *m2) -@@ -1289,7 +1360,7 @@ struct_month_cmp (void const *m1, void const *m2) +@@ -1288,7 +1359,7 @@ struct_month_cmp (void const *m1, void const *m2) /* Initialize the character class tables. */ static void @@ -3149,7 +3179,7 @@ index 0928fd5..8c43fd4 100644 { size_t i; -@@ -1301,7 +1372,7 @@ inittables (void) +@@ -1300,7 +1371,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -3158,7 +3188,7 @@ index 0928fd5..8c43fd4 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) +@@ -1380,6 +1451,84 @@ specify_nmerge (int oi, char c, char const *s) xstrtol_fatal (e, oi, c, long_options, s); } @@ -3243,7 +3273,7 @@ index 0928fd5..8c43fd4 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) +@@ -1611,7 +1760,7 @@ buffer_linelim (struct buffer const *buf) by KEY in LINE. */ static char * @@ -3252,7 +3282,7 @@ index 0928fd5..8c43fd4 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) +@@ -1620,10 +1769,10 @@ begfield (struct line const *line, struct keyfield const *key) /* The leading field separator itself is included in a field when -t is absent. */ @@ -3265,7 +3295,7 @@ index 0928fd5..8c43fd4 100644 ++ptr; if (ptr < lim) ++ptr; -@@ -1650,12 +1799,71 @@ begfield (struct line const *line, struct keyfield const *key) +@@ -1649,12 +1798,71 @@ begfield (struct line const *line, struct keyfield const *key) return ptr; } @@ -3338,7 +3368,7 @@ index 0928fd5..8c43fd4 100644 { 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) +@@ -1669,10 +1877,10 @@ limfield (struct line const *line, struct keyfield const *key) 'beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first 'blank' character after the preceding field. */ @@ -3351,7 +3381,7 @@ index 0928fd5..8c43fd4 100644 ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1719,10 +1927,10 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1718,10 +1926,10 @@ limfield (struct line const *line, struct keyfield const *key) */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -3364,7 +3394,7 @@ index 0928fd5..8c43fd4 100644 if (newlim) lim = newlim; } -@@ -1753,6 +1961,130 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1752,6 +1960,130 @@ limfield (struct line const *line, struct keyfield const *key) return ptr; } @@ -3495,7 +3525,7 @@ index 0928fd5..8c43fd4 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) +@@ -1838,8 +2170,22 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file) else { if (key->skipsblanks) @@ -3520,7 +3550,7 @@ index 0928fd5..8c43fd4 100644 line->keybeg = line_start; } } -@@ -1978,12 +2324,10 @@ find_unit_order (char const *number) +@@ -1977,12 +2323,10 @@ find_unit_order (char const *number) ATTRIBUTE_PURE static int @@ -3536,7 +3566,7 @@ index 0928fd5..8c43fd4 100644 int diff = find_unit_order (a) - find_unit_order (b); return (diff ? diff : strnumcmp (a, b, decimal_point, thousands_sep)); -@@ -1995,7 +2339,7 @@ human_numcompare (char const *a, char const *b) +@@ -1994,7 +2338,7 @@ human_numcompare (char const *a, char const *b) ATTRIBUTE_PURE static int @@ -3545,7 +3575,7 @@ index 0928fd5..8c43fd4 100644 { while (blanks[to_uchar (*a)]) a++; -@@ -2005,6 +2349,25 @@ numcompare (char const *a, char const *b) +@@ -2004,6 +2348,25 @@ numcompare (char const *a, char const *b) return strnumcmp (a, b, decimal_point, thousands_sep); } @@ -3571,7 +3601,7 @@ index 0928fd5..8c43fd4 100644 static int nan_compare (long double a, long double b) { -@@ -2046,7 +2409,7 @@ general_numcompare (char const *sa, char const *sb) +@@ -2045,7 +2408,7 @@ general_numcompare (char const *sa, char const *sb) Return 0 if the name in S is not recognized. */ static int @@ -3580,7 +3610,7 @@ index 0928fd5..8c43fd4 100644 { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2385,15 +2748,14 @@ debug_key (struct line const *line, struct keyfield const *key) +@@ -2384,15 +2747,14 @@ debug_key (struct line const *line, struct keyfield const *key) char saved = *lim; *lim = '\0'; @@ -3598,7 +3628,7 @@ index 0928fd5..8c43fd4 100644 else if (key->general_numeric) ignore_value (strtold (beg, &tighter_lim)); else if (key->numeric || key->human_numeric) -@@ -2539,7 +2901,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2538,7 +2900,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) /* 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 */ @@ -3607,7 +3637,7 @@ index 0928fd5..8c43fd4 100644 && ((!key->skipsblanks && !implicit_skip) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2587,9 +2949,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2586,9 +2948,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) bool number_locale_warned = false; if (basic_numeric_field_span) { @@ -3620,7 +3650,7 @@ index 0928fd5..8c43fd4 100644 { error (0, 0, _("field separator %s is treated as a " -@@ -2600,9 +2962,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2599,9 +2961,9 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) } if (basic_numeric_field_span || general_numeric_field_span) { @@ -3633,7 +3663,7 @@ index 0928fd5..8c43fd4 100644 { error (0, 0, _("field separator %s is treated as a " -@@ -2610,19 +2972,19 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2609,19 +2971,19 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) quote (((char []) {decimal_point, 0}))); number_locale_warned = true; } @@ -3657,16 +3687,7 @@ index 0928fd5..8c43fd4 100644 } } -@@ -2633,7 +2995,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}))); - - } -@@ -2675,11 +3037,87 @@ diff_reversed (int diff, bool reversed) +@@ -2673,11 +3035,87 @@ diff_reversed (int diff, bool reversed) return reversed ? (diff < 0) - (diff > 0) : diff; } @@ -3755,7 +3776,7 @@ index 0928fd5..8c43fd4 100644 { struct keyfield *key = keylist; -@@ -2760,7 +3198,7 @@ keycompare (struct line const *a, struct line const *b) +@@ -2758,7 +3196,7 @@ keycompare (struct line const *a, struct line const *b) else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -3764,7 +3785,7 @@ index 0928fd5..8c43fd4 100644 else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2870,6 +3308,211 @@ keycompare (struct line const *a, struct line const *b) +@@ -2868,6 +3306,211 @@ keycompare (struct line const *a, struct line const *b) return diff_reversed (diff, key->reverse); } @@ -3976,7 +3997,7 @@ index 0928fd5..8c43fd4 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. */ -@@ -2897,7 +3540,7 @@ compare (struct line const *a, struct line const *b) +@@ -2895,7 +3538,7 @@ compare (struct line const *a, struct line const *b) diff = - NONZERO (blen); else if (blen == 0) diff = 1; @@ -3985,7 +4006,7 @@ index 0928fd5..8c43fd4 100644 { /* xmemcoll0 is a performance enhancement as it will not unconditionally write '\0' after the -@@ -4285,6 +4928,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype) +@@ -4283,6 +4926,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype) break; case 'f': key->translate = fold_toupper; @@ -3993,7 +4014,7 @@ index 0928fd5..8c43fd4 100644 break; case 'g': key->general_numeric = true; -@@ -4364,7 +5008,7 @@ main (int argc, char **argv) +@@ -4362,7 +5006,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -4002,7 +4023,7 @@ index 0928fd5..8c43fd4 100644 hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4387,6 +5031,29 @@ main (int argc, char **argv) +@@ -4385,6 +5029,29 @@ main (int argc, char **argv) thousands_sep = NON_CHAR; } @@ -4032,7 +4053,7 @@ index 0928fd5..8c43fd4 100644 have_read_stdin = false; inittables (); -@@ -4657,13 +5324,34 @@ main (int argc, char **argv) +@@ -4655,13 +5322,34 @@ main (int argc, char **argv) case 't': { @@ -4071,7 +4092,7 @@ index 0928fd5..8c43fd4 100644 else { /* Provoke with 'sort -txx'. Complain about -@@ -4674,9 +5362,11 @@ main (int argc, char **argv) +@@ -4672,9 +5360,11 @@ main (int argc, char **argv) quote (optarg)); } } @@ -4528,7 +4549,7 @@ index 0000000..26c95de + +Exit $fail diff --git a/tests/local.mk b/tests/local.mk -index 12e30b4..1529db6 100644 +index 4da6756..fcbeef8 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -390,6 +390,8 @@ all_tests = \ @@ -4540,7 +4561,7 @@ index 12e30b4..1529db6 100644 tests/sort/sort-h-thousands-sep.sh \ tests/sort/sort-merge.pl \ tests/sort/sort-merge-fdlimit.sh \ -@@ -593,6 +595,7 @@ all_tests = \ +@@ -594,6 +596,7 @@ all_tests = \ tests/du/threshold.sh \ tests/du/trailing-slash.sh \ tests/du/two-args.sh \ @@ -4548,7 +4569,7 @@ index 12e30b4..1529db6 100644 tests/id/gnu-zero-uids.sh \ tests/id/no-context.sh \ tests/id/context.sh \ -@@ -749,6 +752,7 @@ all_tests = \ +@@ -750,6 +753,7 @@ all_tests = \ tests/touch/read-only.sh \ tests/touch/relative.sh \ tests/touch/trailing-slash.sh \ @@ -4624,7 +4645,7 @@ index 4b07210..68b9ea1 100755 my $verbose = $ENV{VERBOSE}; diff --git a/tests/misc/fold.pl b/tests/misc/fold.pl -index 0981ec9..ba889c8 100755 +index 877322e..ba889c8 100755 --- a/tests/misc/fold.pl +++ b/tests/misc/fold.pl @@ -20,9 +20,17 @@ use strict; @@ -4646,7 +4667,7 @@ index 0981ec9..ba889c8 100755 my @Tests = ( -@@ -44,9 +52,48 @@ my @Tests = +@@ -44,6 +52,46 @@ my @Tests = {OUT=>"123456\n7890\nabcdef\nghij\n123456\n7890"}], ); @@ -4693,9 +4714,6 @@ index 0981ec9..ba889c8 100755 my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; --my $prog = 'fold'; - my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); - exit $fail; diff --git a/tests/misc/sort-mb-tests.sh b/tests/misc/sort-mb-tests.sh new file mode 100644 index 0000000..11836ba @@ -5180,5 +5198,5 @@ index 0000000..8a82d74 +LC_ALL=C unexpand in in > out || fail=1 +compare exp out > /dev/null 2>&1 || fail=1 -- -2.48.1 +2.49.0 diff --git a/coreutils.spec b/coreutils.spec index 599f619..fb73762 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils -Version: 9.6 -Release: 4 +Version: 9.7 +Release: 1 License: GPL-3.0-or-later Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -21,11 +21,8 @@ Patch7: coreutils-i18n.patch Patch8: test-skip-overlay-filesystem-because-of-no-inotify_add_watch.patch # Upstream patches -Patch6001: backport-ls-fix-crash-with-context.patch -Patch6002: backport-who-m-systemd.patch -Patch6003: backport-cat-fix-plain-cat-bug.patch -Patch9001: coreutils-9.6-sw.patch +Patch9001: coreutils-9.7-sw.patch Conflicts: filesystem < 3 @@ -79,10 +76,6 @@ sed -i 's/0.19.2/0.22.5/' bootstrap.conf configure.ac %build autoreconf -fi -%ifarch sw_64 -/usr/bin/cp -fv /usr/lib/rpm/%{_vendor}/config.guess build-aux/ -/usr/bin/cp -fv /usr/lib/rpm/%{_vendor}/config.sub build-aux/ -%endif if [ %user = root ]; then export FORCE_UNSAFE_CONFIGURE=1 @@ -158,6 +151,9 @@ popd %{_mandir}/man*/* %changelog +* Thu Apr 10 2025 Funda Wang - 9.7-1 +- update to 9.7 + * Mon Mar 24 2025 mahailiang - 9.6-4 - modify cp to /usr/bin/cp -- Gitee