1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 10:15:48 +02:00
Commit Graph

30887 Commits

Author SHA1 Message Date
Pádraig Brady
eebe2abbb6 tests: use tail --debug to determine inotify support
* init.cfg (require_inotify_supported_): A new function that
indicates inotify support for a file in the current directory,
using tail --debug, rather than awkward strace checks etc.
* tests/tail/inotify-dir-recreate.sh: Call require_inotify_supported_.
 tests/tail/inotify-only-regular.sh: Likewise.
 tests/tail/inotify-race.sh: Likewise.
 tests/tail/inotify-race2.sh: Likewise.
2025-11-17 14:50:04 +00:00
Pádraig Brady
d611bcbfff tail: add --debug to report the --follow implementation
* doc/coreutils.texi (tail invocation): Describe --debug.
* src/tail.c (tail_forever, tail_forever_inotify): Output
which --follow implementation is being used.
* tests/tail/debug.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
2025-11-17 13:55:12 +00:00
Collin Funk
6cbb7f0dbb maint: convert remove a K&R declaration
This function is hidden unless EVAL_TRACE is defined for debugging.

* src/expr.c (trace): Convert to a prototype instead of K&R definition
to avoid -Werror=strict-prototypes. Make the argument const to avoid
-Werror=discarded-qualifiers.
2025-11-16 16:59:43 -08:00
Bernhard Voelker
9a970586c7 du: document the TIME_STYLE env variable in usage
The impact of the TIME_STYLE environment variable on du(1) was only
documented in the Texinfo manual.  To avoid surprises for users,
also mention TIME_STYLE in the usage text, i.e., for --help and man.
Organize similar as in ls(1), but as du(1) has slightly different
behavior it would be hard to share the translation.

* src/du.c (usage): Shorten the description of --time-style, and refer
to an additional --time-style / TIME_STYLE description below.
2025-11-16 18:31:20 +01:00
Pádraig Brady
3c1721d6c7 tests: verify we document all supported options in --help
* tests/misc/getopt_vs_usage.sh: A new test which checks the
converse of usage_vs_getopt.sh
* tests/local.mk: Reference the new test.
2025-11-16 17:18:03 +00:00
Pádraig Brady
e05b875be8 maint: tag supported options not documented in --help 2025-11-16 17:18:03 +00:00
Pádraig Brady
b545f6e6f3 maint: rearrange cksum modules so main is in cksum.c
* src/cksum.c: -> src/cksum_crc.c
* src/cksum.h: -> src/cksum_crc.h
* src/digest.c: -> src/cksum.c
* src/local.mk: Adjust accordingly.
* cfg.mk: Likewise.
* po/POTFILES.in: Likewise.
* src/cksum_avx2.c: Likewise.
* src/cksum_avx512.c: Likewise.
* src/cksum_pclmul.c: Likewise.
* src/cksum_vmull.c: Likewise.
2025-11-16 17:18:03 +00:00
Pádraig Brady
f8137811d9 wc: fix missing documentation for the --debug option
* doc/coreutils.texi (wc invocation): Desscribe --debug.
* src/wc.c (usage): Likewise.
* NEWS: Mention the bug fix.
2025-11-16 17:18:03 +00:00
Sylvestre Ledru
8a56f4cb89 tests: install should ignore umask
Identified here:
<https://github.com/uutils/coreutils/pull/9254>

  * tests/install/basic-1.sh: Add the check.
