1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-12 02:12:06 +02:00
Commit Graph

30995 Commits

Author SHA1 Message Date
oech3
1b467784fb tests: consolidate csplit-io-err tests
* tests/csplit/csplit-io-err.sh: Replace this LD_PRELOAD test with...
* tests/csplit/csplit-io-err-2.sh: This more general test,
that leverages /dev/full.
* tests/local.mk: Remove tests/csplit/csplit-io-err-2.sh.
2025-12-27 12:48:57 +00:00
oech3
60f48bbda6 tests: csplit: check writing to /dev/full
* tests/csplit/csplit-io-err-2.sh: Add a new test.
* tests/local.mk: Reference new test.
2025-12-26 14:59:39 +00:00
Collin Funk
b12593d124 dd: don't continue copying when ftruncate fails using seek= and of=
* src/dd.c (main): Reduce the scope of exit_status. Exit immediately if
ftruncate fails.
* tests/dd/fail-ftruncate-fstat.sh: New test.
* tests/local.mk (all_tests): Add the new test.
* NEWS: Mention the bug fix.
2025-12-25 15:16:57 -08:00
Pádraig Brady
7c1bc64d38 doc: document the date(1) bug with empty format directives
* NEWS: Mention the bug fix.
2025-12-25 14:30:59 +00:00
Pádraig Brady
78c8447a98 build: update gnulib to latest 2025-12-25 14:25:58 +00:00
Collin Funk
18405cb51a tests: date: improve locale tests
* tests/date/date-locale-hour.sh: Test that the default format of 10
random supported locales is the same as 'locale date_fmt'.
2025-12-24 18:41:34 -08:00
Pádraig Brady
95044cb5ea tests: avoid false failure due to ulimit on aarch64
* tests/cut/cut-huge-range.sh: Add an extra 1MiB headroom,
which was seen with aarch64.
Reported at https://bugzilla.redhat.com/2424302
2025-12-22 17:12:48 +00:00
Pádraig Brady
e34734cdf9 maint: tests/cut/cut-huge-range.sh: remove stale comment
* tests/cut/cut-huge-range.sh: expr supports bignums,
so remove stale comment relating to previous non expr adjustment.
2025-12-22 15:24:07 +00:00
Pádraig Brady
955dfdafa2 numfmt: fix dropped custom suffix when failing to parse
* src/numfmt.c (process_suffixed_number): Restore custom suffix
upon failure to parse number.
* tests/numfmt/numfmt.pl: Add test cases.
* NEWS: Mention the bug fix.
Fixes https://bugs.debian.org/1094581
2025-12-22 13:17:37 +00:00
Collin Funk
1313c24056 maint: prefer enums over macros for sources used for multiple programs
* src/chown.h (enum chown_modes): New type.
(CHOWN_CHOWN, CHOWN_CHGRP): Define as an enum instead of a macro.
* src/chown-chgrp.c (chown_mode): Use "enum chown_modes" instead of
"int".
* src/chown-chown.c (chown_mode): Likewise.
* src/ls.h (enum ls_modes): New type.
(LS_LS, LS_MULTI_COL, LS_LONG_FORMAT): Define as an enum instead of a
macro.
* src/ls-dir.c (ls_mode): Use "enum ls_modes" instead of "int".
* src/ls-ls.c (ls_mode): Likewise.
* src/ls-vdir.c (ls_mode): Likewise.
* src/uname.h (enum uname_modes): New type.
(UNAME_UNAME, UNAME_ARCH): Define as an enum instead of a macro.
* src/uname-arch.c (uname_mode): Use "enum uname_modes" instead of
"int".
* src/uname-uname.c (uname_mode): Likewise.
2025-12-20 17:25:32 -08:00
Collin Funk
d7aaa001d9 doc: prefer UTF-8 characters in texinfo sources
* doc/coreutils.texi (Introduction): Use ç instead of @,{c}.
(Character arrays): Use ö instead of @"o. Use Ł instead of @L{}.
(Formatting file timestamps): Use ä instead of @"a.
2025-12-20 13:27:07 -08:00
Pádraig Brady
3a07cefae0 doc: ls: fix recent typo for -F option in texinfo
* doc/coreutils.texi (ls invocation): Add a missing hyphen
that was inadvertently dropped in the recent adjustments.
2025-12-20 20:09:37 +00:00
Pádraig Brady
8f4a0095a0 tests: runcon: avoid false success
* tests/runcon/runcon-compute.sh: Ensure runcon runs,
since the main test is a negative one.
2025-12-20 13:17:12 +00:00
Pádraig Brady
7be8402e1e doc: split,tac: document $TMPDIR usage
Following commit v9.3-92-g1b86b70dd
$TMPDIR is part of the interface and an important behavioral
characteristic of a command, which should be documented.

