[packages/coreutils] Updated to 9.12
arekm
arekm at pld-linux.org
Tue Sep 15 00:25:16 CEST 2026
commit 1e6f9d27e763ce2e47b9a078486e98f2791c5757
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Sep 15 00:18:41 2026 +0200
Updated to 9.12
- advcopy taken from upstream advcpmv-0.9-9.11
- getgid: reject unknown options like other tools
- fmt: keep upstream read error handling
- built --with-systemd, with a sd_booted() guard
- update other patches
coreutils-advcopy.patch | 644 +++++++++++++++++--------------------
coreutils-fmt-wchars.patch | 50 ++-
coreutils-getgid.patch | 123 +++++--
coreutils-info.patch | 34 +-
coreutils-pld-os-name.patch | 13 +
coreutils-readutmp-sd-booted.patch | 74 +++++
coreutils-sparc64.patch | 12 -
coreutils-uname-cpuinfo.patch | 6 +-
coreutils.spec | 62 ++--
tests.patch | 129 +++++++-
10 files changed, 696 insertions(+), 451 deletions(-)
---
diff --git a/coreutils.spec b/coreutils.spec
index 74eaad8..14289e7 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -2,18 +2,20 @@
# Conditional build:
%bcond_with advcopy # progress bar in cp (orphaned patch)
%bcond_with multicall # Compile all the tools in a single binary
+%bcond_without systemd # take login records from systemd-logind
%bcond_with tests # unit tests running
+%bcond_with wtmpdb # don't read login records from the wtmpdb database
%bcond_without y2038 # Y2038 support for 32-bit archs
Summary: GNU Core-utils - basic command line utilities
Summary(pl.UTF-8): GNU Core-utils - podstawowe narzędzia działające z linii poleceń
Name: coreutils
-Version: 9.11
+Version: 9.12
Release: 1
License: GPL v3+
Group: Applications/System
Source0: https://ftp.gnu.org/gnu/coreutils/%{name}-%{version}.tar.xz
-# Source0-md5: e52e9857e4aa9ae38ef32f8ed6a27604
+# Source0-md5: d7451ac748c319e6e1bc30e9ec63956c
Source1: %{name}-non-english-man-pages.tar.bz2
# Source1-md5: f7c986ebc74ccb8d08ed70141063f14c
Source2: DIR_COLORS
@@ -28,10 +30,11 @@ Patch2: %{name}-uname-cpuinfo.patch
Patch3: %{name}-date-man.patch
Patch6: %{name}-fmt-wchars.patch
-Patch7: %{name}-sparc64.patch
# https://github.com/jarun/advcpmv
Patch9: %{name}-advcopy.patch
Patch10: tests.patch
+Patch11: %{name}-readutmp-sd-booted.patch
+Patch12: %{name}-pld-os-name.patch
URL: http://www.gnu.org/software/coreutils/
BuildRequires: acl-devel
BuildRequires: attr-devel
@@ -40,14 +43,21 @@ BuildRequires: automake >= 1:1.11.2
BuildRequires: gcc >= 5:3.2
BuildRequires: gettext-tools >= 0.19.2
BuildRequires: gmp-devel
-BuildRequires: help2man
BuildRequires: libcap-devel
BuildRequires: libselinux-devel
+BuildRequires: openssl-devel
BuildRequires: perl-base
+BuildRequires: perl-modules
BuildRequires: rpmbuild(find_lang) >= 1.24
BuildRequires: smack-devel
+%if %{with systemd}
+BuildRequires: systemd-devel >= 1:254
+%endif
BuildRequires: tar >= 1:1.22
BuildRequires: texinfo >= 4.2
+%if %{with wtmpdb}
+BuildRequires: wtmpdb-devel
+%endif
BuildRequires: xz
%if %{with tests}
BuildRequires: strace
@@ -113,51 +123,19 @@ Programy zawarte w tym pakiecie to:
%patch -P3 -p1
%patch -P6 -p1
-%ifarch sparc64
-%patch -P7 -p1
-%endif
%if %{with advcopy}
# progress-bar patch, -g,--progress-bar //if in doubt, comment it out
%patch -P9 -p1
%endif
%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p1
%{__mv} man/pt_BR man/pt
-%{__perl} -pi -e 's at GNU/Linux at PLD Linux@' m4/host-os.m4
-
# allow rebuilding *.gmo
%{__rm} po/stamp-po
-# 8-bit-pfx test fails under C locale:
-# LC_ALL=C echo -e "ça\nçb\n"|LC_ALL=C fmt -p 'ç'
-# fmt: memory exhausted
-%{__sed} -i -e 25,27d tests/fmt/base.pl
-
-# /etc/resolv.conf is blocked in pld builders, try some other file
-%{__sed} -i -e 's,/etc/resolv.conf,/etc/hosts,' gnulib-tests/test-read-file.c
-
-# getgid needs to be fixed:
-# getgid: missing operand
-# Try `getgid --help' for more information.
-%{__rm} tests/help/help-version.sh
-%{__sed} -i -e '/help\/help-version/d' tests/local.mk
-
-# fails on some filesystems (like XFS), where readdir returns d_type=DT_UNKNOWN
-%{__rm} tests/ls/stat-free-color.sh
-%{__sed} -i -e '/ls\/stat-free-color/d' tests/local.mk
-
-# filesystem layout dependant (fails on some xfs fs)
-%{__rm} tests/dd/sparse.sh
-%{__sed} -i -e '/dd\/sparse/d' tests/local.mk
-
-# mksh is too smart for those, won't let programs fail on ulimit
-# would need bash here
-%{__rm} tests/sort/sort-merge-fdlimit.sh
-%{__sed} -i -e '/sort\/sort-merge-fdlimit/d' tests/local.mk
-%{__rm} tests/split/r-chunk.sh
-%{__sed} -i -e '/split\/r-chunk/d' tests/local.mk
-
%build
build-aux/gen-lists-of-programs.sh --autoconf > m4/cu-progs.m4
build-aux/gen-lists-of-programs.sh --automake > src/cu-progs.mk
@@ -167,17 +145,21 @@ build-aux/gen-lists-of-programs.sh --automake > src/cu-progs.mk
%{__autoheader}
%{__automake}
%configure \
- CFLAGS="%{rpmcflags} -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT" \
%{?with_multicall:--enable-single-binary=symlinks} \
--disable-silent-rules \
--enable-install-program=arch \
--enable-no-install-program=hostname,kill,uptime \
+ --with-openssl \
+ %{?with_systemd:--with-systemd} \
+ %{?with_wtmpdb:--with-wtmpdb} \
%{!?with_y2038:--disable-year2038}
%{__make} -j1
+# bison emits #line directives without the lib/ prefix, so debugsource misses these
+%{__ln} lib/parse-datetime.c lib/parse-datetime.y .
+
%if %{with tests}
-sed -i -e 's#COLUMNS##g' tests/envvar-check
LC_ALL=C LANG=C %{__make} -j1 tests check
%endif
diff --git a/coreutils-advcopy.patch b/coreutils-advcopy.patch
index 479a705..7c730c8 100644
--- a/coreutils-advcopy.patch
+++ b/coreutils-advcopy.patch
@@ -1,18 +1,37 @@
-diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
---- coreutils-9.7/src/copy.c 2025-02-20 09:56:20.000000000 -0300
-+++ coreutils-9.7k/src/copy.c 2026-01-17 13:17:40.208485733 -0300
-@@ -113,6 +113,133 @@
- dev_t dev;
- };
+--- coreutils-9.11/src/copy-file-data.c 2026-07-23 09:47:29.805900811 -0600
++++ coreutils-9.11k/src/copy-file-data.c 2026-07-23 09:47:29.837329370 -0600
+@@ -28,6 +28,153 @@
+ #include "full-write.h"
+ #include "ioblksize.h"
++#include <sys/ioctl.h>
++#include <termios.h>
++
+/* BEGIN progress mod */
-+struct progress_status {
-+ int iCountDown;
-+ char ** cProgressField;
-+ struct timeval last_time;
-+ int last_size, iBarLength;
-+ struct stat src_open_sb;
-+};
++
++/* The progress globals (g_iTotalSize, g_iTotalWritten, ...) count KiB, not
++ bytes, because the prescan in cp.c/mv.c derives totals from "du -s" which
++ reports KiB blocks. Divide a raw byte count by this before accumulating. */
++#define PROGRESS_BYTES_PER_KIB 1024
++
++/* Each progress row is iBarLength chars wide. The right-aligned size readout
++ produced by file_size_format ("542.3 MiB") is written starting this many
++ columns from the end of the row so it sits just left of the bar tail. */
++#define PROGRESS_SIZE_COL 21
++
++struct progress_status {
++ int iCountDown;
++ char ** cProgressField;
++ struct timeval last_time;
++ int last_size, iBarLength;
++ struct stat src_open_sb;
++};
++
++/* Progress state for the file currently being copied. Set up in
++ copy_file_data (which has the cp_options and source size) and read by
++ sparse_copy/lseek_copy while they run. Only touched when the global
++ progress flag is set. */
++static struct progress_status g_s_progress;
+
+FILE * spawn( const char *cmd, char *const argv[] )
+{
@@ -53,11 +72,11 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+
+void format_time ( char * _cDest, double seconds, bool showall )
+{
-+ // hours
++ /* hours */
+ int hr = ( (int) seconds / (60 * 60)) % 24;
-+ // minutes
++ /* minutes */
+ int min = ( (int) seconds / 60) % 60;
-+ // seconds
++ /* seconds */
+ double sec = seconds - (hr * (60 * 60)) - (min * 60);
+ if ( showall )
+ {
@@ -77,28 +96,28 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ }
+}
+
-+static void file_progress_bar ( char * _cDest, int _iBarLength, long _lProgress, long _lTotal )
-+{
-+ double dPercent = (double) _lProgress / (double) _lTotal * 100.f;
++static void file_progress_bar ( char * _cDest, int _iBarLength, long _lProgress, long _lTotal )
++{
++ double dPercent = (double) _lProgress / (double) _lTotal * 100.f;
+ sprintf( _cDest + ( _iBarLength - 6), "%4.1f", dPercent );
-+ _cDest[_iBarLength - 2] = ' ';
++ _cDest[_iBarLength - 2] = ' ';
+
-+ int i;
-+ for ( i=1; i<=_iBarLength - 9; i++)
-+ {
++ int i;
++ for ( i=1; i<=_iBarLength - 9; i++)
++ {
+ if ( dPercent > (double) (i-1) / (_iBarLength - 10) * 100.f )
+ {
-+ _cDest[i] = '=';
++ _cDest[i] = '=';
+ }
-+ else
++ else
+ {
-+ _cDest[i] = ' ';
++ _cDest[i] = ' ';
+ }
+ }
-+ for ( i=1; i<_iBarLength - 9; i++)
-+ {
++ for ( i=1; i<_iBarLength - 9; i++)
++ {
+ if ( ( _cDest[i+1] == ' ' ) && ( _cDest[i] == '=' ) )
-+ _cDest[i] = '>' ;
++ _cDest[i] = '>' ;
+ }
+}
+
@@ -132,36 +151,27 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+}
+/* END progress mod */
+
- /* Initial size of the cp.dest_info hash table. */
- #define DEST_INFO_INITIAL_CAPACITY 61
-
-@@ -317,14 +444,23 @@
- bytes read. */
- static bool
- sparse_copy (int src_fd, int dest_fd, char **abuf, size_t buf_size,
-- size_t hole_size, bool punch_holes, bool allow_reflink,
-+ size_t hole_size, bool punch_holes, bool allow_reflink, bool move_mode,
- char const *src_name, char const *dst_name,
- uintmax_t max_n_read, off_t *total_n_read,
-- bool *last_write_made_hole)
-+ bool *last_write_made_hole,
-+ struct progress_status *s_progress)
+ /* Result of infer_scantype when it returns LSEEK_SCANTYPE. */
+ struct scan_inference
+ {
+@@ -117,6 +264,16 @@
{
- *last_write_made_hole = false;
- *total_n_read = 0;
+ count_t total_n_read = 0;
+ /* BEGIN progress mod */
-+ gettimeofday ( & g_oFStartTime, NULL );
-+ g_iFTotalWritten = 0;
-+ struct stat st;
-+ stat(src_name, &st);
-+ g_iFTotalSize = st.st_size/1024;
++ if (progress) {
++ gettimeofday ( & g_oFStartTime, NULL );
++ g_iFTotalWritten = 0;
++ struct stat st;
++ stat(src_name, &st);
++ g_iFTotalSize = st.st_size / PROGRESS_BYTES_PER_KIB;
++ }
+ /* END progress mod */
+
- if (copy_debug.sparse_detection == COPY_DEBUG_UNKNOWN)
- copy_debug.sparse_detection = hole_size ? COPY_DEBUG_YES : COPY_DEBUG_NO;
- else if (hole_size && copy_debug.sparse_detection == COPY_DEBUG_EXTERNAL)
-@@ -339,6 +475,102 @@
+ if (debug->sparse_detection == COPY_DEBUG_UNKNOWN)
+ debug->sparse_detection = hole_size ? COPY_DEBUG_YES : COPY_DEBUG_NO;
+ else if (hole_size && debug->sparse_detection == COPY_DEBUG_EXTERNAL)
+@@ -131,6 +288,100 @@
(SSIZE_MAX, SIZE_MAX) truncated to a value that is
surely aligned well. */
ssize_t copy_max = MIN (SSIZE_MAX, SIZE_MAX) >> 30 << 30;
@@ -169,29 +179,29 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ /* BEGIN progress mod */
+ if (progress) {
+ /* update countdown */
-+ s_progress->iCountDown--;
-+ char * sProgressBar = s_progress->cProgressField[5];
-+ if ( s_progress->iCountDown < 0 )
-+ s_progress->iCountDown = 100;
++ g_s_progress.iCountDown--;
++ char * sProgressBar = g_s_progress.cProgressField[5];
++ if ( g_s_progress.iCountDown < 0 )
++ g_s_progress.iCountDown = 100;
+
+ /* just print one line with the percentage, but not always */
-+ if ( s_progress->iCountDown == 0 )
++ if ( g_s_progress.iCountDown == 0 )
+ {
+ /* calculate current speed */
+ struct timeval cur_time;
+ gettimeofday ( & cur_time, NULL );
-+ int cur_size = g_iTotalWritten + *total_n_read / 1024;
-+ int cur_fsize = g_iFTotalWritten + *total_n_read / 1024;
-+ int usec_elapsed = cur_time.tv_usec - s_progress->last_time.tv_usec;
++ int cur_size = g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB;
++ int cur_fsize = g_iFTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB;
++ int usec_elapsed = cur_time.tv_usec - g_s_progress.last_time.tv_usec;
+ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
-+ sec_elapsed += ( double ) ( cur_time.tv_sec - s_progress->last_time.tv_sec );
-+ int copy_speed = ( int ) ( ( double ) ( cur_size - s_progress->last_size )
++ sec_elapsed += ( double ) ( cur_time.tv_sec - g_s_progress.last_time.tv_sec );
++ int copy_speed = ( int ) ( ( double ) ( cur_size - g_s_progress.last_size )
+ / sec_elapsed );
-+ char s_copy_speed[20];
++ char s_copy_speed[PROGRESS_NUM_BUF];
+ file_size_format ( s_copy_speed, copy_speed >= 0 ? copy_speed : 0, 1 );
+ /* update vars */
-+ s_progress->last_time = cur_time;
-+ s_progress->last_size = cur_size;
++ g_s_progress.last_time = cur_time;
++ g_s_progress.last_size = cur_size;
+
+ /* how many time has passed since the start? */
+ int isec_elapsed = cur_time.tv_sec - g_oStartTime.tv_sec;
@@ -202,20 +212,18 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ * g_iFTotalSize ) - isec_felapsed;
+ /* print out */
+
-+ char f_ttime[20];
-+ char f_ftime[20];
++ char f_ttime[PROGRESS_NUM_BUF];
++ char f_ftime[PROGRESS_NUM_BUF];
+ format_time(f_ttime, sec_remaining, true);
+ format_time(f_ftime, sec_fremaining, true);
+
+ int fs_len;
-+ fs_len = sprintf ( s_progress->cProgressField[1],
-+ move_mode
-+ ? "%d of %d files moved (about %s remaining)"
-+ : "%d of %d files copied (about %s remaining)",
++ fs_len = sprintf ( g_s_progress.cProgressField[1],
++ "%d of %d files copied (about %s remaining)",
+ g_iFilesCopied, g_iTotalFiles, f_ttime );
-+ s_progress->cProgressField[1][fs_len] = ' ';
++ g_s_progress.cProgressField[1][fs_len] = ' ';
+
-+ char s_ftime[40] = "";
++ char s_ftime[PROGRESS_ETA_BUF] = "";
+
+ if (g_iTotalFiles > 1)
+ sprintf ( s_ftime, "(about %s remaining)", f_ftime );
@@ -225,31 +233,31 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ if ( g_iTotalFiles > 1 )
+ {
+ /* global progress bar */
-+ file_progress_bar ( s_progress->cProgressField[2], s_progress->iBarLength,
-+ g_iTotalWritten + *total_n_read / 1024, g_iTotalSize );
++ file_progress_bar ( g_s_progress.cProgressField[2], g_s_progress.iBarLength,
++ g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB, g_iTotalSize );
+
+ /* print the global status */
-+ fs_len = file_size_format ( s_progress->cProgressField[1] + s_progress->iBarLength - 21,
-+ g_iTotalWritten + *total_n_read / 1024, 1 );
-+ s_progress->cProgressField[1][s_progress->iBarLength - 21 + fs_len] = ' ';
++ fs_len = file_size_format ( g_s_progress.cProgressField[1] + g_s_progress.iBarLength - PROGRESS_SIZE_COL,
++ g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB, 1 );
++ g_s_progress.cProgressField[1][g_s_progress.iBarLength - PROGRESS_SIZE_COL + fs_len] = ' ';
+ }
+
+ /* set current progress bar to be always 100 % */
-+ file_progress_bar ( sProgressBar, s_progress->iBarLength, s_progress->src_open_sb.st_size, s_progress->src_open_sb.st_size );
-+ s_progress->cProgressField[5][s_progress->iBarLength-2] = '0';
-+ s_progress->cProgressField[5][s_progress->iBarLength-1] = '%';
-+ s_progress->cProgressField[5][s_progress->iBarLength] = '\0';
++ file_progress_bar ( sProgressBar, g_s_progress.iBarLength, g_s_progress.src_open_sb.st_size, g_s_progress.src_open_sb.st_size );
++ g_s_progress.cProgressField[5][g_s_progress.iBarLength-2] = '0';
++ g_s_progress.cProgressField[5][g_s_progress.iBarLength-1] = '%';
++ g_s_progress.cProgressField[5][g_s_progress.iBarLength] = '\0';
+
+ /* print the status as always full filesize*/
-+ fs_len = file_size_format ( s_progress->cProgressField[4] + s_progress->iBarLength - 21, s_progress->src_open_sb.st_size, 0 );
-+ s_progress->cProgressField[4][s_progress->iBarLength - 21 + fs_len] = ' ';
++ fs_len = file_size_format ( g_s_progress.cProgressField[4] + g_s_progress.iBarLength - PROGRESS_SIZE_COL, g_s_progress.src_open_sb.st_size, 0 );
++ g_s_progress.cProgressField[4][g_s_progress.iBarLength - PROGRESS_SIZE_COL + fs_len] = ' ';
+
+ /* print the field */
+ int it;
+ for ( it = g_iTotalFiles>1 ? 0 : 3; it < 6; it++ )
+ {
-+ printf ( "\033[K%s\n", s_progress->cProgressField[it] );
-+ if ( strlen ( s_progress->cProgressField[it] ) < s_progress->iBarLength )
++ printf ( "\033[K%s\n", g_s_progress.cProgressField[it] );
++ if ( strlen ( g_s_progress.cProgressField[it] ) < (size_t) g_s_progress.iBarLength )
+ printf ( "%s", "" );
+ }
+ if ( g_iTotalFiles > 1 )
@@ -261,55 +269,54 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ }
+ /* END progress mod */
+
- ssize_t n_copied = copy_file_range (src_fd, nullptr, dest_fd, nullptr,
+ ssize_t n_copied = copy_file_range (src_fd, NULL, dest_fd, NULL,
MIN (max_n_read, copy_max), 0);
if (n_copied == 0)
-@@ -382,6 +614,14 @@
- copy_debug.offload = COPY_DEBUG_YES;
+@@ -182,6 +433,14 @@
+ debug->offload = COPY_DEBUG_YES;
max_n_read -= n_copied;
- *total_n_read += n_copied;
+ total_n_read += n_copied;
+
+ /* BEGIN progress mod */
+ if (progress) {
+ /* update total size */
-+ g_iTotalWritten += *total_n_read / 1024;
++ g_iTotalWritten += total_n_read / PROGRESS_BYTES_PER_KIB;
+ g_iFilesCopied++;
+ }
+ /* END progress mod */
}
else
- copy_debug.offload = COPY_DEBUG_AVOIDED;
-@@ -392,6 +632,103 @@
+ debug->offload = COPY_DEBUG_AVOIDED;
+@@ -192,6 +451,98 @@
- while (max_n_read)
+ while (0 < max_n_read)
{
-+
+ /* BEGIN progress mod */
+ if (progress) {
+ /* update countdown */
-+ s_progress->iCountDown--;
-+ char * sProgressBar = s_progress->cProgressField[5];
-+ if ( s_progress->iCountDown < 0 )
-+ s_progress->iCountDown = 100;
++ g_s_progress.iCountDown--;
++ char * sProgressBar = g_s_progress.cProgressField[5];
++ if ( g_s_progress.iCountDown < 0 )
++ g_s_progress.iCountDown = 100;
+
+ /* just print one line with the percentage, but not always */
-+ if ( s_progress->iCountDown == 0 )
++ if ( g_s_progress.iCountDown == 0 )
+ {
+ /* calculate current speed */
+ struct timeval cur_time;
+ gettimeofday ( & cur_time, NULL );
-+ int cur_size = g_iTotalWritten + *total_n_read / 1024;
-+ int cur_fsize = g_iFTotalWritten + *total_n_read / 1024;
-+ int usec_elapsed = cur_time.tv_usec - s_progress->last_time.tv_usec;
++ int cur_size = g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB;
++ int cur_fsize = g_iFTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB;
++ int usec_elapsed = cur_time.tv_usec - g_s_progress.last_time.tv_usec;
+ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
-+ sec_elapsed += ( double ) ( cur_time.tv_sec - s_progress->last_time.tv_sec );
-+ int copy_speed = ( int ) ( ( double ) ( cur_size - s_progress->last_size )
++ sec_elapsed += ( double ) ( cur_time.tv_sec - g_s_progress.last_time.tv_sec );
++ int copy_speed = ( int ) ( ( double ) ( cur_size - g_s_progress.last_size )
+ / sec_elapsed );
-+ char s_copy_speed[20];
++ char s_copy_speed[PROGRESS_NUM_BUF];
+ file_size_format ( s_copy_speed, copy_speed >= 0 ? copy_speed : 0, 1 );
+ /* update vars */
-+ s_progress->last_time = cur_time;
-+ s_progress->last_size = cur_size;
++ g_s_progress.last_time = cur_time;
++ g_s_progress.last_size = cur_size;
+
+ /* how many time has passed since the start? */
+ int isec_elapsed = cur_time.tv_sec - g_oStartTime.tv_sec;
@@ -320,55 +327,51 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ * g_iFTotalSize ) - isec_felapsed;
+ /* print out */
+
-+ char f_ttime[20];
-+ char f_ftime[20];
++ char f_ttime[PROGRESS_NUM_BUF];
++ char f_ftime[PROGRESS_NUM_BUF];
+ format_time(f_ttime, sec_remaining, true);
+ format_time(f_ftime, sec_fremaining, true);
+
+ int fs_len;
-+ fs_len = sprintf ( s_progress->cProgressField[1],
-+ move_mode
-+ ? "%d of %d files moved (about %s remaining)"
-+ : "%d of %d files copied (about %s remaining)",
++ fs_len = sprintf ( g_s_progress.cProgressField[1],
++ "%d of %d files copied (about %s remaining)",
+ g_iFilesCopied, g_iTotalFiles, f_ttime );
-+ s_progress->cProgressField[1][fs_len] = ' ';
++ g_s_progress.cProgressField[1][fs_len] = ' ';
+
-+ char s_ftime[40] = "";
++ char s_ftime[PROGRESS_ETA_BUF] = "";
+
+ if (g_iTotalFiles > 1)
+ sprintf ( s_ftime, "(about %s remaining)", f_ftime );
+ else
+ sprintf ( s_ftime, "(about %s remaining)", f_ttime );
+
-+ sprintf ( s_progress->cProgressField[3],
-+ move_mode
-+ ? "moving at %s/s %s"
-+ : "copying at %s/s %s", s_copy_speed, s_ftime );
++ sprintf ( g_s_progress.cProgressField[3],
++ "copying at %s/s %s", s_copy_speed, s_ftime );
+ if ( g_iTotalFiles > 1 )
+ {
+ /* global progress bar */
-+ file_progress_bar ( s_progress->cProgressField[2], s_progress->iBarLength,
-+ g_iTotalWritten + *total_n_read / 1024, g_iTotalSize );
++ file_progress_bar ( g_s_progress.cProgressField[2], g_s_progress.iBarLength,
++ g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB, g_iTotalSize );
+
+ /* print the global status */
-+ fs_len = file_size_format ( s_progress->cProgressField[1] + s_progress->iBarLength - 21,
-+ g_iTotalWritten + *total_n_read / 1024, 1 );
-+ s_progress->cProgressField[1][s_progress->iBarLength - 21 + fs_len] = ' ';
++ fs_len = file_size_format ( g_s_progress.cProgressField[1] + g_s_progress.iBarLength - PROGRESS_SIZE_COL,
++ g_iTotalWritten + total_n_read / PROGRESS_BYTES_PER_KIB, 1 );
++ g_s_progress.cProgressField[1][g_s_progress.iBarLength - PROGRESS_SIZE_COL + fs_len] = ' ';
+ }
+
+ /* current progress bar */
-+ file_progress_bar ( sProgressBar, s_progress->iBarLength, *total_n_read, s_progress->src_open_sb.st_size );
++ file_progress_bar ( sProgressBar, g_s_progress.iBarLength, total_n_read, g_s_progress.src_open_sb.st_size );
+
+ /* print the status */
-+ fs_len = file_size_format ( s_progress->cProgressField[4] + s_progress->iBarLength - 21, *total_n_read, 0 );
-+ s_progress->cProgressField[4][s_progress->iBarLength - 21 + fs_len] = ' ';
++ fs_len = file_size_format ( g_s_progress.cProgressField[4] + g_s_progress.iBarLength - PROGRESS_SIZE_COL, total_n_read, 0 );
++ g_s_progress.cProgressField[4][g_s_progress.iBarLength - PROGRESS_SIZE_COL + fs_len] = ' ';
+
+ /* print the field */
-+ int it;
++ int it;
+ for ( it = g_iTotalFiles>1 ? 0 : 3; it < 6; it++ )
+ {
-+ printf ( "\033[K%s\n", s_progress->cProgressField[it] );
-+ if ( strlen ( s_progress->cProgressField[it] ) < s_progress->iBarLength )
++ printf ( "\033[K%s\n", g_s_progress.cProgressField[it] );
++ if ( strlen ( g_s_progress.cProgressField[it] ) < (size_t) g_s_progress.iBarLength )
+ printf ( "%s", "" );
+ }
+ if ( g_iTotalFiles > 1 )
@@ -377,67 +380,41 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ printf ( "\r\033[3A" );
+ fflush ( stdout );
+ }
-+ /* END progress mod */
-+ }
++ }
++ /* END progress mod */
+
if (!*abuf)
*abuf = xalignalloc (getpagesize (), buf_size);
char *buf = *abuf;
-@@ -479,6 +816,14 @@
+@@ -270,6 +621,14 @@
certain files in /proc or /sys with linux kernels. */
}
-+ /* BEGIN progress mod */
-+ if (progress) {
-+ /* update total size */
-+ g_iTotalWritten += *total_n_read / 1024;
-+ g_iFilesCopied++;
-+ }
-+ /* END progress mod */
++ /* BEGIN progress mod */
++ if (progress) {
++ /* update total size */
++ g_iTotalWritten += total_n_read / PROGRESS_BYTES_PER_KIB;
++ g_iFilesCopied++;
++ }
++ /* END progress mod */
+
- /* Ensure a trailing hole is created, so that subsequent
- calls of sparse_copy() start at the correct offset. */
- if (make_hole && ! create_hole (dest_fd, dst_name, punch_holes, psize))
-@@ -550,9 +895,11 @@
- static bool
- lseek_copy (int src_fd, int dest_fd, char **abuf, size_t buf_size,
- size_t hole_size, off_t ext_start, off_t src_total_size,
-- enum Sparse_type sparse_mode,
-+ enum Sparse_type sparse_mode, bool move_mode,
- bool allow_reflink,
-- char const *src_name, char const *dst_name)
-+ char const *src_name, char const *dst_name,
-+ int iCountDown, char ** cProgressField, struct timeval last_time,
-+ int last_size, int iBarLength, struct stat src_open_sb)
- {
- off_t last_ext_start = 0;
- off_t last_ext_len = 0;
-@@ -626,10 +973,16 @@
- is conservative and may miss some holes. */
- off_t n_read;
- bool read_hole;
-+
-+ struct timeval a;
-+ struct stat b;
-+
-+ struct progress_status s_progress={iCountDown, cProgressField, last_time, last_size, iBarLength, src_open_sb};
-+
- if ( ! sparse_copy (src_fd, dest_fd, abuf, buf_size,
- sparse_mode != SPARSE_ALWAYS ? 0 : hole_size,
-- true, allow_reflink, src_name, dst_name,
-- ext_len, &n_read, &read_hole))
-+ true, allow_reflink, move_mode, src_name,
-+ dst_name, ext_len, &n_read, &read_hole, &s_progress))
- return false;
-
- dest_pos = ext_start + n_read;
-@@ -1596,8 +1949,80 @@
- buf_size = blcm;
- }
+ if (hole_size)
+ *hole_size = make_hole ? psize : 0;
+ return total_n_read;
+@@ -602,6 +961,86 @@
+ intmax_t result;
+ off_t hole_size = 0;
-+ /* BEGIN progress mod */
++ /* BEGIN progress mod */
++ /* Set up the per-file progress field that sparse_copy/lseek_copy render
++ into. g_s_progress is a file-scope global read by those functions. */
++ char ** cProgressField = NULL;
++ if (progress)
++ {
++ struct stat src_open_sb = *ist;
++
+ /* create a field of 6 lines */
-+ char ** cProgressField = ( char ** ) calloc ( 6, sizeof ( char * ) );
++ cProgressField = ( char ** ) calloc ( 6, sizeof ( char * ) );
+ /* get console width */
+ int iBarLength = 80;
+ struct winsize win;
@@ -480,11 +457,11 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+
+ /* truncate filename? */
+ int fn_length;
-+ if ( strlen ( src_name ) > iBarLength - 22 )
++ if ( strlen ( iname ) > (size_t) (iBarLength - 22) )
+ fn_length =
-+ sprintf ( cProgressField[4], "...%s", src_name + ( strlen ( src_name ) - iBarLength + 25 ) );
++ sprintf ( cProgressField[4], "...%s", iname + ( strlen ( iname ) - iBarLength + 25 ) );
+ else
-+ fn_length = sprintf ( cProgressField[4], "%s", src_name );
++ fn_length = sprintf ( cProgressField[4], "%s", iname );
+ cProgressField[4][fn_length] = ' ';
+
+ /* filesize */
@@ -502,91 +479,58 @@ diff -Naur coreutils-9.7/src/copy.c coreutils-9.7k/src/copy.c
+ struct timeval last_time;
+ gettimeofday ( & last_time, NULL );
+ int last_size = g_iTotalWritten;
-+ /* END progress mod */
+
- off_t n_read;
- bool wrote_hole_at_eof = false;
-+
-+ struct progress_status s_progress = { iCountDown, cProgressField, last_time, last_size, iBarLength, src_open_sb};
++ g_s_progress = ( struct progress_status )
++ { iCountDown, cProgressField, last_time, last_size, iBarLength, src_open_sb };
++ }
++ /* END progress mod */
+
- if (! (
+ if (scantype == LSEEK_SCANTYPE)
+ {
#ifdef SEEK_HOLE
- scantype == LSEEK_SCANTYPE
-@@ -1605,15 +2030,17 @@
- scan_inference.ext_start, src_open_sb.st_size,
- make_holes ? x->sparse_mode : SPARSE_NEVER,
- x->reflink_mode != REFLINK_NEVER,
-- src_name, dst_name)
-+ x->move_mode, src_name, dst_name,
-+ iCountDown, cProgressField, last_time, last_size,
-+ iBarLength, src_open_sb)
- :
- #endif
- sparse_copy (source_desc, dest_desc, &buf, buf_size,
- make_holes ? hole_size : 0,
- x->sparse_mode == SPARSE_ALWAYS,
- x->reflink_mode != REFLINK_NEVER,
-- src_name, dst_name, UINTMAX_MAX, &n_read,
-- &wrote_hole_at_eof)))
-+ x->move_mode, src_name, dst_name, UINTMAX_MAX,
-+ &n_read, &wrote_hole_at_eof, &s_progress)))
- {
- return_val = false;
- goto close_src_and_dst_desc;
-@@ -1624,6 +2051,14 @@
- return_val = false;
- goto close_src_and_dst_desc;
+@@ -641,6 +1080,15 @@
}
-+ /* BEGIN progress mod */
-+ if (progress) {
-+ int i;
-+ for ( i = 0; i < 6; i++ )
-+ free ( cProgressField[i] );
-+ free ( cProgressField );
-+ }
-+ /* END progress mod */
}
- if (x->preserve_timestamps)
-diff -Naur coreutils-9.7/src/copy.h coreutils-9.7k/src/copy.h
---- coreutils-9.7/src/copy.h 2025-01-07 14:31:45.000000000 -0300
-+++ coreutils-9.7k/src/copy.h 2026-01-17 13:24:50.938944306 -0300
-@@ -98,14 +98,14 @@
- DEREF_ALWAYS
- };
-
--# define VALID_SPARSE_MODE(Mode) \
-- ((Mode) == SPARSE_NEVER \
-- || (Mode) == SPARSE_AUTO \
-+# define VALID_SPARSE_MODE(Mode) \
-+ ((Mode) == SPARSE_NEVER \
-+ || (Mode) == SPARSE_AUTO \
- || (Mode) == SPARSE_ALWAYS)
-
--# define VALID_REFLINK_MODE(Mode) \
-- ((Mode) == REFLINK_NEVER \
-- || (Mode) == REFLINK_AUTO \
-+# define VALID_REFLINK_MODE(Mode) \
-+ ((Mode) == REFLINK_NEVER \
-+ || (Mode) == REFLINK_AUTO \
- || (Mode) == REFLINK_ALWAYS)
-
- /* These options control how files are copied by at least the
++ /* BEGIN progress mod */
++ if (progress && cProgressField) {
++ int i;
++ for ( i = 0; i < 6; i++ )
++ free ( cProgressField[i] );
++ free ( cProgressField );
++ }
++ /* END progress mod */
++
+ alignfree (buf);
+ return result;
+ }
+--- coreutils-9.11/src/copy.h 2026-07-23 09:47:29.805951169 -0600
++++ coreutils-9.11k/src/copy.h 2026-07-23 09:47:29.837358788 -0600
@@ -255,6 +255,9 @@
Create destination directories as usual. */
bool symbolic_link;
-+ /* If true, draw a nice progress bar on screen */
++ /* If true, draw a nice progress bar on screen */
+ bool progress_bar;
+
/* Control if destination files are replaced. */
enum Update_type update;
-@@ -328,4 +331,22 @@
+@@ -360,4 +363,32 @@
_GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE;
mode_t cached_umask (void);
+/* BEGIN progress mod */
++
++/* Scratch-buffer sizes for the short formatted strings the progress code
++ builds with sprintf. PROGRESS_NUM_BUF holds a file_size_format /
++ format_time result ("542.3 MiB", "1h 2m 3.4s"). PROGRESS_ETA_BUF holds
++ the longer "(about ... remaining)" string. PROGRESS_FTYPE_BUF holds the
++ file-type label ("folder(s)/file(s)" is the longest at 17 chars). */
++#define PROGRESS_NUM_BUF 20
++#define PROGRESS_ETA_BUF 40
++#define PROGRESS_FTYPE_BUF 20
++
+FILE * spawn( const char *cmd, char *const argv[] );
+void format_time ( char * _cDst, double seconds, bool showall );
+
@@ -605,46 +549,39 @@ diff -Naur coreutils-9.7/src/copy.h coreutils-9.7k/src/copy.h
+/* END progress mod */
+
#endif
-diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
---- coreutils-9.7/src/cp.c 2025-01-07 14:31:45.000000000 -0300
-+++ coreutils-9.7k/src/cp.c 2026-01-17 13:17:40.209427521 -0300
+--- coreutils-9.11/src/cp.c 2026-07-23 09:47:29.806107878 -0600
++++ coreutils-9.11k/src/cp.c 2026-07-23 09:47:29.837379316 -0600
@@ -141,6 +141,7 @@
- {"symbolic-link", no_argument, nullptr, 's'},
- {"target-directory", required_argument, nullptr, 't'},
- {"update", optional_argument, nullptr, 'u'},
-+ {"progress-bar", no_argument, nullptr, 'g'},
- {"verbose", no_argument, nullptr, 'v'},
- {"keep-directory-symlink", no_argument, nullptr,
+ {"symbolic-link", no_argument, NULL, 's'},
+ {"target-directory", required_argument, NULL, 't'},
+ {"update", optional_argument, NULL, 'u'},
++ {"progress-bar", no_argument, NULL, 'g'},
+ {"verbose", no_argument, NULL, 'v'},
+ {"keep-directory-symlink", no_argument, NULL,
KEEP_DIRECTORY_SYMLINK_OPTION},
-@@ -185,6 +186,9 @@
- -f, --force if an existing destination file cannot be\n\
- opened, remove it and try again (this option\n\
- is ignored when the -n option is also used)\n\
-+ -g, --progress-bar add a progress bar.\n\
-+ Note that this doesn't work with reflink,\n\
-+ reflink will be automatically disabled\n\
- -i, --interactive prompt before overwrite (overrides a previous -n\
- \n\
- option)\n\
-@@ -682,6 +686,82 @@
+@@ -203,6 +204,11 @@
+ again (this option is ignored when the -n option is also used)\n\
+ "));
+ oputs (_("\
++ -g, --progress-bar\n\
++ add a progress bar. Note that this doesn't work with reflink;\n\
++ reflink will be automatically disabled\n\
++"));
++ oputs (_("\
+ -i, --interactive\n\
+ prompt before overwrite (overrides a previous -n option)\n\
+ "));
+@@ -737,6 +743,74 @@
}
}
+ /* BEGIN progress mod */
+ struct timeval start_time;
+ if (progress) {
-+ if (g_iTotalSize == 0)
-+ g_iTotalSize = 0;
+ if (g_iTotalFiles == 0)
+ g_iTotalFiles = n_files;
-+ if (g_iFilesCopied == 0)
-+ g_iFilesCopied = 0;
-+ if (g_iDirectoriesCopied == 0)
-+ g_iDirectoriesCopied = 0;
-+ if (g_iTotalWritten == 0)
-+ g_iTotalWritten = 0;
-+
-+ if (target_directory_operand (file[0], &sb))
++
++ if (target_directory_operand (file[0], &sb) >= 0)
+ g_iDirectoriesCopied++;
+
+ /* save time */
@@ -659,9 +596,9 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
+ iFiles = n_files - 1;
+ int j;
+
-+ /* how many files are we copying */
-+ FILE *fp ;
-+ char output[1024];
++ /* how many files are we copying */
++ FILE *fp ;
++ char output[1024];
+ fp = spawn("find", (char *[]){ "find", file[0], "-type", "f", NULL });
+ if ( fp == NULL)
+ printf("failed to run find\r");
@@ -709,8 +646,8 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
if (target_directory)
{
/* cp file1...filen edir
-@@ -822,6 +902,56 @@
- ok = copy (source, dest, AT_FDCWD, dest, -new_dst, x, &unused, nullptr);
+@@ -876,6 +950,56 @@
+ ok = copy (source, dest, AT_FDCWD, dest, -new_dst, x, &unused, NULL);
}
+ /* BEGIN progress mod */
@@ -738,17 +675,17 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
+ sec_elapsed += ( double ) ( end_time.tv_sec - start_time.tv_sec );
+
+ /* get total size */
-+ char sTotalWritten[20];
++ char sTotalWritten[PROGRESS_NUM_BUF];
+ file_size_format ( sTotalWritten, g_iTotalSize, 1 );
+ /* TODO: using g_iTotalWritten would be more correct, but is less accurate */
+
+ /* calculate speed */
+ int copy_speed = ( int ) ( ( double ) g_iTotalWritten / sec_elapsed );
-+ char s_copy_speed[20];
++ char s_copy_speed[PROGRESS_NUM_BUF];
+ file_size_format ( s_copy_speed, copy_speed, 1 );
+
+ /* good-bye message */
-+ char sFType[20];
++ char sFType[PROGRESS_FTYPE_BUF];
+ if ( g_iDirectoriesCopied > 0 && g_iDirectoriesCopied == g_iFilesCopied )
+ sprintf ( sFType, "%s", "folder(s)" );
+ else if ( g_iDirectoriesCopied > 0 && g_iDirectoriesCopied < g_iFilesCopied )
@@ -756,7 +693,7 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
+ else
+ sprintf ( sFType, "%s", "file(s)" );
+
-+ char f_time[20];
++ char f_time[PROGRESS_NUM_BUF];
+ format_time(f_time, sec_elapsed, false);
+ printf ( "%d %s (%s) copied in %s (%s/s).\n", g_iFilesCopied, sFType,
+ sTotalWritten, f_time, s_copy_speed );
@@ -766,7 +703,7 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
return ok;
}
-@@ -857,6 +987,7 @@
+@@ -911,6 +1035,7 @@
x->recursive = false;
x->sparse_mode = SPARSE_AUTO;
x->symbolic_link = false;
@@ -774,49 +711,49 @@ diff -Naur coreutils-9.7/src/cp.c coreutils-9.7k/src/cp.c
x->set_mode = false;
x->mode = 0;
-@@ -996,7 +1127,8 @@
- selinux_enabled = (0 < is_selinux_enabled ());
+@@ -1049,7 +1174,7 @@
cp_option_init (&x);
+ int c;
- while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:TZ",
-+ /* BEGIN and END progress mod - remove the g in the next line!*/
+ while ((c = getopt_long (argc, argv, "abdfgHilLnprst:uvxPRS:TZ",
- long_opts, nullptr))
+ long_opts, NULL))
!= -1)
{
-@@ -1057,6 +1189,10 @@
+@@ -1110,6 +1235,10 @@
x.unlink_dest_after_failed_open = true;
break;
-+ case 'g':
-+ progress = true;
-+ break;
++ case 'g':
++ progress = true;
++ break;
+
case 'H':
x.dereference = DEREF_COMMAND_LINE_ARGUMENTS;
break;
-@@ -1223,6 +1359,9 @@
+@@ -1276,6 +1405,11 @@
usage (EXIT_FAILURE);
}
++ /* BEGIN progress mod */
+ if (progress)
+ x.reflink_mode = REFLINK_NEVER;
++ /* END progress mod */
+
x.backup_type = (make_backups
? xget_version (_("backup type"),
version_control_string)
-diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
---- coreutils-9.7/src/mv.c 2025-01-07 14:31:45.000000000 -0300
-+++ coreutils-9.7k/src/mv.c 2026-01-17 13:17:40.210002773 -0300
+--- coreutils-9.11/src/mv.c 2026-07-23 09:47:29.807078459 -0600
++++ coreutils-9.11k/src/mv.c 2026-07-23 09:47:29.837402508 -0600
@@ -80,6 +80,7 @@
- {"target-directory", required_argument, nullptr, 't'},
- {"update", optional_argument, nullptr, 'u'},
- {"verbose", no_argument, nullptr, 'v'},
-+ {"progress-bar", no_argument, nullptr, 'g'},
+ {"target-directory", required_argument, NULL, 't'},
+ {"update", optional_argument, NULL, 'u'},
+ {"verbose", no_argument, NULL, 'v'},
++ {"progress-bar", no_argument, NULL, 'g'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
- {nullptr, 0, nullptr, 0}
-@@ -171,9 +172,130 @@
+ {NULL, 0, NULL, 0}
+@@ -171,9 +172,119 @@
{
bool copy_into_self;
bool rename_succeeded;
@@ -826,18 +763,7 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ struct stat sb;
+
+ if (progress && x->rename_errno != 0) {
-+ if (g_iTotalSize == 0)
-+ g_iTotalSize = 0;
-+ if (g_iTotalFiles == 0)
-+ g_iTotalFiles = 0;
-+ if (g_iFilesCopied == 0)
-+ g_iFilesCopied = 0;
-+ if (g_iDirectoriesCopied == 0)
-+ g_iDirectoriesCopied = 0;
-+ if (g_iTotalWritten == 0)
-+ g_iTotalWritten = 0;
-+
-+ if (target_directory_operand (source, &sb))
++ if (target_directory_operand (source, &sb) >= 0)
+ g_iDirectoriesCopied++;
+
+ gettimeofday (& start_time, NULL);
@@ -871,7 +797,7 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ fflush (stdout);
+ long iTotalSize = 0;
+ /* call du -s for source */
-+ fp = spawn("du", (char *[]){ "du", "-s", (unsigned char *)(size_t)source, NULL });
++ fp = spawn("du", (char *[]){ "du", "-s", (char *)source, NULL });
+ if (fp == NULL || fgets(output, sizeof(output)-1, fp) == NULL) {
+ printf("failed to run du\r" );
+ }
@@ -889,7 +815,7 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ g_iTotalSize += iTotalSize;
+ }
+ /* END progress mod */
-+
++
bool ok = copy (source, dest, dest_dirfd, dest_relname, 0, x,
©_into_self, &rename_succeeded);
@@ -913,13 +839,13 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ sec_elapsed += ( double ) ( end_time.tv_sec - start_time.tv_sec );
+
+ /* get total size */
-+ char sTotalWritten[20];
++ char sTotalWritten[PROGRESS_NUM_BUF];
+ file_size_format ( sTotalWritten, g_iTotalSize, 1 );
+ /* TODO: using g_iTotalWritten would be more correct, but is less accurate */
+
+ /* calculate speed */
+ int copy_speed = ( int ) ( ( double ) g_iTotalWritten / sec_elapsed );
-+ char s_copy_speed[20];
++ char s_copy_speed[PROGRESS_NUM_BUF];
+ file_size_format ( s_copy_speed, copy_speed, 1 );
+
+ /* increase counter */
@@ -928,7 +854,7 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ /* good-bye message */
+ if ( x->last_file )
+ {
-+ char sFType[20];
++ char sFType[PROGRESS_FTYPE_BUF];
+ if ( g_iDirectoriesCopied > 0 && g_iDirectoriesCopied == g_iFilesCopied )
+ sprintf ( sFType, "%s", "folder(s)" );
+ else if ( g_iDirectoriesCopied > 0 && g_iDirectoriesCopied < g_iFilesCopied )
@@ -936,7 +862,7 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
+ else
+ sprintf ( sFType, "%s", "file(s)" );
+
-+ char f_time[20];
++ char f_time[PROGRESS_NUM_BUF];
+ format_time(f_time, sec_elapsed, false);
+ printf ( "%d %s (%s) moved in %s (%s/s).\n", g_iFilesCopied, sFType,
+ sTotalWritten, f_time, s_copy_speed );
@@ -947,30 +873,60 @@ diff -Naur coreutils-9.7/src/mv.c coreutils-9.7k/src/mv.c
if (ok)
{
char const *dir_to_remove;
-@@ -279,6 +401,7 @@
- "), stdout);
- fputs (_("\
- -f, --force do not prompt before overwriting\n\
-+ -g, --progress-bar add progress-bar\n\
- -i, --interactive prompt before overwrite\n\
- -n, --no-clobber do not overwrite an existing file\n\
- If you specify more than one of -i, -f, -n, only the final one takes effect.\n\
-@@ -341,7 +464,7 @@
- /* Try to disable the ability to unlink a directory. */
+@@ -283,6 +394,10 @@
+ do not prompt before overwriting\n\
+ "));
+ oputs (_("\
++ -g, --progress-bar\n\
++ add a progress bar\n\
++"));
++ oputs (_("\
+ -i, --interactive\n\
+ prompt before overwrite\n\
+ "));
+@@ -365,7 +480,7 @@
priv_set_remove_linkdir ();
-- while ((c = getopt_long (argc, argv, "bfint:uvS:TZ", long_options, nullptr))
-+ while ((c = getopt_long (argc, argv, "bfint:uvgS:TZ", long_options, nullptr))
+ int c;
+- while ((c = getopt_long (argc, argv, "bfint:uvS:TZ", long_options, NULL))
++ while ((c = getopt_long (argc, argv, "bfingt:uvS:TZ", long_options, NULL))
!= -1)
{
switch (c)
-@@ -354,6 +477,9 @@
+@@ -378,6 +493,9 @@
case 'f':
x.interactive = I_ALWAYS_YES;
break;
-+ case 'g':
-+ progress = true;
++ case 'g':
++ progress = true;
+ break;
case 'i':
x.interactive = I_ASK_USER;
break;
+--- coreutils-9.11/doc/coreutils.texi 2026-07-23 09:47:29.758119162 -0600
++++ coreutils-9.11k/doc/coreutils.texi 2026-07-23 09:47:29.838680665 -0600
+@@ -8825,6 +8825,11 @@
+ This option is ignored when the @option{--no-clobber} or @option{-n} option
+ is also used.
+
++ at optItem{cp,-g,}
++ at optItemx{cp,--progress-bar,}
++Display a progress bar while copying, showing the percentage complete,
++copy speed, estimated time remaining, and per-file and overall progress.
++
+ @optItem{cp,-i,}
+ @optItemx{cp,--interactive,}
+ When copying a file other than a directory, prompt whether to
+@@ -9995,6 +10000,12 @@
+ @end macro
+ @mvOptsIfn
+
++ at optItem{mv,-g,}
++ at optItemx{mv,--progress-bar,}
++Display a progress bar while moving files across file systems, showing the
++percentage complete, copy speed, estimated time remaining, and per-file and
++overall progress.
++
+ @optItem{mv,-i,}
+ @optItemx{mv,--interactive,}
+ @cindex prompts, forcing
diff --git a/coreutils-fmt-wchars.patch b/coreutils-fmt-wchars.patch
index 05b3480..91a5ffe 100644
--- a/coreutils-fmt-wchars.patch
+++ b/coreutils-fmt-wchars.patch
@@ -61,21 +61,12 @@
#define ORPHAN_COST(n) (EQUIV (150) / ((n) + 2))
/* Bonus for breaking a line at the end of a sentence. */
-@@ -113,11 +114,30 @@
+@@ -113,11 +114,21 @@
#define MAXWORDS 1000
#define MAXCHARS 5000
+/* Wide character support */
+
-+static wint_t
-+xgetwc (FILE *stream)
-+{
-+ wint_t c = getwc (stream);
-+ if (c == WEOF && ferror (stream))
-+ error (EXIT_FAILURE, errno, _("read error"));
-+ return c;
-+}
-+
+static inline int
+xwcwidth (wchar_t wc)
+{
@@ -362,7 +353,7 @@
- putchar (c);
- c = getc (f);
+ putwchar (c);
-+ c = xgetwc (f);
++ c = getwc (f);
}
return c;
}
@@ -410,7 +401,7 @@
*wptr++ = c;
- c = getc (f);
+ word_limit->width += xwcwidth (c);
-+ c = xgetwc (f);
++ c = getwc (f);
}
- while (c != EOF && !c_isspace (c));
- in_column += word_limit->length = wptr - word_limit->text;
@@ -458,7 +449,7 @@
in_column = 0;
- c = get_space (f, getc (f));
- if (prefix_length == 0)
-+ c = get_space (f, xgetwc (f));
++ c = get_space (f, getwc (f));
+ if (prefix_width == 0)
next_prefix_indent = prefix_lead_space < in_column ?
prefix_lead_space : in_column;
@@ -474,7 +465,7 @@
return c;
in_column++;
- c = getc (f);
-+ c = xgetwc (f);
++ c = getwc (f);
}
c = get_space (f, c);
}
@@ -501,7 +492,7 @@
else
return c;
- c = getc (f);
-+ c = xgetwc (f);
++ c = getwc (f);
}
}
@@ -705,3 +696,32 @@
out_column++;
}
}
+--- coreutils-9.12/doc/coreutils.texi.orig
++++ coreutils-9.12/doc/coreutils.texi
+@@ -2530,6 +2530,10 @@
+ Uniform spacing. Reduce spacing between words to one space, and spacing
+ between sentences to two spaces.
+
++ at optItem{fmt,-n,}
++ at optItemx{fmt,--single-spaces,}
++Separate sentences with a single space rather than two.
++
+ @optItem{fmt,- at var{width},}
+ @optItemx{fmt,-w, at w{ }@var{width}}
+ @optItemx{fmt,--width,=@var{width}}
+The 8-bit-pfx case cannot pass with this patch applied: under LC_ALL=C a
+byte above 0x7f is not a valid character, getwc() fails with EILSEQ and
+fmt reports a read error where upstream simply formats the bytes.
+
+--- coreutils-9.12/tests/fmt/base.pl.orig
++++ coreutils-9.12/tests/fmt/base.pl
+@@ -24,9 +24,6 @@
+
+ my @Tests =
+ (
+- ['8-bit-pfx', qw (-p 'ç'),
+- {IN=> "ça\nçb\n"},
+- {OUT=>"ça b\n"}],
+ ['wide-1', '-w 32768',
+ {ERR => "fmt: invalid width: '32768': $limits->{ERANGE}\n"}, {EXIT => 1}],
+ ['wide-2', '-w 2147483647',
diff --git a/coreutils-getgid.patch b/coreutils-getgid.patch
index d73e737..cd5cd89 100644
--- a/coreutils-getgid.patch
+++ b/coreutils-getgid.patch
@@ -111,9 +111,9 @@ diff -urNp -x '*.orig' coreutils-8.32.org/po/pl.po coreutils-8.32/po/pl.po
#. This is a proper name. See the gettext manual, section Names.
#: src/echo.c:28
msgid "Brian Fox"
-diff -urNp -x '*.orig' coreutils-8.32.org/src/getgid.c coreutils-8.32/src/getgid.c
---- coreutils-8.32.org/src/getgid.c 1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.32/src/getgid.c 2021-03-21 00:28:40.317899186 +0100
+diff -urNp -x '*.orig' coreutils-9.12.org/src/getgid.c coreutils-9.12/src/getgid.c
+--- coreutils-9.12.org/src/getgid.c
++++ coreutils-9.12/src/getgid.c
@@ -0,0 +1,88 @@
+/* getgid - print GID of given group
+ Copyright (C) 1999 Artur Frysiak <wiget at pld-linux.org>
@@ -169,8 +169,6 @@ diff -urNp -x '*.orig' coreutils-8.32.org/src/getgid.c coreutils-8.32/src/getgid
+int
+main (int argc, char **argv)
+{
-+ struct group *gr;
-+
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
@@ -179,38 +177,123 @@ diff -urNp -x '*.orig' coreutils-8.32.org/src/getgid.c coreutils-8.32/src/getgid
+
+ atexit (close_stdout);
+
-+ parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
-+ usage, AUTHORS, (char const *) NULL);
-+ if (getopt_long (argc, argv, "", NULL, NULL) != -1)
-+ usage (EXIT_FAILURE);
++ parse_gnu_standard_options_only (argc, argv, PROGRAM_NAME, PACKAGE_NAME,
++ Version, true, usage, AUTHORS,
++ (char const *) NULL);
+
-+ if (argc < optind + 1)
++ if (optind == argc)
+ {
+ error (0, 0, _("missing operand"));
+ usage (EXIT_FAILURE);
+ }
+
-+ if (optind + 2 < argc)
++ int status = EXIT_SUCCESS;
++
++ for (; optind < argc; optind++)
+ {
-+ error (0, 0, _("extra operand %s"), quote (argv[optind + 2]));
-+ usage (EXIT_FAILURE);
++ struct group *gr = getgrnam (argv[optind]);
++ if (gr == NULL)
++ {
++ error (0, 0, _("cannot find group name %s"), quote (argv[optind]));
++ status = EXIT_FAILURE;
++ }
++ else
++ printf ("%lu\n", (unsigned long int) gr->gr_gid);
+ }
+
-+ gr = getgrnam(argv[optind]);
-+ if (gr == NULL)
-+ error (EXIT_FAILURE, errno, _("cannot find group name %s"), quote (argv[optind]));
-+ else
-+ printf("%lu\n", (unsigned long int) gr->gr_gid);
-+ exit(EXIT_SUCCESS);
++ return status;
+}
diff -urNp -x '*.orig' coreutils-8.32.org/src/local.mk coreutils-8.32/src/local.mk
--- coreutils-8.32.org/src/local.mk 2020-02-25 13:54:28.000000000 +0100
+++ coreutils-8.32/src/local.mk 2021-03-21 00:28:40.317899186 +0100
@@ -130,6 +130,7 @@ src_factor_LDADD = $(LDADD)
- src_false_LDADD = $(LDADD)
+ # See src_false_LDADD below
src_fmt_LDADD = $(LDADD)
src_fold_LDADD = $(LDADD)
+src_getgid_LDADD = $(LDADD)
src_getlimits_LDADD = $(LDADD)
src_ginstall_LDADD = $(LDADD)
src_groups_LDADD = $(LDADD)
+diff -urNp -x '*.orig' coreutils-9.12.org/tests/help/help-version.sh coreutils-9.12/tests/help/help-version.sh
+--- coreutils-9.12.org/tests/help/help-version.sh
++++ coreutils-9.12/tests/help/help-version.sh
+@@ -124,6 +124,7 @@ tr_setup () { args='a a'; }
+ chmod_setup () { args="a+x $tmp_in"; }
+ # Punt on these.
+ chgrp_setup () { args=--version; }
++getgid_setup () { args=--version; }
+ chown_setup () { args=--version; }
+ mkfifo_setup () { args=--version; }
+ mknod_setup () { args=--version; }
+diff -urNp -x '*.orig' coreutils-9.12.org/tests/misc/getgid.sh coreutils-9.12/tests/misc/getgid.sh
+--- coreutils-9.12.org/tests/misc/getgid.sh
++++ coreutils-9.12/tests/misc/getgid.sh
+@@ -0,0 +1,46 @@
++#!/bin/sh
++# Exercise getgid.
++
++# Copyright (C) 2026 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 <https://www.gnu.org/licenses/>.
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ getgid
++
++group_name=$(id -gn) || skip_ 'cannot determine the group name'
++group_id=$(id -g) || skip_ 'cannot determine the group id'
++
++# The name of the invoking user's primary group maps back to its id.
++echo "$group_id" > exp || framework_failure_
++getgid "$group_name" > out || fail=1
++compare exp out || fail=1
++
++# Every operand is looked up, one line each.
++cat exp exp > exp2 || framework_failure_
++getgid "$group_name" "$group_name" > out2 || fail=1
++compare exp2 out2 || fail=1
++
++# An unknown group is diagnosed and is not silently skipped.
++returns_ 1 getgid nosuchgroup-getgid-test 2>err || fail=1
++grep 'nosuchgroup-getgid-test' err >/dev/null || fail=1
++
++# A missing operand is an error.
++returns_ 1 getgid 2>/dev/null || fail=1
++
++# Unknown options are rejected, naming the option.
++returns_ 1 getgid --nosuchoption 2>err2 || fail=1
++grep -F -- '--nosuchoption' err2 >/dev/null || { cat err2; fail=1; }
++
++Exit $fail
+diff -urNp -x '*.orig' coreutils-9.12.org/tests/local.mk coreutils-9.12/tests/local.mk
+--- coreutils-9.12.org/tests/local.mk
++++ coreutils-9.12/tests/local.mk
+@@ -177,6 +177,7 @@ all_tests = \
+ tests/tail/inotify-race2.sh \
+ tests/misc/invalid-opt.pl \
+ tests/misc/user.sh \
++ tests/misc/getgid.sh \
+ tests/rm/ext3-perf.sh \
+ tests/rm/cycle.sh \
+ tests/cp/link-heap.sh \
+diff -urNp -x '*.orig' coreutils-9.12.org/man/local.mk coreutils-9.12/man/local.mk
+--- coreutils-9.12.org/man/local.mk
++++ coreutils-9.12/man/local.mk
+@@ -105,6 +105,7 @@ man/factor.1: src/factor$(EXEEXT)
+ man/false.1: src/false$(EXEEXT)
+ man/fmt.1: src/fmt$(EXEEXT)
+ man/fold.1: src/fold$(EXEEXT)
++man/getgid.1: src/getgid$(EXEEXT)
+ man/groups.1: src/groups$(EXEEXT)
+ man/head.1: src/head$(EXEEXT)
+ man/hostid.1: src/hostid$(EXEEXT)
diff --git a/coreutils-info.patch b/coreutils-info.patch
index 6482001..962d8c4 100644
--- a/coreutils-info.patch
+++ b/coreutils-info.patch
@@ -278,13 +278,13 @@
Summarizing files
--* wc invocation:: Print newline, word, and byte counts
+-* wc invocation:: Print line, word, and character counts
-* sum invocation:: Print checksum and block counts
-* cksum invocation:: Print CRC checksum and byte counts
-* md5sum invocation:: Print or check MD5 digests
-* b2sum invocation:: Print or check BLAKE2 digests
-* sha1sum invocation:: Print or check SHA-1 digests
-+* wc:: Print newline, word, and byte counts
++* wc:: Print line, word, and character counts
+* sum:: Print checksum and block counts
+* cksum:: Print CRC checksum and byte counts
+* b2sum:: Print or check BLAKE2 digests
@@ -739,13 +739,13 @@
contents of files.
@menu
--* wc invocation:: Print newline, word, and byte counts.
+-* wc invocation:: Print line, word, and character counts.
-* sum invocation:: Print checksum and block counts.
-* cksum invocation:: Print CRC checksum and byte counts.
-* md5sum invocation:: Print or check MD5 digests.
-* b2sum invocation:: Print or check BLAKE2 digests.
-* sha1sum invocation:: Print or check SHA-1 digests.
-+* wc:: Print newline, word, and byte counts.
++* wc:: Print line, word, and character counts.
+* sum:: Print checksum and block counts.
+* cksum:: Print CRC checksum and byte counts.
+* md5sum:: Print or check MD5 digests.
@@ -757,7 +757,7 @@
- at node wc invocation
+ at node wc
- @section @command{wc}: Print newline, word, and byte counts
+ @section @command{wc}: Print newline, word, and byte or character counts
@pindex wc
@@ -3858,7 +3844,7 @@ find . -name '*.[ch]' -print0 |
@@ -911,8 +911,8 @@
@pindex comm
@@ -5497,7 +5483,7 @@ $ comm -12 file1 file2 | wc -l # numb
-
- @end table
+ the second as if it were from @var{file2}, and continues alternating in
+ this manner until the end of file is reached.
- at node ptx invocation
+ at node ptx
@@ -2102,3 +2102,23 @@
though, timestamps are not updated quite that way.
For efficiency reasons, many systems are lazy about updating atimes:
+--- coreutils-9.12/src/system.h.org
++++ coreutils-9.12/src/system.h
+@@ -855,7 +855,7 @@
+ emit_ancillary_info (char const *program)
+ {
+ struct infomap { char const *program; char const *node; } const infomap[] = {
+- { "[", "test invocation" },
++ { "[", "test" },
+ { "coreutils", "Multi-call invocation" },
+ { "sha224sum", "sha2 utilities" },
+ { "sha256sum", "sha2 utilities" },
+@@ -882,7 +882,7 @@
+ printf (_("Full documentation <%s%s>\n"),
+ PACKAGE_URL, url_program);
+ printf (_("or available locally via: info '(coreutils) %s%s'\n"),
+- node, node == program ? " invocation" : "");
++ node, "");
+ }
+
+ /* Use a macro rather than an inline function, as this references
diff --git a/coreutils-pld-os-name.patch b/coreutils-pld-os-name.patch
new file mode 100644
index 0000000..03a7357
--- /dev/null
+++ b/coreutils-pld-os-name.patch
@@ -0,0 +1,13 @@
+uname -o should name the distribution, not the generic GNU/Linux.
+
+--- coreutils-9.12/m4/host-os.m4.orig
++++ coreutils-9.12/m4/host-os.m4
+@@ -51,7 +51,7 @@
+ mint*) os='MiNT';;
+ mingw* | windows*) os='MinGW';;
+ lynxos*) os='LynxOS';;
+- linux*) os='GNU/Linux';;
++ linux*) os='PLD Linux';;
+ hpux*) os='HP-UX';;
+ hiux*) os='HI-UX';;
+ gnu*) os='GNU';;
diff --git a/coreutils-readutmp-sd-booted.patch b/coreutils-readutmp-sd-booted.patch
new file mode 100644
index 0000000..8233f45
--- /dev/null
+++ b/coreutils-readutmp-sd-booted.patch
@@ -0,0 +1,74 @@
+Without a booted systemd there is no logind to query, sd_get_sessions() returns
+no sessions and who/users/pinky print nothing; the utmp file is never consulted
+because this code path has no fallback. Only prefer logind when systemd is
+actually running - chroots, containers and non-systemd boots then keep the
+traditional utmp view.
+
+--- coreutils-9.12/lib/readutmp.c.orig
++++ coreutils-9.12/lib/readutmp.c
+@@ -48,6 +48,7 @@
+ #if READUTMP_USE_SYSTEMD
+ # include <dirent.h>
+ # include <systemd/sd-login.h>
++# include <systemd/sd-daemon.h>
+ #endif
+
+ #if HAVE_SYS_SYSCTL_H && !(defined __GLIBC__ && defined __linux__) && !defined __minix
+@@ -1146,7 +1147,7 @@
+ int options)
+ {
+ # if READUTMP_USE_SYSTEMD
+- if (streq (file, UTMP_FILE))
++ if (streq (file, UTMP_FILE) && sd_booted () > 0)
+ /* Imitate reading UTMP_FILE, using systemd and Linux APIs. */
+ return read_utmp_from_systemd (n_entries, utmp_buf, options);
+ # endif
+--- coreutils-9.12/tests/misc/readutmp-no-systemd.sh.orig
++++ coreutils-9.12/tests/misc/readutmp-no-systemd.sh
+@@ -0,0 +1,36 @@
++#!/bin/sh
++# Ensure that the utmp file is still consulted when systemd is not running.
++
++# Copyright (C) 2026 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 <https://www.gnu.org/licenses/>.
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ users
++skip_if_root_
++require_strace_ openat
++
++unshare -rm unshare --version || skip_ 'User namespace sandbox is disabled'
++
++# Hide /run/systemd, i.e. pretend the system was not booted with systemd.
++# Built with --with-systemd, 'users' asks logind and would otherwise report
++# nothing at all here, silently ignoring the utmp file.
++unshare -rm $SHELL -c '
++ mount -t tmpfs tmpfs /run/systemd 2>/dev/null
++ strace -f -e trace=openat users' 2>trace >/dev/null
++
++grep -q openat trace || skip_ 'strace produced no trace inside the sandbox'
++grep -q utmp trace || { cat trace; fail=1; }
++
++Exit $fail
+--- coreutils-9.12/tests/local.mk.orig
++++ coreutils-9.12/tests/local.mk
+@@ -178,6 +178,7 @@
+ tests/misc/invalid-opt.pl \
+ tests/misc/user.sh \
+ tests/misc/getgid.sh \
++ tests/misc/readutmp-no-systemd.sh \
+ tests/rm/ext3-perf.sh \
+ tests/rm/cycle.sh \
+ tests/cp/link-heap.sh \
diff --git a/coreutils-sparc64.patch b/coreutils-sparc64.patch
deleted file mode 100644
index ee086c9..0000000
--- a/coreutils-sparc64.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- coreutils-6.10/src/Makefile.am.orig 2008-04-11 17:38:22.000000000 +0000
-+++ coreutils-6.10/src/Makefile.am 2008-04-11 17:40:55.000000000 +0000
-@@ -135,6 +135,9 @@
-
- stat_LDADD = $(LDADD) $(LIB_SELINUX)
-
-+# stupid sparc64 workaround
-+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-+
- runuser_SOURCES = su.c
- runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
- runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(LIB_PAM)
diff --git a/coreutils-uname-cpuinfo.patch b/coreutils-uname-cpuinfo.patch
index 5ec76d0..6e55fdf 100644
--- a/coreutils-uname-cpuinfo.patch
+++ b/coreutils-uname-cpuinfo.patch
@@ -7,9 +7,9 @@ diff -urNp -x '*.orig' coreutils-8.32.org/src/uname.c coreutils-8.32/src/uname.c
+void __sysinfo_processor_type(char*);
+
+ static bool labeled = false;
+
static struct option const uname_long_options[] =
- {
- {"all", no_argument, NULL, 'a'},
@@ -323,14 +323,12 @@
element = "powerpc";
# endif
@@ -20,7 +20,7 @@ diff -urNp -x '*.orig' coreutils-8.32.org/src/uname.c coreutils-8.32/src/uname.c
- static char processor[257];
- if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
- element = processor;
-+ char processor[BUFSIZ];
++ static char processor[BUFSIZ];
+ __sysinfo_processor_type(processor);
+ element = processor;
}
diff --git a/tests.patch b/tests.patch
index 627bb66..ed03386 100644
--- a/tests.patch
+++ b/tests.patch
@@ -1,7 +1,34 @@
+Adjust the test suite to what PLD's build environment can run.
+
+Tests taken out of the test lists:
+ ls/stat-free-color fails where readdir returns d_type=DT_UNKNOWN, e.g. XFS
+ dd/sparse depends on the file system layout
+ sort/sort-merge-fdlimit mksh does not let a program fail on ulimit
+ split/r-chunk likewise
+
+ acl tests libcoreutils.a pulls smack symbols in via file-has-acl
+
+Environment assumptions of the remaining tests:
+ read-file test /etc/resolv.conf is not readable on the builders
+ envvar-check COLUMNS is set in the build environment
+ realpath run the freshly built binary, not the installed one
+ nohup no controlling terminal on the builders
+
diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests/gnulib.mk
--- coreutils-8.27.orig/gnulib-tests/gnulib.mk 2017-03-09 04:52:57.000000000 +0100
+++ coreutils-8.27/gnulib-tests/gnulib.mk 2017-06-10 20:43:44.600627260 +0200
-@@ -264,9 +264,9 @@
+@@ -99,8 +99,8 @@
+ test-copy-acl.sh test-copy-acl-1.sh test-copy-acl-2.sh
+ TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL)
+ check_PROGRAMS += test-set-mode-acl test-copy-acl test-sameacls
+-test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
+-test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) $(QCOPY_ACL_LIB) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
++test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) $(LIB_SMACK) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
++test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) $(LIB_SMACK) $(QCOPY_ACL_LIB) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
+ test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(MBRTOWC_LIB)
+ EXTRA_DIST += test-set-mode-acl.sh test-set-mode-acl-1.sh test-set-mode-acl-2.sh test-copy-acl.sh test-copy-acl-1.sh test-copy-acl-2.sh test-set-mode-acl.c test-copy-acl.c test-sameacls.c macros.h
+
+@@ -696,9 +696,9 @@
## begin gnulib module chown-tests
@@ -14,7 +41,7 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests
EXTRA_DIST += nap.h test-chown.h test-chown.c signature.h macros.h
## end gnulib module chown-tests
-@@ -465,9 +465,9 @@
+@@ -1085,9 +1085,9 @@
## begin gnulib module fchownat-tests
@@ -27,7 +54,7 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests
EXTRA_DIST += nap.h test-chown.h test-lchown.h test-fchownat.c signature.h macros.h
## end gnulib module fchownat-tests
-@@ -532,10 +532,10 @@
+@@ -1152,10 +1152,10 @@
## begin gnulib module fdutimensat-tests
@@ -42,7 +69,16 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests
EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-fdutimensat.c macros.h
## end gnulib module fdutimensat-tests
-@@ -798,9 +798,9 @@
+@@ -1185,7 +1185,7 @@
+ USE_ACL=$(USE_ACL) \
+ host_os='@host_os@'
+ check_PROGRAMS += test-file-has-acl
+-test_file_has_acl_LDADD = $(LDADD) $(FILE_HAS_ACL_LIB)
++test_file_has_acl_LDADD = $(LDADD) $(FILE_HAS_ACL_LIB) $(LIB_SMACK)
+ EXTRA_DIST += test-file-has-acl.sh test-file-has-acl-1.sh test-file-has-acl-2.sh test-file-has-acl.c macros.h
+
+ ## end gnulib module file-has-acl-tests
+@@ -1488,9 +1488,9 @@
## begin gnulib module futimens-tests
@@ -55,7 +91,7 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests
EXTRA_DIST += nap.h test-futimens.h test-utimens-common.h test-futimens.c signature.h macros.h
## end gnulib module futimens-tests
-@@ -1126,9 +1126,9 @@
+@@ -1983,9 +1983,9 @@
## begin gnulib module lchown-tests
@@ -68,7 +104,7 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/gnulib.mk coreutils-8.27/gnulib-tests
EXTRA_DIST += nap.h test-lchown.h test-lchown.c signature.h macros.h
## end gnulib module lchown-tests
-@@ -2381,9 +2381,9 @@
+@@ -4465,9 +4465,9 @@
## begin gnulib module utimens-tests
@@ -108,7 +144,7 @@ diff -ruN coreutils-8.27.orig/gnulib-tests/test-utimens-common.h coreutils-8.27/
diff -ruN coreutils-8.27.orig/tests/local.mk coreutils-8.27/tests/local.mk
--- coreutils-8.27.orig/tests/local.mk 2017-03-01 05:25:37.000000000 +0100
+++ coreutils-8.27/tests/local.mk 2017-06-10 20:43:44.601627257 +0200
-@@ -167,7 +167,6 @@
+@@ -182,7 +182,6 @@
tests/rm/cycle.sh \
tests/cp/link-heap.sh \
tests/cp/no-ctx.sh \
@@ -116,7 +152,15 @@ diff -ruN coreutils-8.27.orig/tests/local.mk coreutils-8.27/tests/local.mk
tests/misc/io-errors.sh \
tests/misc/read-errors.sh \
tests/misc/responsive.sh \
-@@ -364,7 +363,6 @@
+@@ -460,7 +459,6 @@
+ tests/sort/sort-h-thousands-sep.sh \
+ tests/sort/sort-locale.sh \
+ tests/sort/sort-merge.pl \
+- tests/sort/sort-merge-fdlimit.sh \
+ tests/sort/sort-month.sh \
+ tests/sort/sort-exit-early.sh \
+ tests/sort/sort-rand.sh \
+@@ -470,7 +468,6 @@
tests/sort/sort-unique-segv.sh \
tests/sort/sort-version.sh \
tests/sort/sort-NaN-infloop.sh \
@@ -124,7 +168,15 @@ diff -ruN coreutils-8.27.orig/tests/local.mk coreutils-8.27/tests/local.mk
tests/split/filter.sh \
tests/split/suffix-auto-length.sh \
tests/split/suffix-length.sh \
-@@ -586,7 +586,6 @@ all_tests = \
+@@ -480,7 +477,6 @@
+ tests/split/lines.sh \
+ tests/split/line-bytes.sh \
+ tests/split/l-chunk.sh \
+- tests/split/r-chunk.sh \
+ tests/split/record-sep.sh \
+ tests/split/numeric.sh \
+ tests/split/guard-input.sh \
+@@ -633,7 +629,6 @@
tests/df/total-unprocessed.sh \
tests/df/no-mtab-status.sh \
tests/df/no-mtab-status-masked-proc.sh \
@@ -132,6 +184,22 @@ diff -ruN coreutils-8.27.orig/tests/local.mk coreutils-8.27/tests/local.mk
tests/df/skip-rootfs.sh \
tests/dd/ascii.sh \
tests/dd/conv-case.sh \
+@@ -651,7 +646,6 @@
+ tests/dd/skip-seek2.sh \
+ tests/dd/bytes.sh \
+ tests/dd/skip-seek-past-file.sh \
+- tests/dd/sparse.sh \
+ tests/dd/stderr.sh \
+ tests/dd/unblock.pl \
+ tests/dd/unblock-sync.sh \
+@@ -751,7 +745,6 @@
+ tests/ls/slink-acl.sh \
+ tests/ls/stat-dtype.sh \
+ tests/ls/stat-failed.sh \
+- tests/ls/stat-free-color.sh \
+ tests/ls/stat-free-symlinks.sh \
+ tests/ls/stat-vs-dirent.sh \
+ tests/ls/symlink-loop.sh \
diff -ruN coreutils-8.27.orig/tests/misc/nohup.sh coreutils-8.27/tests/misc/nohup.sh
--- coreutils-8.27.orig/tests/misc/nohup.sh 2017-01-01 23:34:24.000000000 +0100
+++ coreutils-8.27/tests/misc/nohup.sh 2017-06-10 20:44:45.353459732 +0200
@@ -191,7 +259,7 @@ diff -ruN coreutils-8.27.orig/tests/misc/printenv.sh coreutils-8.27/tests/misc/p
diff -ruN coreutils-8.27.orig/tests/misc/realpath.sh coreutils-8.27/tests/misc/realpath.sh
--- coreutils-8.27.orig/tests/misc/realpath.sh 2017-01-01 23:34:24.000000000 +0100
+++ coreutils-8.27/tests/misc/realpath.sh 2017-06-10 20:43:44.597627268 +0200
-@@ -40,71 +40,71 @@
+@@ -40,87 +40,87 @@
ln -s /// three || framework_failure_
# Basic operation
@@ -221,6 +289,24 @@ diff -ruN coreutils-8.27.orig/tests/misc/realpath.sh coreutils-8.27/tests/misc/r
+returns_ 1 $initial_cwd_/src/realpath -m '' || fail=1
+returns_ 1 $initial_cwd_/src/realpath --relative-base= --relative-to=. . || fail=1
+ # QUOTING_STYLE does not affect redirected output.
+ printf 'q name\n' > exp || framework_failure_
+ for style in literal shell-always invalid; do
+ QUOTING_STYLE="$style" \
+- realpath -m --relative-to=. 'q name' > out 2> err || fail=1
++ $initial_cwd_/src/realpath -m --relative-to=. 'q name' > out 2> err || fail=1
+ compare exp out || fail=1
+ compare /dev/null err || fail=1
+ done
+
+ # --zero disables quoting, and does not inspect QUOTING_STYLE.
+ QUOTING_STYLE=invalid \
+- realpath -zm --relative-to=. 'q name' > out 2> err || fail=1
++ $initial_cwd_/src/realpath -zm --relative-to=. 'q name' > out 2> err || fail=1
+ printf 'q name\0' > exp || framework_failure_
+ compare exp out || fail=1
+ compare /dev/null err || fail=1
+
# symlink resolution
-this=$(realpath .)
-test "$(realpath ldir2/..)" = "$this/dir1" || fail=1
@@ -291,3 +377,26 @@ diff -ruN coreutils-8.27.orig/tests/misc/realpath.sh coreutils-8.27/tests/misc/r
if test $double_slash = //; then
test "$out" = "/$nl//" || fail=1
else
+diff -ruN coreutils-9.12.orig/gnulib-tests/test-read-file.c coreutils-9.12/gnulib-tests/test-read-file.c
+--- coreutils-9.12.orig/gnulib-tests/test-read-file.c
++++ coreutils-9.12/gnulib-tests/test-read-file.c
+@@ -25,7 +25,7 @@
+
+ #include "macros.h"
+
+-#define FILE1 "/etc/resolv.conf"
++#define FILE1 "/etc/hosts"
+ #define FILE2 "/dev/null"
+
+ static int
+diff -ruN coreutils-9.12.orig/tests/envvar-check coreutils-9.12/tests/envvar-check
+--- coreutils-9.12.orig/tests/envvar-check
++++ coreutils-9.12/tests/envvar-check
+@@ -32,7 +32,6 @@
+ BLOCKSIZE
+ BLOCK_SIZE
+ CDPATH
+- COLUMNS
+ DF_BLOCK_SIZE
+ DU_BLOCK_SIZE
+ ENV
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/coreutils.git/commitdiff/4845223f90b2648880a25947f5debd99617131e5
More information about the pld-cvs-commit
mailing list