2025-11-15 23:10:54 +00:00
Collin Funk
28cf6ac831 tests: pr: add a test for bounded memory operation
* tests/pr/bounded-memory.sh: New file.
* tests/local.mk (all_tests): Add the test.
2025-11-15 11:34:21 -08:00
Collin Funk
71514b4983 tests: dd: add tests for conv=lcase and conv=ucase
* tests/dd/conv-case.sh: New test.
* tests/local.mk (all_tests): Add it.
2025-11-14 10:59:55 -08:00
Pádraig Brady
faf8d8998c doc: shred: clarify what --verbose outputs
* doc/coreutils.texi (shred invocation): Give more details on what
--verbose outputs, to give some indication of its utility.
* src/shred.c (usage): Likewise.  Also since we're changing the string,
split out translations to give translators more granular translations.
2025-11-14 13:23:09 +00:00
Collin Funk
57b3ccc9b0 tests: test: add test cases for -ef
* tests/test/test-file.sh: Check that -ef works as expected on files,
symbolic links, and hard links.
2025-11-13 10:53:45 -08:00
Collin Funk
07b5679570 maint: fix a typo in comments
* tests/date/reference.sh: Fix typo; s/modiication/modification.
2025-11-12 10:59:08 -08:00
Collin Funk
e1bd591bc2 tests: test: add test cases for -nt and -ot
* tests/test/test-file.sh: Check that -nt and -ot work properly when
files may or may not exist.
2025-11-12 10:42:14 -08:00
Pádraig Brady
e8dcdb9932 sort: avoid pthread calls with --parallel=1
Before this change there were the following unneeded pthread calls:

  $ seq 1e6 | ltrace -c -e 'pthread*' sort --parallel=1 | wc -l
  % time     seconds  usecs/call     calls      function
  ------ ----------- ----------- --------- --------------------
   39.13    0.031757          67       468 pthread_mutex_lock
   37.96    0.030811          65       468 pthread_mutex_unlock
   13.17    0.010691          65       162 pthread_cond_signal
    2.15    0.001747          64        27 pthread_mutex_destroy
    2.00    0.001620          60        27 pthread_mutex_init
    0.70    0.000565          62         9 pthread_cond_destroy
    0.64    0.000518          57         9 pthread_cond_init
  ------ ----------- ----------- --------- --------------------
  100.00    0.081159                  1170 total

* src/sort.c (sort): Avoid merge tree overhead when single threaded.
2025-11-12 14:12:43 +00:00
Pádraig Brady
6f265b515e md5sum: fix --text with the MSYS2 runtime
Note the use of "rt" is non-standard, but we're restricting
its use here to systems that define O_BINARY, which should
invariably support "rt" mode.

* src/digest.c (): Where significant, explicitly use "rt" mode
with --text, as MSYS2 defaults to binary mode for fopen'd files
(though not for standard streams).
* NEWS: Mention the bug fix.
Fixes https://github.com/coreutils/coreutils/issues/123
2025-11-12 14:11:27 +00:00
Pádraig Brady
88d05f1516 maint: fix comment re PRLFS' remoteness
* src/stat.c (human_fstype): prlfs is used in a context of
separate host and guest OS, so should be treated as remote always.
2025-11-12 14:07:31 +00:00
Pádraig Brady
3b6efd5557 tests: env --argv0: fix false failure with symlinked single binary
* tests/env/env.sh: Always pass --coreutils-prog=true so that the
program to run can be determined with --enable-single-binary=symlinks.
Also actually verify the expected verbose output.
Reported by the Alpine Linux project.
2025-11-12 13:47:55 +00:00
Collin Funk
b8675fe98c maint: fix a comment in the generated src/fs-is-local.h file
Reported by Bruno Haible in
<https://lists.gnu.org/r/coreutils/2025-11/msg00113.html>.

