1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00
Commit graph

3511 commits

Author SHA1 Message Date
Dorian Péron
5936408922
Merge pull request #7484 from karlmcdowall/head_bug_bug_bug
head: fix bug with non-terminated files.
2025-06-14 21:22:24 +02:00
Dorian Péron
e2eb601948
Merge pull request #7918 from Qelxiros/7906-hashsum-errors
hashsum: don't exit early on io errors
2025-06-14 21:17:30 +02:00
Tomasz Guz
b5e0304ea7 expr: fix builtin functions precedence 2025-06-13 14:51:25 +02:00
Yuankun Zhang
e1f40ff601
cat: add error handling in write_fast function (#8091) 2025-06-13 11:02:03 +02:00
Will Shuttleworth
e5bde07591
tail: fix test that disables output in bash shell (#8157)
* tail: fix test that disables output in bash shell

* tail: fix platform related issues after test change

* tail: use new imports on same platforms as test they are needed for
2025-06-13 09:44:18 +02:00
Tomasz Guz
6049bc091a expr: fix substr parsing 2025-06-11 22:53:24 +02:00
Will Shuttleworth
4be9e7679d stty: fix negated options getting rejected by clap 2025-06-09 17:35:06 -04:00
Daniel Hofstetter
c14aec47f0
Merge pull request #8112 from sylvestre/l10n-tr
l10n: port tr for translation + add french
2025-06-09 15:06:09 +02:00
Sylvestre Ledru
e4698255f2 l10n: port pwd for translation + add french 2025-06-08 20:08:50 +02:00
Sylvestre Ledru
aba6128fc1 l10n: port tr for translation + add french 2025-06-08 13:57:42 +02:00
Daniel Hofstetter
3ffaa335df rm: use new_cmd! to simplify some tests 2025-06-06 16:53:55 +02:00
Daniel Hofstetter
d503b7c7c7 rm: merge some imports in test file 2025-06-06 16:42:32 +02:00
Daniel Hofstetter
1dbd452c8f rm: use consistent naming for test functions 2025-06-06 16:40:16 +02:00
Teemu Pätsi
4d40671d79
cat: Fix reporting "input file is output file" error when outputting to an input file (#8025)
* cat: Check if a file can be overwritten safely in Unix

* cat: Check if a file can be overwritten safely in Windows

* cat: Test writing read-write file that is input and output

* cat: Unit test `is_appending` function

* cat: Unit test `is_unsafe_overwrite` function

* cat: Comment why a few function calls could return Err

* cat: Remove obvious comments from test
2025-06-06 12:01:31 +02:00
Sylvestre Ledru
9e21259e2d
Merge pull request #8062 from drinkcat/sort-float
sort: Make use of ExtendedBigDecimal in -g sorting, then attempt to recover some performance
2025-06-06 12:01:04 +02:00
Will Shuttleworth
61bd11a551
stty: set control characters (#7931)
* reworked arg processing. control character mappings are correctly grouped now, ie 'stty erase ^H'

* stty: setting control chars to undefined (disabling them) is implemented

* setting control chars

* stty: can now set control chars. need to improve checks on valid mappings

* stty: matches GNU in what control character mappings are allowed

* stty: run rustfmt and remove extra comments

* stty: setting control char code review fixes

* stty: fix rustfmt errors

* stty: more small edits after review

* stty: refactor set control char changes for better testing

* stty: fix ci error

* stty: fix issues from code review
2025-06-05 11:38:51 +02:00
ALBIN BABU VARGHESE
a7a493a604
mv: moving dangling symlinks into directories (#8064)
* Fix linting and style issues

* Change condition to not fail for dangling symlinks

The function `move_files_into_dir` had a condition that failed when a
dangling symlink was moved into a folder, which resulted in a file
or directory doesn't exist error

* Added a test case
2025-06-04 17:25:53 +02:00
Nicolas Boichat
8c98f433bf test_sort: Add one more test checking arbitrary precision handling 2025-06-04 09:54:44 +02:00
Nicolas Boichat
ee1a6d2e66 test_sort: Add more sort use cases
test_g_float comes from GNU test, the other one is manually crafted.
2025-06-04 09:33:17 +02:00
Daniel Hofstetter
3904d5b614 uptime: move imports into test function
to simplify the cfg handling
2025-06-03 16:12:52 +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
Etienne Cordonnier
2e8b6fabcc stdbuf: add test_libstdbuf_preload
This test verifies that libstdbuf correctly gets preloaded, and that there are no architecture mismatch errors.
At the moment the test passes when compiled normally, but fails when compiled with cross-rs, due to https://github.com/uutils/coreutils/issues/6591

This passes:
```
cargo test --features stdbuf test_stdbuf::test_libstdbuf_preload -- --nocapture
```

This fails:
```
cross test --target aarch64-unknown-linux-gnu --features stdbuf test_stdbuf::test_libstdbuf_preload -- --nocapture
```

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-06-02 10:52:32 +02:00
Daniel Hofstetter
546e50846e cp: rewrite test to remove procfs dependency 2025-06-02 09:51:33 +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
66d1e8a872 test_date: Expand on test_date_utc_time
Using the current time requires a bit of care, but it's nice
to have a test that doesn't use a fixed date as input.
2025-06-01 20:04:22 +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
Nicolas Boichat
dadda0dd6a test_date: Extend coverage to a lot more timezones
Also test %z/%Z formats.
2025-05-29 14:00:25 +02:00
Jadi
d1525e2d2e date: Add more TZ tests
[drinkcat: separated test changes]
2025-05-29 14:00:25 +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
Teemu Pätsi
4946922c0f
expr: Fix error message for large numbers as range index 2025-05-27 17:28:19 +03:00
Teemu Pätsi
07caa4867b
expr: Fix error message for too big range quantifier index 2025-05-27 14:06:15 +03:00
Teemu Pätsi
b1a91351bc
expr: Ignore test cases from spell checker 2025-05-27 04:34:38 +03:00
Teemu Pätsi
bbc912eb75
expr: Add tests for regex range quantifiers 2025-05-27 04:26:37 +03:00
Teemu Pätsi
aae62072d8
expr: Fix parsing range quantifiers in regex 2025-05-26 15:59:35 +03:00
Sylvestre Ledru
be77e142aa
Merge pull request #7991 from RenjiSann/sort-multiple-outputs
sort: prevent -o/--output to be specified multiple times
2025-05-26 08:10:49 +02:00
Dorian Peron
3b4226c48c sort: prevent -o/--output to be specified multiple times 2025-05-25 23:43:48 +02:00
Sylvestre Ledru
c992ce5507
Merge pull request #7948 from BenWiederhake/dev-shred-random-source
shred: implement and test feature --random-source
2025-05-25 22:58:18 +02:00
Teemu Pätsi
63ce37cf6e
expr: Refactor regex tests into multiple targeted functions 2025-05-24 11:17:39 +03:00
Teemu Pätsi
b0390fe36e
expr: Handle $ at the beginning of the regex pattern 2025-05-24 01:47:35 +03:00
Teemu Pätsi
4555e6fe48
expr: Handle trailing backslash error 2025-05-24 01:47:30 +03:00
Dorian Péron
cd9ce77098
Merge pull request #7953 from frendsick/fix/expr-regex-anchors
expr: Fix parsing regex anchors '^' and '$'
2025-05-23 15:16:28 +02:00
Teemu Pätsi
29332865a9
expr: Handle special cases for $ in regex
Enable fixed test `test_bre11`
2025-05-23 15:29:55 +03:00
Teemu Pätsi
f664578a4b
expr: Handle special cases for ^ in regex 2025-05-23 15:23:21 +03:00
Daniel Hofstetter
73e447224c Adapt to API changes in nix 2025-05-23 09:24:46 +02:00
Sylvestre Ledru
38861cc767 selinux: add support for install 2025-05-21 09:51:27 +02:00
Daniel Hofstetter
147027022a
Merge pull request #7940 from Qelxiros/7671-timeout-tests
timeout: add hex parsing test
2025-05-20 10:39:56 +02:00
Jeremy Smart
384878b5df add timeout test for hex parsing 2025-05-19 11:18:18 +02:00