1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-21 20:51:11 +00:00
Commit graph

8245 commits

Author SHA1 Message Date
Sylvestre Ledru
7102e1a4b5 l10n: remove the old md files 2025-06-04 19:24:03 +02:00
Sylvestre Ledru
16afa021ce l10n: add a comment to detail the need of having the capability to disable translations 2025-06-04 19:24:03 +02:00
Sylvestre Ledru
5ab807a561 l10n: disable the arch locale init 2025-06-04 19:24:03 +02:00
Sylvestre Ledru
1a80fc59a3 l10n: init the locale engine for each program (next: put it behing a feature) 2025-06-04 19:24:03 +02:00
Sylvestre Ledru
94c1fad206 l10n: adjust the code to use the fluent files instead of the PROG.md docs 2025-06-04 19:23:57 +02:00
Sylvestre Ledru
28c16dd6d1 l10n: convert the PROG.md command to fluent 2025-06-04 19:19:02 +02:00
Sylvestre Ledru
d8bb7875cf l10n: adjust the code to use help_about & help_usage 2025-06-04 19:19:02 +02:00
Sylvestre Ledru
42cfb3d8be locale: show the error in case of issue 2025-06-04 19:18:59 +02:00
Sylvestre Ledru
4050f68e6e
uucore_procs: use authors.workspace 2025-06-03 22:26:58 +02:00
Vikram Kangotra
bfbdd5275d
cp: migrate from quick-error to thiserror (#7989)
* cp: migrate from quick-error to thiserror

fixes: #7916

* Remove quick-error

Now that we have migrated to thiserror, we can remove quick-error

* cp: fix test failures

* cp: fix fmt error
2025-06-03 10:12:36 +02:00
Nicolas Boichat
c939b6096b uucore: locale: Use if let instead of match
Recent cargo clippy prefers to use if let for single pattern.

For some reason it only triggers on one of the LANG restore case though,
but we can just fix them all.
2025-06-03 09:35:47 +02:00
Dylan Ullrich
862565cd1a
Merge pull request #8047 from eldyl/feat/add_wezterm_to_terms
Feat/add wezterm to terms
2025-06-03 07:54:05 +02:00
Daniel Hofstetter
3eede813db rm: remove some unnecessary type information 2025-06-02 16:22:40 +02:00
Daniel Hofstetter
25c7ed5b1e rm: set "after help" in uu_app instead of uumain 2025-06-02 16:19:33 +02:00
Daniel Hofstetter
dfc4e3efe5 rm: do "early return" earlier in uumain 2025-06-02 16:12:03 +02:00
Sylvestre Ledru
b5d4b0ee1d
Merge pull request #7972 from Ecordonnier/eco/stdbuf-regression-test
stdbuf: fix cross-compilation
2025-06-02 13:26:38 +02:00
Charlie-Zheng
b2893db5a4
sort: Implement the last changes to make sort-files0-from pass (#8011) 2025-06-02 11:14:49 +02:00
Etienne Cordonnier
35634b46a0 stdbuf: fix cross-compilation
Summary:

Partial fix for https://github.com/uutils/coreutils/issues/6591

The current code declare libstdbuf as a build-dependency of stdbuf as a
workaround to enforce that libstdbuf is compiled before stdbuf. This breaks
cross-compilation, because build-dependencies were compiled for the host
architecture, and not for the target architecture.

The reason this workaround is necessary is that bindeps is available only in nightly at the moment:
https://rust-lang.github.io/rfcs/3028-cargo-binary-dependencies.html

This commit replaces the "build-dependency" workaround with another workaround:
calling cargo manually to build libstdbuf in the build.rs of stdbuf, in order to ensure that libstdbuf is built before stdbuf.

Changes:

- Removed cpp/cpp_build dependencies:

The cpp, cpp_build, and related dependencies were removed because they made cross-compilation in a build.rs file very complex, since you need
to pass proper CXX env variables for cross-compilation, whereas cross-compiling rust code using cargo is quite simple.
Provided Rust implementations for getting stdin, stdout, and stderr pointers.
Switched from C++/cpp macro-based initialization to using the Rust ctor crate for library initialization.

- Remove "feat_require_crate_cpp" which is not needed any more, since stdbuf was the only utility using the cpp crate.

Tests:

This commit fixes e.g. this test:
cross test --target aarch64-unknown-linux-gnu --features stdbuf test_stdbuf::test_libstdbuf_preload -- --nocapture

- The "i686" build of stdbuf was also broken (stdbuf 32 bits, but libstdbuf 64 bits) and test_stdbuf::test_libstdbuf_preload of the i686 builds in github CI serves as regression
test for this issue, no need to add a cross-rs test for aarch64.
- The x86_64 musl build of stdbuf was also broken and was passing tests in CI only because it was compiled with the wrong libc (glibc instead of musl)

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-06-02 10:55:57 +02:00
Will Shuttleworth
dfc4072181
stty: fix output redirection (#8016)
* stty: fix output redirection

* Revert "stty: fix output redirection"

This reverts commit 604de7c4de6f51a6bcd495ccda11602c12804493.

* stty: fix output redirection by trying /dev/tty before stdout
2025-06-02 10:41:25 +02:00
Daniel Hofstetter
fd37324d72
Merge pull request #8028 from drinkcat/seq-latest-pow-with-context
uucore: num_parser: Update pow_with_context
2025-06-02 10:15:58 +02:00
Daniel Hofstetter
dfc2e249ef
Merge pull request #7894 from drinkcat/jiff-date-ls
date/ls: Switch from chrono to jiff
2025-06-02 09:36:27 +02:00
Nicolas Boichat
5d75e28b87 ls: Simplify TimeStyle::format
Also, the comment does not fully apply anymore, so we can leave
it more open-ended to figure out how to support locale.
2025-06-01 19:36:58 +02:00
Nicolas Boichat
c5b445f6f2 uucore: num_parser: Clarify origin of pow_with_context
And why we use an older minimum Rust version in that piece of code.
2025-06-01 19:27:06 +02:00
Daniel Hofstetter
d96b62c17f ln: rename error variant
from TargetIsDirectory to TargetIsNotADirectory
2025-05-30 16:44:00 +02:00
Dorian Péron
1baedc417b
ln: don't show error when overwriting a link with -sfn (#7449)
* ln: fix #6350

* test(ln): test_symlink_no_deref_dir success has no stderr
2025-05-30 16:29:43 +02:00
Sylvestre Ledru
94132060b6
Merge pull request #8030 from drinkcat/clippy-better
clippy pre-commit/CI improvements
2025-05-29 15:05:15 +02:00
Nicolas Boichat
5e3284139c num_parser: Fix tests after pow_with_context update
We get more precision, and more range, now.
2025-05-29 14:37:03 +02:00
Nicolas Boichat
986bdf545d uucore: Remove custom_tz_fmt, cleanup dependencies
Nobody needs it anymore.
2025-05-29 14:00:25 +02:00
Nicolas Boichat
6031de5a29 ls: switch to lenient formating configuration 2025-05-29 14:00:25 +02:00
Nicolas Boichat
10fb220c72 ls: Avoid additional String creation/copy in display_date
From code provided in #7852 by @BurntSushi.

Depending on the benchmarks, there is _still_ a small performance
difference (~4%) vs main, but it's seen mostly on small trees
getting printed repeatedly, which is probably not a terribly
interesting use case.
2025-05-29 14:00:25 +02:00
Nicolas Boichat
c599363242 ls: cache recent time threshold in jiff implementation 2025-05-29 14:00:25 +02:00
Nicolas Boichat
fc947eca33 ls: convert to jiff 2025-05-29 14:00:25 +02:00
Nicolas Boichat
07c9205d22 Revert "ls: Optimize time formatting"
This reverts commit fc6b896c27.

This also reverts the change from new to new_lenient, we'll
recover that later as part of the jiff conversion.
2025-05-29 14:00:25 +02:00
Nicolas Boichat
301e33cfe3 date: switch from chrono to jiff
Also adds cargo dependency.
2025-05-29 14:00:25 +02:00
Nicolas Boichat
b522f2b9b5 uucore: Use next_back on PathBuf's DoubleEndedIterator
As recommended by clippy, last() needlessly goes through the whole
path while next_back() is available.
2025-05-29 13:55:32 +02:00
Nicolas Boichat
4a0c2a95e8 uucore: num_parser: Update pow_with_context
This is the latest version in https://github.com/akubera/bigdecimal-rs/pull/148 ,
but the discussion sort of stalled, this is really complicated math,
but this new function is a little bit better than the original
(at least I hope so).
2025-05-29 13:39:03 +02:00
Daniel Hofstetter
869660baaa
Merge pull request #7981 from sylvestre/locale2
Improve the locale support
2025-05-29 11:10:34 +02:00
Sylvestre Ledru
d3f5f3aaa7
Merge pull request #8018 from Ecordonnier/eco/musl-utmpx-warnings
utmpx: silence musl warnings
2025-05-29 09:26:51 +02:00
Sylvestre Ledru
ac0564decb
Merge pull request #8021 from cakebaker/cargo_toml_remove_unused_coz_dependency
Cargo.toml: remove unused `coz` dependency
2025-05-29 09:26:04 +02:00
Justin Tracey
508e791f56
sync: adjust safety comments
Removes a stale safety comment I missed, plus adds some backticks.
2025-05-28 19:27:40 -04:00
Sylvestre Ledru
91a6209699 locale: try to guess where the locale files are 2025-05-28 23:45:58 +02:00
Sylvestre Ledru
7847894acf arch: support translations 2025-05-28 23:45:58 +02:00
Sylvestre Ledru
463f7c1530 locale: add unit tests 2025-05-28 23:45:58 +02:00
Sylvestre Ledru
72597bcf7b locale: refactor the locale system:
* remove the default value. Avoid duplication of the english string + facilitate translation
* have english as a default. Load english when the translated string isn't available
2025-05-28 23:40:13 +02:00
Sylvestre Ledru
0523eab9e7
Merge pull request #8020 from cakebaker/csplit_fix_issues_with_non_ascii_digits
csplit: fix two issues with non ASCII digits
2025-05-28 23:25:18 +02:00
Daniel Hofstetter
5e92917b6d Cargo.toml: remove unused coz dependency 2025-05-28 19:54:11 +02:00
Daniel Hofstetter
d5b6af5216 csplit: only allow ASCII digits as offset 2025-05-28 16:07:45 +02:00
Daniel Hofstetter
7439050d85 csplit: only allow ASCII digits for repeat pattern 2025-05-28 15:53:54 +02:00
Etienne Cordonnier
c14282209d utmpx: silence musl warnings
Fixes https://github.com/uutils/coreutils/issues/7865

We are intentionally calling the stub utmpx functions of musl, in order
to achieve behavior parity with GNU coreutils, and in order to be able
to ship those utilities for musl libc. Silence those warnings.

See also https://github.com/uutils/coreutils/issues/1361 for details.

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-05-28 13:58:49 +02:00
jovie :)
0f632f2fba
chroot: remove unwrap calls (#7890) 2025-05-28 09:29:19 +02:00