* src/extract-magic ($magic_comment): Mention that the function returns
1 if the file system is local and 0 if it is remote.
2025-11-11 15:37:44 -08:00
Pádraig Brady
d6fc91f37a tests: add tests for locale ordering
* tests/sort/sort-locale.sh: Check sort,ls have the same (non C) order.
* tests/local.mk: Reference the new test.
2025-11-11 14:29:36 +00:00
Pádraig Brady
f7be1e51a3 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-11-10 13:54:30 +00:00
Pádraig Brady
0ae5bdc7a8 version 9.9
* NEWS: Record release date.
v9.9
2025-11-10 13:21:59 +00:00
Collin Funk
fc93a44bbe nice: clamp the niceness correctly on GNU/Hurd
* NEWS: Mention the bug fix.
* src/nice.c (MIN_ADJUSTMENT): Set to 0 on the Hurd with glibc ≤ 2.42.
(MAX_ADJUSTMENT): Set to (2 * NZERO - 2) on the Hurd with glibc ≤ 2.42.
(main): Clamp the niceness to be greater or equal to MIN_ADJUSTMENT and
less than or equal to MAX_ADJUSTMENT.
* tests/nice/nice.sh: Add some tests for the Hurd's ranges.
2025-11-09 18:48:34 -08:00
Collin Funk
56fc0e6f8d tests: tail: avoid a test failure on GNU/Hurd
* tests/tail/tail-c.sh: Allow 'tail -c 4096 /dev/urandom' to run forever
on GNU/Hurd since lseek fails with ESPIPE.
2025-11-08 11:43:07 -08:00
Pádraig Brady
cc38da00ef chcon: fix memory leak in error path
* src/chcon.c (change_file_context): If compute_context_from_mask fails,
free the previously allocated file_context.
Fixes https://bugs.gnu.org/79780
2025-11-08 10:41:48 +00:00
Pádraig Brady
cc88c2a807 tests: avoid false failure due to small timeout
* tests/tail/tail-c.sh: Tests that fail after a timeout
should use as least 10s to avoid intermittent failures
on slow/loaded hosts.
2025-11-08 10:14:38 +00:00
Collin Funk
9abf150477 build: update gnulib submodule to latest 2025-11-07 20:25:47 -08:00
Pádraig Brady
58944b541e install: fix crash with --strip and large $PATH on ppc and sparc
* gnulib: Update to the latest gnulib to pull in the fix
(v1.0-2406-g89f63027de) to allocate the $PATH processing memory
before the vfork call, which is required on ppc and sparc.
* tests/install/basic-1.sh: Ensure posix_spawnp() suports a large $PATH,
which needs careful handling with vfork() as detailed in gnulib.
2025-11-07 16:36:08 +00:00
Pádraig Brady
574b1b938c doc: cksum: clarify support of --text and --binary
Make the documentation more accurate following v9.3-80-g5e1e0993b

* doc/coreutils.texi (cksum common options): State that --text and
--binary are actually supported, but only to support emulation
of the legacy utils.
2025-11-07 16:36:08 +00:00
Collin Funk
8dd89f55d5 tests: wc: protect against a hang on GNU/Hurd
Reported by Bruno Haible in
<https://lists.gnu.org/r/coreutils/2025-11/msg00051.html>.

* tests/wc/wc-total.sh: Skip a test that would exhaust memory on
GNU/Hurd.
2025-11-06 16:52:03 -08:00
Pádraig Brady
07cd38ef66 gnulib: update to latest
* NEWS: Mention the nproc build fix for older Android.
2025-11-05 18:39:06 +00:00
Collin Funk
1654bd8628 doc: mention nanosecond decimal points with --iso-8601=ns
Many people are used to seeing ISO 8601 dates using a period separating
seconds and nanoseconds. This behavior seems to be worth documenting
given the bug reports:
https://bugs.gnu.org/63119
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118970

* doc/coreutils.texi (Options for date): Mention that
'date --iso-8601=ns' uses a comma as a separator, following the
preference of ISO 8601. Give an example of how to get an ISO 8601 date
with a period separator.
2025-11-05 14:18:38 +00:00
Pádraig Brady
4c0cf3864a maint: adjust lseek_copy to handle non zero offsets
* src/copy-file-data.c (lseek_copy): hole_start is initialized
only when ext_start == ipos.
(infer_scantype): Update the hole_start initialization to
the more logically correct POS, even though that init
is only needed to suppress a -Wmaybe-uninitialized warning.
Note gcc 15.2 at least doesn't seem to need that suppression.
2025-11-04 16:32:16 +00:00
Bernhard Voelker
d36d0f28a4 tests: avoid skipping of LD_PRELOAD based df tests
It was seen that gnulib's read_file_system_list may use fopen instead
of open.  Adjust the df(1) tests to replace both library functions.

* tests/df/no-mtab-status.sh: Change the shared library code invoked
via LD_PRELOAD to override both fopen and open.  While at it, perform
varargs processing only when path is not "/proc/self/mountinfo".
* tests/df/skip-duplicates.sh: Likewise.
2025-11-04 11:33:35 +01:00
Bernhard Voelker
71c9921d55 tests: avoid skipping by fixing build of shared libraries
Two df(1) tests were skipped (since commit ee367bd38d), because
the build of the shared library in those tests failed.

  + gcc -Wall -shared --std=gnu99 -fPIC -O2 k.c -o k.so -ldl
  k.c: In function 'open':
  k.c:37:7: error: implicit declaration of function 'streq'; did you \
  mean 'strsep'? [-Wimplicit-function-declaration]
     37 |   if (streq (path, "/proc/self/mountinfo"))
        |       ^~~~~
        |       strsep

