1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-05 23:47:46 +00:00
Commit graph

15884 commits

Author SHA1 Message Date
renovate[bot]
8da20cae46
chore(deps): update rust crate iana-time-zone to v0.1.62 2025-03-24 07:34:14 +00:00
Daniel Hofstetter
5ec1f287a8
Merge pull request #7547 from uutils/renovate/zip-2.x-lockfile
chore(deps): update rust crate zip to v2.5.0
2025-03-24 08:32:54 +01:00
Daniel Hofstetter
bc9c5598a7 docs: replace AUR package in installation.md
coreutils-hybrid no longer exists, let's mention coreutils-uutils instead
2025-03-24 07:47:16 +01:00
Daniel Hofstetter
aaa4b899dd
Merge pull request #7553 from lbellomo/fix-broken-ubuntu-badge-doc
doc: bump version of ubuntu badge
2025-03-24 07:19:05 +01:00
renovate[bot]
c7e0479d74
chore(deps): update rust crate zip to v2.5.0 2025-03-24 06:12:28 +00:00
Daniel Hofstetter
3355a3eb0b
Merge pull request #7549 from uutils/renovate/time-0.x-lockfile
chore(deps): update rust crate time to v0.3.41
2025-03-24 07:06:13 +01:00
lbellomo
d683b2a5a0 doc: bump version of ubuntu badge 2025-03-24 00:48:49 -03:00
lbellomo
b0e282951f doc: fix broken links on mdbook
Relative links works on github but are broken for the 'CONTRIBUTING.md'
on the mdbook. This change the relative link to the full link that works
on github and on the mdbook
2025-03-24 00:04:47 -03:00
renovate[bot]
381457a7bd
chore(deps): update rust crate time to v0.3.41 2025-03-24 01:54:09 +00:00
Sylvestre Ledru
c610262f0b
Merge pull request #7546 from drinkcat/fix-android-ci
Fix Android CI
2025-03-23 22:00:35 +01:00
Nicolas Boichat
b142b9e748 test_*: Disable tests that require setting rlimit on Android
See #7542, it's not totally clear where the problem comes from,
but blanking LD_PRELOAD set by termux seems to fix the problem
(but introduces other issues.

Let's just disable these tests for now.
2025-03-23 20:24:17 +01:00
Nicolas Boichat
7eb873c326 test_env: Try to execute an empty file instead of .
For some unclear reason, Android _now_ sometimes returns an
IsADirectory error, instead of PermissionDenied, when trying
to execute `.`.

Since this test really wants to test PermissionDenied, we try
to execute a file in the fixture instead, that doesn't have
exec permission.

Also, limit this test to Unix.

Fixes part of #7542.
2025-03-23 19:37:59 +01:00
Nicolas Boichat
152dada379 tests/common/util: Make sure test_altering_umask is run in correct shell
On Android CI, `sh` would point at a different flavor of shell
shipped with termux (dash).

The current umask test expects that `/system/bin/sh` is used though,
so create a new function TestScenario:cmd_shell that runs a command
in the default shell (that could be used in more tests).

Fixes one part of #7542.
2025-03-23 19:37:04 +01:00
Sylvestre Ledru
105042fb70
document how to do good performance work (#7541)
* document how to do good performance work

* doc: spell, ignore "taskset"

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-03-23 15:31:02 +01:00
Daniel Hofstetter
ebe77c2555
Merge pull request #7543 from uutils/renovate/chrono-tz-0.x-lockfile
chore(deps): update rust crate chrono-tz to v0.10.2
2025-03-23 15:24:16 +01:00
renovate[bot]
85c862c48a
chore(deps): update rust crate chrono-tz to v0.10.2 2025-03-23 13:14:36 +00:00
Sylvestre Ledru
8931d2c26e
Merge pull request #7521 from usamoi/ptx
ptx: fixes
2025-03-23 09:28:20 +01:00
Sylvestre Ledru
53d277233d
Merge pull request #7527 from drinkcat/seq-tests
test_seq: Add a few more tests for corner cases
2025-03-23 09:26:20 +01:00
Sylvestre Ledru
eed5c81060
Merge pull request #7463 from blyxxyz/clean-shuf
Make `shuf` OsStr-compliant and bring newline handling in line with GNU
2025-03-22 22:29:49 +01:00
Nicolas Boichat
596ea0a694 test_seq: Add a few more tests for corner cases
Some of these tests are not completely defined behavior, but
in many cases they make sense (or at least one can find some
consistent logic to it).

However, there are 2 edge cases that are more dubious IMHO.
One of them has been reported on list a while back, and I
just reported another.
2025-03-22 22:02:11 +01:00
Nicolas Boichat
59cd6e5e41 tests: Move seq/yes run function to Ucommand::run_stdout_starts_with
Tests for both `seq` and `yes` run a command that never terminates,
and check the beggining of their output in stdout, move the copied
parts of the wrapper function to common/util.

We still need to use slightly different logic to parse exit value
as `seq` returns success if stdout gets closed, while `yes` fails.
2025-03-22 22:02:11 +01:00
Sylvestre Ledru
b540e18dec
Merge pull request #7519 from karlmcdowall/cat_perf
cat: Improve performance of formatting.
2025-03-22 21:54:13 +01:00
Sylvestre Ledru
09d7b2dcfb
Merge pull request #7458 from drinkcat/format-bigdecimal
Move ExtendedBigDecimal to uucore/format, make use of it in formatting functions
2025-03-22 21:52:04 +01:00
Nicolas Boichat
d678e5320f uucore: format: Fix uppercase hex floating point printing
Accidentally broke this use case when refactoring.

Added a test as well.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
e6c24b245a uucore: format: Small optimizations in num_format for seq
In most common use cases:
 - We can bypass a lot of `write_output` when width == 0.
 - Simplify format_float_decimal when the input is an integer.

Also document another interesting case in src/uu/seq/BENCHMARKING.md.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
f31ba2bd28 seq: Make use of uucore::format to print in all cases
Now that uucore format functions take in an ExtendedBigDecimal,
we can use those in all cases.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
25c492ee19 uucore: format: Pad non-finite numbers with spaces, not zeros
`printf "%05.2f" inf` should print `  inf`, not `00inf`.

Add a test to cover that case, too.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
ec450d602a uucode: format: format_float_hexadecimal: Take in &BigDecimal
Display hexadecimal floats with arbitrary precision.

Note that some of the logic will produce extremely large
BitInt as intermediate values: there is some optimization
possible here, but the current implementation appears to work
fine for reasonable numbers (e.g. whatever would previously
fit in a f64, and even with somewhat large precision).
2025-03-22 21:13:18 +01:00
Nicolas Boichat
f0e9b8621f uucode: format: format_float_shortest: Take in &BigDecimal
Similar logic to scientific printing. Also add a few more tests
around corner cases where we switch from decimal to scientific
printing.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
7f0e5eb473 uucode: format: format_float_scientific: Take in &BigDecimal
No more f64 operations needed, we just trim (or extend) BigDecimal to
appropriate precision, get the digits as a string, then add the
decimal point.

Similar to what BigDecimal::write_scientific_notation does, but
we need a little bit more control.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
edaccc88b9 uucode: format: format_float_decimal: Take in &BigDecimal
Also add a few unit tests to make sure precision is not lost anymore.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
ce14d01da5 uucode: format: format_float_non_finite: Take in &ExtendedBigDecimal
First modify Format.fmt to extract absolute value and sign, then
modify printing on non-finite values (inf or nan).
2025-03-22 21:13:18 +01:00
Nicolas Boichat
8e11dab995 uucode: format: Change Formatter to take an &ExtendedBigDecimal
Only changes the external interface, right now the number is
casted back to f64 for printing. We'll update that in follow-up.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
241e2291bd uucore: format: extendedbigdecimal: Implement From<f64>
Allows easier conversion.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
9355200901 uucore: format: extendedbigdecimal: Add MinusNan
Some test cases require to handle "negative" NaN. Handle it
similarly to "positive" NaN.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
69164688ad uucore: format: Make Formatter a generic
Using an associated type in Formatter trait was quite nice, but, in
a follow-up change, we'd like to pass a _reference_ to the Float
Formatter, while just passing i64/u64 as a value to the Int
formatters. Associated type doesn't allow for that, so we turn
it into a generic instead.

This makes Format<> a bit more complicated though, as we need
to specify both the Formatter, _and_ the type to be formatted.
2025-03-22 21:13:18 +01:00
Nicolas Boichat
2103646ff7 seq: Move extendedbigdecimal.rs to uucore/features/format
Will make it possible to directly print ExtendedBigDecimal in `seq`,
and gradually get rid of limited f64 precision in other tools
(e.g. `printf`).

Changes are mostly mechanical, we reexport ExtendedBigDecimal directly
in format to keep the imports slightly shorter.
2025-03-22 21:13:18 +01:00
Daniel Hofstetter
b4a9b89f4a
docs: fix url of file with coverage results (#7528) 2025-03-22 17:11:26 +01:00
Valerio
6658a0e610
Add test to ensure arch output is not empty (#7523)
* Add test to ensure arch output is not empty

This test ensures that the output of the arch command is non-empty, which is a minimal expectation across all supported architectures.

This helps avoid regressions or edge cases where the command might unexpectedly return an empty string on unsupported or misconfigured platforms.

* Update tests/by-util/test_arch.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* Apply cargo fmt formatting

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-03-22 15:15:28 +01:00
usamoi
412d2b3b1f ptx: fixes 2025-03-22 19:25:19 +08:00
Sylvestre Ledru
302f7842c7 ci: if FAIL => PASS but in the intermittent list, show the info
see:
https://github.com/uutils/coreutils/pull/7522#issuecomment-2744892884
2025-03-22 11:04:20 +01:00
Karl McDowall
c84ee0ae0f cat: Improve performance of formatting.
Issue #7518
Add a BufWriter over stdout when cat outputs any kind of formattted
data. This improves performance considerably.
2025-03-21 19:03:34 -06:00
Daniel Hofstetter
a64fce8286
Merge pull request #7517 from sylvestre/fix-intermittent-detection
GNU CI: fix the intermittement management
2025-03-21 17:04:02 +01:00
Sylvestre Ledru
fe2d19be6a GNU CI: fix the intermittement management 2025-03-21 12:04:43 +01:00
jmjoy
7bd90bb663
Implement Default for Options of mv and cp (#7506) 2025-03-20 16:08:44 +01:00
Sylvestre Ledru
187d3e58b5
Merge pull request #7495 from karlmcdowall/wc_perf
wc: Perf gains with the bytecount crate.
2025-03-20 09:52:15 +01:00
Daniel Hofstetter
1983b579c7
Merge pull request #7500 from uutils/renovate/tempfile-3.x-lockfile
fix(deps): update rust crate tempfile to v3.19.1
2025-03-20 07:31:52 +01:00
Daniel Hofstetter
b2864e8e1d
Merge pull request #7499 from uutils/renovate/clap_complete-4.x-lockfile
chore(deps): update rust crate clap_complete to v4.5.47
2025-03-20 07:12:38 +01:00
Karl McDowall
eea6c82305 wc: Perf gains with the bytecount crate.
Issue #7494
Improve performace of wc app.
 - Use the bytecount::num_chars API to count UTF-8 characters in a file.
 - Enable runtime-dispatch-simd feature in the bytecount crate.
2025-03-19 16:45:19 -06:00
renovate[bot]
fd488ecff8
fix(deps): update rust crate tempfile to v3.19.1 2025-03-19 22:22:41 +00:00