* doc/coreutils.texi (split invocation): Mention $TMPDIR is honored.
(tac invocation): Likewise.
* src/split.c (usage): Likewise.
* src/tac.c (usage): Likewise.
2025-12-19 00:09:58 +00:00
Collin Funk
a2c3896b51 doc: tee: prefer cksum in examples
* doc/coreutils.texi (tee invocation): Use 'cksum' with '-a sha2' and
'-a sha3' instead of md5sum and sha1sum in examples.
2025-12-16 22:15:26 -08:00
Pádraig Brady
9a1bd362d2 tests: mv: check moving named sockets is supported
* tests/mv/mv-special-2.sh: Use python to create a named socket,
and ensure it's copied across file systems.
2025-12-16 11:33:38 +00:00
Collin Funk
45071c85b5 tests: date: add another locale test case
On a GNU/Linux system, we have the following:

    $ LC_ALL=en_US.UTF-8 date -u -d 1:00
    Sun Dec 14 01:00:00 AM UTC 2025
    $ LC_ALL=en_US.UTF-8 locale date_fmt
    %a %b %e %r %Z %Y
    $ LC_ALL=en_US.UTF-8 locale t_fmt_ampm
    %I:%M:%S %p

    $ LC_ALL=nl_NL.UTF-8 date -u -d 1:00
    zo 14 dec 2025  1:00:00 UTC
    $ LC_ALL=nl_NL.UTF-8 locale date_fmt
    %a %e %b %Y %k:%M:%S %Z

We respect the locales preference for a leading zero or leading space in
single digit hours.

* tests/date/date-locale-hour.sh: Check that the locales preference for
leading zeros or spaces in single digit hours is used.
2025-12-15 15:54:00 -08:00
Pádraig Brady
f4dca9ca03 tests: mv: check traversed fifos copy correctly
* tests/mv/mv-special-1.sh: Add a case also for fifos
encountered when traversing.
2025-12-15 15:30:43 +00:00
Pádraig Brady
9ad870131d tests: mv: add timeout protection when moving fifos
* tests/mv/mv-special-1.sh: Implementations could potentially hang
interacting with fifos, so wrap with timeout.
2025-12-15 13:54:25 +00:00
Collin Funk
3b809382b8 doc: dd: document the behavior of conv flags on multibyte characters
* doc/coreutils.texi (dd invocation): Document the behavior of 'dd' on
multibyte characters and some unspecified behavior that will be
documented in a future POSIX release [1].

[1] https://austingroupbugs.net/view.php?id=1959
2025-12-13 18:55:00 -08:00
Collin Funk
cfd78d0877 tests: ls: use a larger file descriptor limit
OpenBSD and Alpine Linux /bin/sh cannot handle a file descriptor limit
of 7.

* tests/ls/recursive.sh: Create 30 directories and use a file descriptor
limit of 20. Don't check the output since we have coverage for that
elsewhere.
Reported by Bruno Haible.
2025-12-13 18:37:18 -08:00
Pádraig Brady
cd52292221 build: reduce size of multi-call binary by reusing cksum logic
Map md5sum and sha{1,224,256,385,512} to use cksum logic,
which selects appropriate behavior at runtime, rather than
separate binaries for each closely related utility.

$ size src/coreutils  # before
   text	   data	    bss	    dec	    hex	filename
1349509	   6812	 619312	1975633	 1e2551	src/coreutils
$ size src/coreutils  # after
   text	   data	    bss	    dec	    hex	filename
1306933	   6748	 619152	1932833	 1d7e21	src/coreutils