Gnulib streq is not available in the tests.

* tests/df/no-mtab-status.sh: Replace "streq" by "0==strcmp" in the
shared library source.
* tests/df/skip-duplicates.sh: Likewise.
2025-11-04 11:33:29 +01:00
Collin Funk
0830838609 tests: date: check that write errors are promptly diagnosed
This improvement is due to changes to Gnulib's fprintftime module.

* NEWS: Mention the improvement.
* src/getlimits.c (OFF64_T_MAX, OFF64_T_MIN): New macros.
(main): Print them.
* tests/misc/write-errors.sh: Call getlimits_. Add a date invocation.
2025-11-03 17:05:57 -08:00
Paul Eggert
c9425336f4 doc: squashfs issue to be squashed in Linux 6.18 2025-11-03 11:33:38 -08:00
Pádraig Brady
77322b3119 tests: truncate: ensure negative args not parsed as options
* tests/truncate/truncate-parameters.sh: Add a test case.
2025-11-03 13:52:54 +00:00
Pádraig Brady
cb0ab4ef39 date: avoid a duplicated write error diagnotic
* src/show-date.c (show_date): Only show the fprintftime() diagnostic
if a further diagnostic will not be shown.
2025-11-03 13:00:32 +00:00
Pádraig Brady
d870bfbca1 date: translate/clarify recent error message
* src/show-date.c (show_date): Flagged by syntax-check.
2025-11-03 12:55:35 +00:00
Pádraig Brady
7d17e1d36c date: promptly diagnose write errors with --file
* src/date.c (batch_convert): Check error state of stdout
after each date is processed.
* tests/misc/write-errors.sh: Add a test case.
2025-11-03 12:51:04 +00:00
Collin Funk
170509d41f tests: stty: filter out ispeed and ospeed from boolean options
* tests/stty/stty-pairs.sh: Also ignore lines starting with ispeed and
ospeed.
* tests/stty/stty.sh: Likewise.
Reported by Bernhard Voelker.
2025-11-02 10:57:21 -08:00
Paul Eggert
fdf88157c6 date: diagnose fprintftime failure
* src/show-date.c (show_date): Diagnose fprintftime failure,
as it need not be an output error.
2025-11-01 18:00:32 -06:00
Paul Eggert
70bb8fa34f pr: improve nstrftime failure check
* src/pr.c (init_header): Do not report an nstrftime EOVERFLOW
error as memory exhaustion.  Instead, output the time as an
integer.  Also, work even if nstrftime (nullptr, SIZE_MAX, ...)
would return PTRDIFF_MAX which means adding 1 would overflow..
2025-11-01 18:00:32 -06:00
Paul Eggert
b427c185f2 ls: better nstrftime failure check
* src/ls.c (print_long_format): Streamline the checking
for failure of nstrftime.
2025-11-01 18:00:32 -06:00
Paul Eggert
695cedcddd build: update gnulib submodule to latest 2025-11-01 18:00:32 -06:00
Collin Funk
6d273604d0 tests: date: avoid test failure on NetBSD
* tests/date/date-tz.sh: Allow date to fail with large values for TZ
since NetBSD's tzalloc function limits them to 256 bytes.
2025-11-01 10:49:05 -07:00
Pádraig Brady
cf08d2d3b1 build: reduce explicit dependencies on macOS CoreFoundation
* src/local.mk: Revert v9.7-322-gc2e1816a5, instead relying
on the more focused v9.8-79-g532cd66af.  When built with
--disable-nls on macOS this will result in only some commands
being linked with INTL_MACOSX_LIBS, thus resulting in env(1)
at least not setting a __CF_USER_TEXT_ENCODING envirnoment variable.
2025-11-01 15:07:15 +00:00
Grisha Levit
8b111d0274 build: fix macOS build without libintl
A more precise fix than commit v9.7-322-gc2e1816a5

* configure.ac (USE_NLS): new AM_CONDITIONAL.
* src/local.mk: add @INTL_MACOSX_LIBS@ to <prog>_LDADD that need it.
2025-11-01 15:07:13 +00:00