Sylvestre Ledru
809e75cf39
Merge pull request #8401 from drinkcat/selinux-fifo-symlinks
...
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/toml (push) Waiting to run
Code Quality / Style/Python (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 / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
selinux: Fix get_context on fifos (and symlinks)
2025-07-28 09:40:05 +02:00
Nicolas Boichat
49b2466a9c
uucore: selinux: Add tests for symlinks and fifo
...
Check that we can follow (or not) symlinks to get their SElinux context.
Also, check that we can get context from a fifo (we used to hang).
2025-07-28 15:08:21 +08:00
Nicolas Boichat
8752c0c098
uucore: selinux: Use of_path instead of open+of_file
...
Opening a pipe may just hang forever, and is not needed to get
selinux context.
Also, pass around follow_symbolic_links parameter from stat to of_path.
2025-07-28 15:08:05 +08:00
Daniel Hofstetter
8236bcff28
Merge pull request #8400 from uutils/renovate/ctor-0.x-lockfile
...
chore(deps): update rust crate ctor to v0.4.3
2025-07-28 07:09:38 +02:00
renovate[bot]
f71450a0fd
chore(deps): update rust crate ctor to v0.4.3
2025-07-27 19:08:49 +00:00
Nicolas Boichat
b4c6ad1b33
CI: GnuTests: Split native and selinux tests to 2 different jobs ( #8388 )
...
CICD / Build (push) Blocked by required conditions
CICD / Test all features separately (push) Blocked by required conditions
CICD / Style/deps (push) Waiting to run
CICD / Style/cargo-deny (push) Waiting to run
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
* .github/workflows/GnuTests.yml: Move variables to env
Will make it easier to split the work into 2 jobs.
* .github/workflows/GnuTests.yml: Move all Selinux steps to a separate job
* .github/workflows/GnuTests.yml: Create a new summary job
That aggregates between native and selinux results.
* .github/workflows/GnuTests.yml: Fix log uploading
This... didn't work, even in the previous version.
(found by Gemini...)
* .github/workflows/GnuTests.yml: Improve aggregate
Variables don't always help make things clearer.
* .github/workflows/GnuTests.yml: Make selinux and native flow identical
Also add some headers to make things easier to follow.
* .github/workflows/GnuTests.yml: More misc cleanup
In particular, SELinux flow is simplified, and fixed.
Also fix artifact download name.
* .github/workflows/GnuTests.yml: Fix aggregate job
2025-07-27 21:06:50 +02:00
Sylvestre Ledru
0f403021b0
Merge pull request #8399 from cakebaker/uucore_fs_create_single_string
...
uucore/fs: call `to_string_lossy` only once in `dir_strip_dot_for_creation`
2025-07-28 00:34:43 +09:00
Daniel Hofstetter
69f671466f
uucore/fs: call to_string_lossy only once
...
in dir_strip_dot_for_creation
2025-07-27 16:27:43 +02:00
Daniel Hofstetter
64ba35b7f7
Merge pull request #8396 from drinkcat/du-bigtime
...
CICD / Style/cargo-deny (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 / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Test all features separately (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 (push) Waiting to run
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
`du`/`ls`: Unify file metadata time handling
2025-07-27 14:34:55 +02:00
Daniel Hofstetter
5244b5e0f5
Merge pull request #8397 from uutils/renovate/rstest-0.x-lockfile
...
chore(deps): update rust crate rstest to v0.26.1
2025-07-27 13:35:41 +02:00
renovate[bot]
2371542b01
chore(deps): update rust crate rstest to v0.26.1
2025-07-27 10:31:27 +00:00
Nicolas Boichat
b8d81adcff
du/test_du: Fix ctime fallback on Windows, and test
2025-07-27 12:57:28 +08:00
Nicolas Boichat
96438f2086
test_du: Fix --time=ctime test
...
It turns out `du` used to test for the wrong thing, `ctime` is
the change timestamp, not creation time.
We have to rely on a regex again, as the change timestamp is the
current time.
2025-07-27 10:57:07 +08:00
Nicolas Boichat
8913108dba
uucore: fsext: Deduplicate metadata_get_time
...
Easier to just move the change time logic to another function.
2025-07-27 10:36:59 +08:00
Nicolas Boichat
47aff05375
uucore: fsext: Provide From<&str> helper for MetadataTimeField
...
We assume that the string has been validated by clap ahead of
time (just like the current code does).
2025-07-27 10:36:59 +08:00
Nicolas Boichat
8985afa284
du: Simplify Stat creation further
...
No need to have separate struct creation code for Windows and Unix.
Also remove is_dir, we can get it from metadata.
2025-07-27 09:19:51 +08:00
Nicolas Boichat
51dbe090a0
du: Keep metadata in Stat, and make use of uucore::fsext::metadata_get_time
...
Removes some duplicated code, with slight, but incorrect, differences.
2025-07-27 09:19:51 +08:00
Nicolas Boichat
b1efa05d59
uucore: fsext: Move metadata_get_time from ls
...
This function is useful for more than `ls` (`du` can use it too).
2025-07-27 09:19:51 +08:00
Sylvestre Ledru
d4034047a5
Merge pull request #8393 from cakebaker/od_improve_file_names
...
CICD / Style/cargo-deny (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 / 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 / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
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
od: use underscores in filenames, adapt modules
2025-07-27 08:49:48 +09:00
Sylvestre Ledru
06a422338e
Merge pull request #8394 from uutils/renovate/rstest-0.x
...
chore(deps): update rust crate rstest to 0.26.0
2025-07-27 08:49:00 +09:00
Sylvestre Ledru
0eecc5f379
Merge pull request #8379 from drinkcat/makefiles-locales-after
...
Makefile: Copy locales _after_ build
2025-07-27 08:48:50 +09:00
Sylvestre Ledru
ded761d334
Merge pull request #8390 from drinkcat/ls-bigtime
...
CICD / Style/cargo-deny (push) Waiting to run
CICD / Test all features separately (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 / Build (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 (push) Waiting to run
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
du/ls: Merge date formatting code, and handle timestamps far in the future/past by just printing them
2025-07-27 08:01:29 +09:00
renovate[bot]
001a91fbe6
chore(deps): update rust crate rstest to 0.26.0
2025-07-26 22:00:01 +00:00
Nicolas Boichat
f327174539
.github/workflows: Check that target/CACHEDIR.TAG is created
...
There was a small bug in `Makefile` that caused the `target`
directory to be created by `install`, not `cargo`, which
lead to a missing `target/CACHEDIR.TAG`.
Test for that in CI, so that the issue does not recur.
2025-07-26 23:40:13 +08:00
Nicolas Boichat
d1c07806a8
uucore: time: Add show_error parameter to format_system_time
...
du prints a warning when the time is out of bounds.
2025-07-26 22:54:26 +08:00
Nicolas Boichat
64565ba0d6
du: convert to use uucore time formatting function
...
Indirectly switches to jiff, which conveniently doesn't crash on
large timestamps. Also correctly prints timestamp for time far in
the future or past.
Removes chrono dependency.
2025-07-26 22:54:09 +08:00
Nicolas Boichat
7cd4907719
Makefile: Copy locales _after_ build
...
When creating the `target` directory, `cargo` also creates
`target/CACHEDIR.TAG` which is important for backup tools to
know to ignore the directory.
This doesn't happen if something else creates the `target`
directory (e.g. `locales` Makefile target).
Swap the execution order to fix this.
2025-07-26 16:53:56 +08:00
Daniel Hofstetter
f60b310b6c
od: use underscores in filenames, adapt modules
2025-07-26 08:19:10 +02:00
Nicolas Boichat
72d172d2b4
uucore: time: Take Write trait as parameter, return UResult
...
Gives us more flexiblity to print directly to stdout, and
removes the need to similar error handling across utilities.
2025-07-25 23:29:06 +08:00
Nicolas Boichat
3b4c472c02
uucore: time: add tests
2025-07-25 22:35:30 +08:00
Nicolas Boichat
c9b8635279
uucore: Add time feature
...
We'll move some common time handling code there, to be shared
between du and ls as a start.
Starting with format_system_time from from `ls`.
2025-07-25 22:35:30 +08:00
Nicolas Boichat
4907396c10
ls: Refactor date/time printing
...
TimeStyle was more useful when we were using chrono instead of
jiff.
Also, refactor some of the functions to isolate more of them from
the details of `ls` implementation, so that we can move them
to uucore.
2025-07-25 22:35:30 +08:00
Nicolas Boichat
395cbb1357
ls: Handle timestamps far in the future/past by just printing them
...
Fold get_time into display_date to make that easier, the split
was a remnant of previous refactoring.
The allowed timestamp range is different from what GNU coreutils
allows, but should not really matter for practical purposes, we
could fix later if needed.
It is difficult to add a test as ext4 typically doesn't support
creating files with such large timestamps.
2025-07-25 22:35:30 +08:00
Daniel Hofstetter
8bbce0d3de
Merge pull request #8386 from RenjiSann/improve-sort
...
GnuTests / Run GNU tests (push) Has been cancelled
Android / Test builds (push) Has been cancelled
FreeBSD / Style and Lint (push) Has been cancelled
Code Quality / Style/toml (push) Has been cancelled
Code Quality / Style/Python (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
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 / Pre-commit hooks (push) Has been cancelled
FreeBSD / Tests (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 / 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
CICD / Test all features separately (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
sort: Handle non-utf8 sorting content
2025-07-25 14:52:05 +02:00
Dorian Peron
27faee711b
test(sort): Fix fixtures
2025-07-25 13:51:53 +02:00
Dorian Peron
365f6a36fa
test_util_name: ignore sort tests
2025-07-25 13:51:53 +02:00
Dorian Peron
059977f197
sort: Change &str inputs to &[u8] for the rest of the program
2025-07-25 13:51:53 +02:00
Dorian Peron
0f6985d83b
sort: Make comparison functions accept byte arrays instead of strings
...
Updated:
- numeric sort
- custom_str_cmp
- month_compare
- random_shuffle
2025-07-25 13:51:53 +02:00
Sylvestre Ledru
98374e8021
Merge pull request #8389 from drinkcat/ci-selinux
...
CICD / Style/cargo-deny (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 / 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
GnuTests / Run GNU tests (push) Waiting to run
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
.github/workflows/CICD.yml: Speed up Build/SELinux
2025-07-25 12:40:17 +09:00
Nicolas Boichat
e0eda096a1
.github/workflows/CICD.yml: Speed up Build/SELinux
...
We can at least use 4 cores instead of 1.
2025-07-25 01:04:27 +08:00
Dorian Péron
07b68ee0da
Merge pull request #8380 from drinkcat/cp-preserve-gid
...
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 / 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 (push) Waiting to run
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
CheckScripts / ShellScript/Format (push) Has been cancelled
CheckScripts / ShellScript/Check (push) Has been cancelled
tests/cp/preserve-gid: Partial fix
2025-07-24 18:28:06 +02:00
Dorian Péron
5a322e12be
Merge pull request #8385 from drinkcat/cp-try-gid-only
...
cp: Try to change gid only if changing uid+gid fails
2025-07-24 18:27:28 +02:00
Dorian Peron
4c6aa251c4
version_cmp: Make version_cmp u8-based
2025-07-24 18:16:06 +02:00
Dorian Péron
c40395850b
Merge pull request #8384 from cakebaker/rm_improve_is_dir_empty
...
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 (push) Waiting to run
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
rm: improve `is_dir_empty` from O(n) to O(1)
2025-07-24 15:37:07 +02:00
Dorian Peron
d689da8251
sort: Minor improvements
2025-07-24 15:35:41 +02:00
Daniel Hofstetter
d1ec00f8fa
Merge pull request #8371 from drinkcat/df-osstr
...
df: Move to using `OsString`
2025-07-24 15:09:32 +02:00
Nicolas Boichat
8c45737007
cp: Try to change gid only if changing uid+gid fails
...
For example, if a file with ownership `root:wheel` is copied with
`-p`, we expect the copy to have ownership `$USER:wheel`
(assuming `$USER` is part of `wheel` group)
It's not possible to add a unit test for this, as it requires a
file with non-$USER ownership, which can only be created by root
(or another user).
2025-07-24 18:00:46 +08:00
Daniel Hofstetter
19c7200d34
rm: improve is_dir_empty from O(n) to O(1)
2025-07-24 11:10:00 +02:00
Nicolas Boichat
58095fa70d
util/build-gnu.sh: Replace $abs_path_dir_
...
path_prepend_ sets $abs_path_dir_, but the sed command above removes
it. Set it manually instead.
Fixes part of tests/cp/preserve-gid.
2025-07-24 15:21:16 +08:00
Nicolas Boichat
0e74a34113
util/build.sh: Patch tests/local.mk instead of Makefile
...
Patching tests/local.mk instead of Makefile makes it a bit easier
to see what has been modified with a `git diff`, and Makefile
is generated anyway.
2025-07-24 15:19:50 +08:00