* build-aux/gen-single-binary.sh: Map sha*sum to use cksum.c
* src/cksum.c: Adjust to behave more like sha*sum,
when the algorithm to something other than "crc".
* src/cksum.h: Expose the cksum_algorithm global and enum.
* src/coreutils-md5sum.c: Set cksum_algorithm and call cksum logic.
* src/coreutils-sha1sum.c: Likewise.
* src/coreutils-sha224sum.c Likewise.
* src/coreutils-sha256sum.c Likewise.
* src/coreutils-sha384sum.c Likewise.
* src/coreutils-sha512sum.c Likewise.
* NEWS: Mention the improvement.
2025-12-13 17:18:47 +00:00
Pádraig Brady
cdb966adb3 doc: expand on shell-escape quoting style
* doc/coreutils.texi (quotingStyles): Expand on the advantages
of "shell-escape" quoting, and mention it's the default when
outputting to a tty. Also mention how it's also useful with
LC_ALL=C to further disambiguate output.  Also reference the
separate page detailing various considerations and options
for file name quoting.  Also move the mention of the default
quoting style to the top of the page where it's more obvious.
2025-12-12 17:08:00 +00:00
Pádraig Brady
ba3442f4fa tests: printf: add case for quoting single quotes
* tests/printf/printf-quote.sh: Add a test case for
https://bugs.debian.org/992161 which was fixed with
gnulib commit v0.1-7339-g07b31a9465
2025-12-12 14:21:44 +00:00
Collin Funk
6956163ee5 maint: organize tee tests in a subdirectory
* tests/misc/tee.sh: Moved to tests/tee/tee.sh.
* tests/local.mk (all_tests): Adjust the file name.
2025-12-11 19:00:58 -08:00
Collin Funk
37be9fcfe8 tests: tee: add a test for --append
* tests/tee/append.sh: New file.
* tests/local.mk (all_tests): Add the test.
2025-12-11 19:00:50 -08:00
Pádraig Brady
06ed0625bd tests: fix recent portability issue with printf
* tests/sort/sort-locale.sh: Avoid non portable printf \u....
* cfg.mk (sc_env_printf): Add a new syntax check to flag future cases.
2025-12-11 22:02:55 +00:00
Pádraig Brady
a68ffc7176 tests: env: ensure non-utf8 name or value is supported
* tests/env/env.sh: Add a test case ensuring non-utf8 characters
in the name or value are supported.
2025-12-11 21:27:44 +00:00
Pádraig Brady
8a3c75c6d8 tests: mv: ensure ownership preserved when copying
* tests/mv/meta-to-xpart.sh: Add new test.
* tests/local.mk: Reference new test.
2025-12-11 20:32:41 +00:00
Collin Funk
b1ba0f3843 maint: groups: reduce variable scope
* src/groups.c (main): Declare variables where they are used instead of
at the start of the function. Convert a comment to GNU style.
2025-12-10 18:50:53 -08:00
Collin Funk
ae1dcbdbc6 maint: printenv: reduce variable scope
* src/printenv.c (main): Declare variables where they are used instead
of at the start of the function. Constify some strings we do not modify.
2025-12-10 18:50:53 -08:00
Collin Funk
bdb276a0c5 maint: rmdir: reduce variable scope
* src/rmdir.c (remove_parents, main): Declare variables where they are
used instead of at the start of a block.
2025-12-10 18:50:53 -08:00
Collin Funk
553c33ba6a maint: date: reduce variable scope
* src/date.c (batch_convert, main): Declare variables where they are
used instead of at the start of the function.
2025-12-10 18:50:53 -08:00
Collin Funk
684ec5b8ad maint: install: reduce variable scope
* src/install.c (change_timestamps): Initialize variables where they are
declared.
(need_copy, setdefaultfilecon, get_ids, mkancesdirs_safe_wd, main):
Declare variables where they are used instead of at the start of the
block.
2025-12-10 18:50:53 -08:00
Collin Funk
55aa5afbaf maint: cp: reduce variable scope
* src/cp.c (re_protect): Initialize variables where they are declared.
(make_dir_parents_private, do_copy, main): Declare variables where they
are used instead of at the start of the block.
2025-12-10 18:50:53 -08:00
Collin Funk
71250b2772 maint: mv: reduce variable scope
* src/mv.c (do_move, main): Declare variables where they are used
instead of at the start of a block.
2025-12-10 18:50:53 -08:00
Pádraig Brady
ef613e2a76 tests: env: add a test for --ignore-signal=PIPE
* tests/env/env-signal-handler.sh: Add a test for this
oft interfered with signal.
2025-12-10 22:41:42 +00:00
Pádraig Brady
f01195cf98 doc: support html post processing in all cases
Previously the html-local make rule only worked for `make html`.
Instead add support for `make doc/coreutils.html` or `make web-manual`
through the use of a makeinfo wrapper.

