Commit graph

16159 commits

Author SHA1 Message Date
Sylvestre Ledru
1d20d71dc2
Merge pull request #8432 from drinkcat/clippy-fix
Some checks are pending
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 / Test all features separately (push) Blocked by required conditions
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
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
uucore: locale: Fix clippy warning
2025-08-05 08:49:50 +02:00
Nicolas Boichat
6eff5c9aee uucore: locale: Fix clippy warning 2025-08-05 13:24:01 +08:00
Daniel Hofstetter
45457cf718
Merge pull request #8428 from uutils/renovate/notify-8.x
Some checks are pending
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
Android / Test builds (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
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
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
chore(deps): update rust crate notify to v8.2.0
2025-08-04 07:53:02 +02:00
renovate[bot]
0195813dcb
chore(deps): update rust crate notify to v8.2.0 2025-08-03 16:57:49 +00:00
Daniel Hofstetter
4e311ed89b
Merge pull request #8423 from sylvestre/en-embedded
Some checks are pending
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/Python (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/toml (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
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
WSL2 / Test (push) Waiting to run
l10n: embedded english strings + test the whole thing in github
2025-08-03 15:08:10 +02:00
Martin Kunkel
3b4b769976
tests: fix execution on WSL2, Ubuntu 24.04 (#8235)
* tests: fix execution on WSL2, Ubuntu 24.04

Skip incompatible parts of tests to ensure that
    cargo nextest run --features unix
executes successfully in WSL2, Ubuntu 24.04 distribution.

Changes
* Skip tests that required sys/kernel/profiling which is not
available in WSL2 default configuration.
* Use timezones in tests that are part of the standard tzdata
list and not only available in backwards list. Backwards list is
not installed by default in Ubuntu 24.04 (package tzdata-legacy).
* check that /proc/modules is not empty when expecting content,
because it is empty in WSL2 default configuration.
* Skip logname test not only in WSL1, also in WSL2.

* Add workflow for WSL2

This will setup WSL2 on windows-latest runner, install
Ubuntu-24.04, and run the feat_os_unix tests.

* wsl2: implemented review findings

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-08-03 14:38:49 +02:00
Sylvestre Ledru
df2fca588c l10n: when built indiv, only embed the relevant locale file 2025-08-03 10:59:38 +02:00
Sylvestre Ledru
afa0f00e90 l10n: update of the doc 2025-08-03 10:59:38 +02:00
Sylvestre Ledru
a432fe811f l10n: use the embedded english strings when relevant 2025-08-03 10:59:38 +02:00
Sylvestre Ledru
f1b377fa99 l10n: embedded the english strings at build time 2025-08-01 13:55:27 +02:00
Sylvestre Ledru
6d574d94f9 make: improve the installation of the fluent files 2025-08-01 13:55:27 +02:00
Sylvestre Ledru
038ad04ca9 github/action: add jobs to verify that l10n works 2025-08-01 13:55:27 +02:00
Sylvestre Ledru
cf796758be
Merge pull request #8424 from cakebaker/bump_parse_datetime
Some checks failed
FreeBSD / Style and Lint (push) Has been cancelled
CICD / Style/cargo-deny (push) Has been cancelled
CICD / Style/deps (push) Has been cancelled
CICD / Documentation/warnings (push) Has been cancelled
CICD / MinRustV (push) Has been cancelled
CICD / Dependencies (push) Has been cancelled
CICD / Code Coverage (push) Has been cancelled
CICD / Separate Builds (push) Has been cancelled
GnuTests / Run GNU tests (native) (push) Has been cancelled
GnuTests / Run GNU tests (SELinux) (push) Has been cancelled
Android / Test builds (push) Has been cancelled
Code Quality / Pre-commit hooks (push) Has been cancelled
Code Quality / Style/format (push) Has been cancelled
Code Quality / Style/lint (push) Has been cancelled
Code Quality / Style/spelling (push) Has been cancelled
Code Quality / Style/toml (push) Has been cancelled
Code Quality / Style/Python (push) Has been cancelled
FreeBSD / Tests (push) Has been cancelled
CICD / Test all features separately (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
CICD / Build/nightly (push) Has been cancelled
CICD / Build/Makefile (push) Has been cancelled
CICD / Build/stable (push) Has been cancelled
CICD / Binary sizes (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Tests/BusyBox test suite (push) Has been cancelled
CICD / Tests/Toybox test suite (push) Has been cancelled
GnuTests / Aggregate GNU test results (push) Has been cancelled
Bump `parse_datetime` & adapt `touch` tests
2025-08-01 12:50:52 +02:00
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