Commit graph

16146 commits

Author SHA1 Message Date
Daniel Hofstetter
7dc20bbdb0 touch: adapt tests to changes in parse_datetime 2025-08-01 10:23:30 +02:00
Daniel Hofstetter
7d8c58ad36 Bump parse_datetime from 0.9.0 to 0.11.0 2025-08-01 09:47:49 +02:00
Daniel Hofstetter
9938db39bc
Merge pull request #8333 from sylvestre/selinux-mv
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
mv: add support for selinux and add minor refactor
2025-08-01 09:36:06 +02:00
Dorian Péron
d90f3a4ec3
Merge pull request #8416 from drinkcat/cp-attr
Some checks are pending
CICD / Build (push) Blocked by required conditions
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
`cp`: Properly preserves fifos and symlink attributes
2025-07-31 18:04:17 +02:00
Dorian Péron
a051ce063c
Merge pull request #8420 from cakebaker/pr_improve_fn
pr: reduce nesting to improve readability of `file_last_modified_time_format()`
2025-07-31 17:56:34 +02:00
Sylvestre Ledru
6e930966fb selinux: introduce get_getfattr_output to verify the output of getfatt 2025-07-31 17:45:34 +02:00
Sylvestre Ledru
ad8fdbdb77 mv: implement selinux options (-Z/--context) 2025-07-31 17:45:34 +02:00
Daniel Hofstetter
1e50dc4c33 pr: reduce nesting to improve readability
of file_last_modified_time_format()
2025-07-31 17:00:28 +02:00
Daniel Hofstetter
7003b1d3fc
Merge pull request #8418 from drinkcat/pr-time
pr: Add support for -D/--date-format parameter
2025-07-31 16:34:44 +02:00
Nicolas Boichat
82cb88ac0d test_pr: Use new_ucmd!() directly 2025-07-31 22:08:56 +08:00
Nicolas Boichat
bdedd24e06
pr: Move vector creation
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-07-31 22:05:35 +08:00
Daniel Hofstetter
b5f453a562
Merge pull request #8417 from drinkcat/du-ls-time-test
ls: -u/-c/--time control sorting when -l is not used
2025-07-31 15:55:40 +02:00
Nicolas Boichat
2a80c83495
Merge pull request #8419 from cakebaker/rm_interactive_arguments
Some checks failed
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/nightly (push) Blocked by required conditions
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
CheckScripts / ShellScript/Check (push) Has been cancelled
CheckScripts / ShellScript/Format (push) Has been cancelled
rm: support the `--interactive` arg aliases
2025-07-31 17:09:42 +08:00
Daniel Hofstetter
194aa89d63 rm: implement From for InteractiveMode 2025-07-31 09:49:27 +02:00
Daniel Hofstetter
f33244321a rm: use clap to handle --interactive args 2025-07-31 09:49:05 +02:00
Nicolas Boichat
d35a60e5e2 pr: Add support for -D/--date-format parameter 2025-07-31 15:45:31 +08:00
Nicolas Boichat
4878e65ea7 pr: Set date format depending on environment.
Based on GNU manual.
2025-07-31 15:45:31 +08:00
Nicolas Boichat
149529a494 pr: Switch to uucore::time formatting 2025-07-31 15:45:31 +08:00
Nicolas Boichat
ec11b68543 ls: -u/-c/--time control sorting when -l is not used
Fallback on those flags if --sort is not otherwise set.
2025-07-31 09:00:15 +02:00
Sylvestre Ledru
f877f64362
Merge pull request #8415 from drinkcat/duls-time
`du`/`ls`: Improve time-style handling based on GNU coreutils manual
2025-07-31 08:58:34 +02:00
Nicolas Boichat
f4bf8987cd
tests/by-util/test_cp.rs: Merge #[cfg]
Co-authored-by: Dorian Péron <72708393+RenjiSann@users.noreply.github.com>
2025-07-30 21:04:03 +08:00
Nicolas Boichat
4b11692db3 cp: Also copy attributes in copy_symlink
Most attributes can actually be applied to symlinks (mode and
xattr are exceptions), so try to copy them, if possible.

Fort those 2 exceptions, we don't need any special handling as:
 - Mode errors would be ignored anyway.
 - The source symlink cannot have any xattr anyway, so no
   attribute is attempted to be set on the destination.
2025-07-30 20:03:22 +08:00
Nicolas Boichat
b13bf37f7b util/build-gnu.sh: Change string matching for tests/ls/time-style-diag.sh
We now are closer to what GNU prints, and handle the [posix-] cases
that they do.
2025-07-30 19:45:29 +08:00
Nicolas Boichat
4cb57fb7ac ls: cleanup imports
They were a bit jumbled with no particular logic, at least that
I could see.
2025-07-30 17:59:52 +08:00
Nicolas Boichat
4ba8d3e0a9 ls: Fix Windows build 2025-07-30 17:58:39 +08:00
Nicolas Boichat
4d48626eeb cp: File logic error when preserving attributes for fifos
There was a mismatch between the test, the comment, and the code.

The intention was to _preserve_ attributes if the source of a
fifo/pipe still exists. Perhaps the clearest way is to modify
the test (as that avoids code duplication).

Also add a basic test for that, if permissions are preserved, the
rest should also be preserved correctly.