* doc/local.mk: Move post processing from here to ...
* build-aux/makeinfo-wrapper.sh: ... here.
* cfg.mk: Ensure our wrapper is called with MAKEINFO.
Also pass --no-node-files so redirection html files
are not created for each anchor.
2025-12-10 16:02:30 +00:00
Collin Funk
828073db6b doc: printf: mention how to print arguments starting with '-'
* doc/coreutils.texi (printDash): New macro.
(printf invocation, yes invocation): Use it.
Addresses https://bugs.gnu.org/79896
2025-12-09 18:45:22 -08:00
Pádraig Brady
15092bd518 doc: fix stale linuxjournal.com link
* doc/coreutils.texi: Update to working link.
Fixes https://bugs.gnu.org/79973
2025-12-09 14:10:58 +00:00
Collin Funk
d1ac0f86b5 doc: html: fix build with parallel make
* doc/local.mk (html-local): Add html files to prerequisites so they are
generated before 'sed' is invoked.  Also interate over the already
populated $(HTMLS) to be more general (to multiple html files),
and more portable (to non GNU make).
2025-12-09 13:23:28 +00:00
Pádraig Brady
2692d599ec tests: fix non-portable use of printf '\x..'
* tests/dd/conv-case.sh: Use octal instead.
* tests/ls/hyperlink.sh: Likewise.
* tests/sort/sort-locale.sh: Likewise.
2025-12-08 22:32:48 +00:00
Pádraig Brady
0013f0e2ad doc: fix pdf generation
* doc/coreutils.texi: Explicitly supply empty arguments to macros,
as dvi (a required prerequisite to pdf) is more strict in its
handling of macro arguments.
* cfg.mk (sc_texi_ensure_empty_option_args): Add a syntax check,
since this is not verified in the default build.
Reported by Collin Funk.
2025-12-08 14:36:24 +00:00
Collin Funk
cc3cb220c3 maint: env: reduce variable scope
* src/env.c (extract_varname, parse_signal_action_params)
(parse_block_signal_params, set_signal_proc_mask)
(list_signal_handling, main): Declare variables where they are used
instead of at the start of the function.
2025-12-07 15:48:15 -08:00
Collin Funk
5af9ffed32 maint: nohup: reduce variable scope
* src/nohup.c (main): Declare variables where they are used instead of
at the start of the function.
2025-12-07 15:47:24 -08:00
Collin Funk
d213c625ac maint: sync: reduce variable scope
* src/sync.c (sync_arg, main): Declare variables where they are used
instead of at the start of the function.
2025-12-07 15:35:48 -08:00
Collin Funk
881ac237be maint: pwd: reduce variable scope
* src/pwd.c (find_dir_entry, robust_getcwd): Declare variables where
they are used.
(logical_getcwd, main): Likewise. Constify the result of getenv, since
the result cannot be modified.
2025-12-07 15:35:16 -08:00
Collin Funk
8af2d813b9 maint: dirname: reduce variable scope
* src/dirname.c (main): Declare variables where they are used instead of
at the start of the function. Prefer idx_t to size_t.
2025-12-07 15:17:21 -08:00
Collin Funk
2880332ada maint: hostid: reduce variable scope
* src/hostid.c (main): Declare variables where they are used instead of
at the start of the function.
2025-12-07 15:11:55 -08:00
Collin Funk
dd2a113f5f maint: nproc: reduce variable scope
* src/nproc.c (main): Declare variables where they are used instead of
at the start of the function.
2025-12-07 15:06:24 -08:00