Commit graph

9058 commits

Author SHA1 Message Date
Daniel Hofstetter
1263ba20be
Merge pull request #8932 from Ada-Armstrong/df_env_var_zero_block_size
df: treat env var with zero block size same as invalid
2025-10-17 16:16:48 +02:00
Christopher Armstrong
6015c8fa31 df: treat env var with zero block size as invalid 2025-10-17 09:32:37 -04:00
Christopher Armstrong
3ec3849739 uucore: add parse_size_non_zero_u64 which fails parsing 0 2025-10-17 09:29:56 -04:00
Sylvestre Ledru
a255a1f3db
Merge pull request #8939 from naoNao89/fix/sort-benchmark-variance
Some checks failed
CICD / Separate Builds (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 / 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 / Safe Traversal Security Check (push) Blocked by required conditions
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Has been cancelled
Reduce variance in sort benchmarks by reusing temp file
2025-10-17 14:56:48 +02:00
naoNao89
607383a2f9 bench(sort): reduce variance by reusing output files across iterations
Locale benchmarks were creating temp files inside the bench loop (from d1cd9998be), causing filesystem noise and false CodSpeed regressions. The same commit's sort_bench.rs got it right with file creation outside the loop. This fix aligns with that pattern.
2025-10-17 19:10:00 +07:00
Daniel Hofstetter
0258583aac
Merge pull request #8849 from sylvestre/od-n
od: add support for -S
2025-10-17 10:03:28 +02:00
Sylvestre Ledru
c1d9fc3c7d od: translate some strings 2025-10-16 06:13:54 -04:00
Sylvestre Ledru
fd75c37222 od: dedup some code 2025-10-16 06:13:45 -04:00
Sylvestre Ledru
b1afe3499a fix tests/od/od-N 2025-10-16 06:13:45 -04:00
alexander
6e422b728e
df: add tracing zero and rounding (#8685)
Some checks failed
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 / 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
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (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
Benchmarks / Run benchmarks (CodSpeed) (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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Has been cancelled
2025-10-15 22:11:44 -04:00
alexander
517b5fb8b3
hostname: fix -d flag (#8657)
* hostname: fix -d flag

* tests/hostname: test -d when no domain
2025-10-15 22:07:54 -04:00
Cả thế giới là Rust
88bc1c5fc3
Merge pull request #8911 from naoNao89/fix-dirname-trailing-dot
Fix dirname handling of paths ending in `/.`
2025-10-15 20:19:14 -04:00
Christopher Armstrong
37d00ae89b cp: display symlink creation with --verbose
cp: display removed files with --verbose
2025-10-15 22:30:27 +01:00
Sylvestre Ledru
e2e5c76a7c
Merge pull request #8907 from naoNao89/fix/date-numeric-d-parsing
Some checks failed
CICD / MinRustV (push) Has been cancelled
CICD / Separate Builds (push) Has been cancelled
CICD / Dependencies (push) Has been cancelled
CICD / Code Coverage (push) Has been cancelled
Android / Test builds (push) Has been cancelled
GnuTests / Run GNU tests (native) (push) Has been cancelled
GnuTests / Run GNU tests (SELinux) (push) Has been cancelled
Benchmarks / Run benchmarks (CodSpeed) (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
Code Quality / Pre-commit hooks (push) Has been cancelled
Devcontainer / Verify devcontainer (push) Has been cancelled
FreeBSD / Style and Lint (push) Has been cancelled
FreeBSD / Tests (push) Has been cancelled
WSL2 / Test (push) Has been cancelled
CICD / Binary sizes (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Test all features separately (push) Has been cancelled
CICD / Build/Makefile (push) Has been cancelled
CICD / Build/stable (push) Has been cancelled
CICD / Build/nightly (push) Has been cancelled
CICD / Tests/BusyBox test suite (push) Has been cancelled
CICD / Tests/Toybox test suite (push) Has been cancelled
CICD / Safe Traversal Security Check (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
CICD / Build/SELinux-Stubs (Non-Linux) (push) Has been cancelled
GnuTests / Aggregate GNU test results (push) Has been cancelled
date: follow GNU pure-number -d semantics
2025-10-14 12:29:29 +02:00
Daniel Hofstetter
58f32648d7
Merge pull request #8900 from Alonely0/clippy
chore: huge clippy pass ahead of 1.92.0 release
2025-10-14 10:45:47 +02:00
naoNao89
0047c7e66f fix(date): align pure-digit -d parsing with GNU semantics
Implement GNU 'Pure numbers in date strings' for time-of-day tokens:
- 1–2 digits => HH:00 today
- 3–4 digits => HHMM today
- Validate ranges; reject invalid times (e.g., 2400, 2360)

Also:
- Add tests for -d0, -d7, -d0700 under TZ=UTC0 and invalid numeric inputs
- Reference GNU manual section for pure numbers
2025-10-14 11:42:38 +07:00
Andrew Gaul
5274576311 Include subsecond precision in stat atime/ctime
Previously only mtime supported this.  Follows on to
1d0dcb5962.  References #3233.
References s3fs-fuse/s3fs-fuse#2740.
2025-10-13 10:54:42 -07:00
Guillem L. Jara
3a77bf40b8 chore: huge clippy pass ahead of 1.92.0 release 2025-10-13 18:06:35 +02:00
Cả thế giới là Rust
16af7d4f9a
ls: Implement -f flag to disable sorting and enable -a (#8824)
* ls: implement -f flag with correct constant, color logic, and localization

Fix the -f flag implementation to properly enable all files display,
disable sorting, and handle color output correctly.

Changes:
- Correct UNSORTED_ALL constant from 'unsorted-all' to 'f'
- Fix color logic to honor explicit --color flag regardless of -f position
- Add French localization for ls-help-unsorted-all
- Add comprehensive integration tests for -f flag behavior

The explicit --color flag now always takes precedence over -f implicit
color disabling, matching expected CLI behavior.

* tests(ls): improve -f flag test assertions

Address maintainer feedback from PR #8824 review:

1. test_f_flag_disables_sorting: Compare -f output with -a (sorted) and -U (unsorted)
   to prove sorting is actually disabled, not just that files appear in output

2. test_f_overrides_big_a: Rename from test_f_overrides_a_and_big_a and fix assertions
   to check for .. presence (distinguishes -f from -A) instead of .hidden (shown in both)

3. test_f_overrides_sort_flags: Use size-based files and explicit output comparisons
   to verify last-flag-wins behavior with deterministic ordering

4. test_big_u_overrides_f_sort: Use size-based files and verify -U participates
   in last-flag-wins by checking actual output order

All tests now properly validate flag interactions instead of just checking file presence.

* refactor(ls): use match expression in extract_sort

Replace if/else chain with match expression for improved readability
and more idiomatic Rust code. Uses match guards for index comparisons.

Addresses maintainer feedback from PR #8824 review.

No functional changes - behavior remains identical.

* fix(ls): use snake_case for test variable names

Follow Rust naming conventions by converting variable names in -f flag
tests from mixed case (out_Af, out_fS, etc.) to snake_case (out_a_f,
out_f_s, etc.). This eliminates clippy warnings about non_snake_case
identifiers.

* tests: fix flaky ls tests that depend on filesystem directory order

The tests test_f_flag_disables_sorting, test_big_u_overrides_f_sort, and
test_f_overrides_sort_flags made incorrect assumptions that unsorted
directory order would always differ from sorted order. However,
fs::read_dir() returns entries in filesystem-dependent order which may
accidentally match sorted order on some filesystems.

Changes:
- Removed assertions comparing unsorted vs sorted outputs
- Added deterministic checks (e.g., verifying --sort after -f works)
- Added explicit order verification for size-sorted outputs
- Tests now verify flag precedence without relying on directory order

Fixes CI failures on Windows and SELinux platforms.

Quality checks passed:
- cargo fmt --check: ✓
- cargo clippy --test tests: ✓
- all 3 modified tests pass: ✓

* test: fix misleading test name for -U flag behavior

Renamed test_big_u_overrides_f_sort to test_big_u_participates_in_sort_flag_wins
to accurately reflect that it tests -U with -S interactions, not -f.
2025-10-13 09:42:25 +02:00
Mahdi Ali-Raihan
2ba4e39b82 uucore: ringbuffer pre-allocates memory based on size given 2025-10-12 18:46:41 -04:00
Sylvestre Ledru
36ca7bc444
Merge pull request #8894 from cakebaker/clippy_fix_manual_let_else
Some checks are pending
CICD / Separate Builds (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 / 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 / Safe Traversal Security Check (push) Blocked by required conditions
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (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
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Android / Test builds (push) Waiting to run
FreeBSD / Style and Lint (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 / Pre-commit hooks (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
clippy: re-enable `manual_let_else` lint
2025-10-12 23:09:04 +02:00
Ahmed hossam
d79c18a693
Merge pull request #8791 from dekuu5/stat/fix-symlink-behavior
Some checks are pending
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 / 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
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (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
Benchmarks / Run benchmarks (CodSpeed) (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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
stat: fix %N symlink to be single quote instead of double quote
2025-10-12 18:40:54 +02:00
Daniel Hofstetter
fa4837bbb1 clippy: re-enable manual_let_else lint 2025-10-12 17:13:10 +02:00
Sylvestre Ledru
f253efefaa
prepare version 0.3.0 (#8890)
Some checks failed
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 / 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 / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (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
Benchmarks / Run benchmarks (CodSpeed) (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
Devcontainer / Verify devcontainer (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
CheckScripts / ShellScript/Check (push) Has been cancelled
CheckScripts / ShellScript/Format (push) Has been cancelled
* prepare version 0.3.0

* also update uu_stdbuf_libstdbuf

* also update fuzz
2025-10-12 13:31:16 +02:00
Sylvestre Ledru
78667275e6
Merge pull request #8746 from jacob-greenfield/sort-fix-buffer-read
sort: fix newline handling across large and/or multiple files
2025-10-11 18:37:36 +02:00
Sylvestre Ledru
cc3a6a4b54
Merge pull request #8566 from sylvestre/fix-publishing
stdbuf: fix a publish issue
2025-10-11 17:53:31 +02:00
Christopher Ada Armstrong
7e12383fcf
cp: show relative path of source file with -vr (#8887)
* cp: show relative path of source file with -vr

Add test to cover fix.

* fix test expected output for windows
2025-10-11 17:30:19 +02:00
Jacob Greenfield
3651d73a40 sort: add test for sorting a file which triggers a buffer resize 2025-10-11 16:35:10 +02:00
Jacob Greenfield
72b70a9387 sort: do not search previously-read characters for newlines 2025-10-11 16:35:10 +02:00
Jacob Greenfield
b6f4243fa7 sort: fix logic for inserting newline between files 2025-10-11 16:35:10 +02:00
Sylvestre Ledru
20a05bdb0d sort: add a bench for long line 2025-10-11 15:46:52 +02:00
Sylvestre Ledru
097e620cf7 cut: add benchmarks 2025-10-10 23:23:07 +02:00
Sylvestre Ledru
7a988bf782 split: add benchmarks 2025-10-10 23:21:55 +02:00
Sylvestre Ledru
5143999c8a seq: add benchmarks 2025-10-10 23:21:55 +02:00
Sylvestre Ledru
ece2a68383 rm: add benchmarks 2025-10-10 23:21:55 +02:00
Sylvestre Ledru
710cdb2abf mv: add benchmarks 2025-10-10 23:21:55 +02:00
Sylvestre Ledru
edface9c7e hashsum: add benchmarks 2025-10-10 23:21:55 +02:00
Daniel Hofstetter
daa828b270
Merge pull request #8864 from Alonely0/fix_cp
cp: fix crash on -T/--no-preserve-target
2025-10-10 16:37:16 +02:00
mattsu
1c29075b01
Fix ln -f handling when source and destination are the same entry (#8838)
* fix(ln): enhance same-file detection with canonical paths

Improved the `link` function in `ln.rs` to use canonical path resolution for accurate same-file detection when forcing overwrites, preventing incorrect errors for equivalent paths. Added tests to verify behavior for self-linking and hard link relinking scenarios.

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-10-10 13:28:10 +02:00
Guillem L. Jara
9a8c8a58a9 cp: remove unnecessary unwrap 2025-10-10 09:57:54 +02:00
Guillem L. Jara
751ddfb62f cp: fix path resolution on -T
Fixed a couple of bugs: firstly, one where cp would error out when providing -T on some cases where the assumption of a prefix on the destination path was false; the second one was a logic error in which cp would not respect -T if the destination directory was provided with a terminator slash or (presumably, on Windows/DOS) a backslash.
2025-10-10 09:43:32 +02:00
Daniel Hofstetter
19284dec18 seq: fix warnings from workspace lints 2025-10-09 17:42:07 +02:00
Daniel Hofstetter
5b5eed4bbd clippy: move unexpected_cfgs to workspace lints
and use workspace lints in seq
2025-10-09 17:42:06 +02:00
Daniel Hofstetter
61df13a2ce clippy: move use_self lint to workspace lints 2025-10-07 14:49:39 +02:00
Daniel Hofstetter
cd2e64d48f
Merge pull request #8820 from Misakait/fix/reference-calculate
Some checks are pending
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 / 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
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (push) Blocked by required conditions
CICD / Run benchmarks (CodSpeed) (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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
fix(ptx): Align text wrapping behavior with GNU in traditional mode
2025-10-07 09:19:11 +02:00
Daniel Hofstetter
802e25cc62 unexpand: add support for non-utf8 filenames 2025-10-07 07:32:52 +02:00
Sylvestre Ledru
33ac2cf6e9 base58: it wasn't working properly with long input 2025-10-06 15:53:56 +02:00
Sylvestre Ledru
5cbe2cc3a9 CI: unbreak the l10n job 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
fba43f4330 improve code 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
5551c6a7ec Fix the last rm tests + add tests 2025-10-06 13:58:00 +02:00