Fixes the first part of #8402.
2025-07-30 17:37:51 +08:00
Nicolas Boichat
2d63020cd9 du: Add support for reading time-style from environment
Similar as what ls does, but du has an extra compatibility layer
described in the GNU manual (and that upstream dev helped me
understand: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79113 ).
2025-07-30 17:27:22 +08:00
Nicolas Boichat
b99615c1e3 du/ls: Move common time formats to constants in uucore/time
Along the way:
 - Fix the full-iso format, that was supposed to use %N, not %f
   (%f padded with chrono, but not with jiff, and %N is more correct
   and what GNU says in their manual)
 - The Hashmap thing in parse_time_style was too smart, to a point
   that it became too unflexible (it would have been even worse
   when we added locale support).

I was hoping the share more of the code, but that seems difficult.
2025-07-30 17:27:22 +08:00
Nicolas Boichat
1272bfc222 du: Add support for +FORMAT time-style
Also add to error text, which... GNU coreutils doesn't do for
some reason.
2025-07-30 17:27:22 +08:00
Nicolas Boichat
fc08fa1d62 ls: Print dates in the future as "old" ones
ls has different time format for recent (< 6 months) and older files.
Files in the future (even by just a second), are considered old,
which makes sense as we probably want the date to be printed in
that case.
2025-07-30 17:27:22 +08:00
Nicolas Boichat
4901f370cb ls: Add support for newline separated format for recent/older
Documented in GNU manual.

Also improve test_ls to test for both recent and older files.
2025-07-30 17:27:22 +08:00
Nicolas Boichat
e5f2f79ea1 ls: Allow reading time-style from TIME_STYLE environment variable
According to GNU manual.
2025-07-30 17:27:22 +08:00
Nicolas Boichat
a1519e1b74 ls: Add support for --time-style=posix-*
From GNU manual, if LC_TIME=POSIX, then the "locale" timestamp is
used. Else, `posix-` is stripped and the format is parsed as usual.

Also, just move the whole text to the locale file, instead
of trying to generate it manually.
2025-07-30 17:27:20 +08:00
Sylvestre Ledru
e48c4a7b96
Merge pull request #8398 from drinkcat/stat-bigtime
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Build (push) Blocked by required conditions
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
`stat`: Convert to use `uucore` functions
2025-07-30 10:18:23 +02:00
Sylvestre Ledru
a055e856dd
fix rustfmt 2025-07-30 09:51:14 +02:00
Sylvestre Ledru
e68f73489c
Merge branch 'main' into stat-bigtime 2025-07-30 09:29:19 +02:00
Daniel Hofstetter
4a68e3d05c
Merge pull request #8414 from uutils/renovate/clap-4.x-lockfile
chore(deps): update rust crate clap to v4.5.42
2025-07-30 07:46:53 +02:00
renovate[bot]
4b37f6d48d
chore(deps): update rust crate clap to v4.5.42 2025-07-30 05:04:00 +00:00
Dorian Péron
2307a353ea
Merge pull request #8406 from amirhosseinghanipour/refactor-mkdir-mode-parsing
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Build/nightly (push) Blocked by required conditions
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
refactor(mkdir): Simplify mode argument parsing
2025-07-29 22:02:34 +02:00
Dorian Péron
614531d13c
Merge branch 'main' into refactor-mkdir-mode-parsing 2025-07-29 22:01:53 +02:00
Sylvestre Ledru
35610ba146
Merge pull request #8413 from cakebaker/mv_improve_is_empty_dir
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
mv: use `next()` instead of `peekable().peek()` in `is_empty_dir()`
2025-07-29 17:25:47 +02:00
Sylvestre Ledru
3a214f2842
Merge branch 'main' into refactor-mkdir-mode-parsing 2025-07-29 16:54:15 +02:00
Daniel Hofstetter
000be5b73a mv: use next() instead of peekable().peek()
in is_empty_dir()
2025-07-29 16:52:06 +02:00
Amirhossein Ghanipour
8c9e739694 refactor(mkdir): Simplify mode argument parsing 2025-07-29 15:11:35 +03:30
Daniel Hofstetter
790852ff9a
Merge pull request #8403 from sylvestre/ls-others
ls: improve the test when running selinux
2025-07-29 12:51:54 +02:00
Sylvestre Ledru
386acd00d6
Merge pull request #8412 from julian-klode/fix-install-no-target-existing-target
install: Fix --no-target-directory with existing file
2025-07-29 12:46:40 +02:00
Julian Andres Klode
190ddd105c install: Fix --no-target-directory with existing file
install should silently override existing target files, but it
inadvertently checked whether the target exists rather than
for the target being a directory, hence the overwrite failed,
saying it cannot overwrite the directory with non-directory.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/2118785
2025-07-29 12:24:31 +02:00
Jonas Jelten
79bbf52a21
Merge pull request #8343 from TheJJ/fix-mknod-mode
mknod: set cli specified file mode even when it's 0o666
2025-07-29 11:53:21 +02:00
Sylvestre Ledru
33a3f734a7
Merge pull request #8405 from sylvestre/tz-deprecated
date: update deprecated TZ
2025-07-29 11:35:05 +02:00
Dorian Péron
0fac1cd00b
Merge pull request #8411 from cakebaker/who_rename_var
who: rename var, cleanup spell-checker:ignore
2025-07-29 11:15:43 +02:00