Commit graph

12194 commits

Author SHA1 Message Date
Daniel Hofstetter
833c1a0d3f ci: set -no-window in Android workflow 2024-01-08 16:19:43 +01:00
D9nni
28b5224725 cksum: fixed test for --raw on single file 2024-01-08 15:50:25 +02:00
Daniel Hofstetter
1c6bf6991c nl: don't exit if input is directory 2024-01-08 11:01:07 +01:00
Sylvestre Ledru
d72343bc64
Merge branch 'main' into cksum 2024-01-08 09:02:11 +01:00
Daniel Hofstetter
8e83b347c6
Merge pull request #5804 from Ato2207/cksum_error
Made cksum return an error if the algorithm blake2b is used on a directory.
2024-01-08 08:38:48 +01:00
D9nni
f03ef79bc8 cksum: added tests for --raw and fixed fmt whitespace error 2024-01-08 08:51:06 +02:00
Atomei Alexandru Constantin
0bfd4bbdf7 Added test to validate that it now generates the error for an arbitrary directory 2024-01-08 00:08:24 +02:00
Atomei Alexandru Constantin
288ad97878 Made cksum to return an error if the algorithm blake2b is used on a directory 2024-01-07 23:39:33 +02:00
D9nni
8c1fc8b287 Added --raw argument, with error for multiple files 2024-01-07 21:43:31 +02:00
Daniel Hofstetter
f1499d0e79
Merge pull request #5802 from uutils/renovate/libc-0.x
chore(deps): update rust crate libc to 0.2.152
2024-01-07 17:29:54 +01:00
renovate[bot]
f612546ff7
chore(deps): update rust crate libc to 0.2.152 2024-01-07 15:21:27 +00:00
Daniel Hofstetter
7b34e3e4bb
Merge pull request #5800 from sylvestre/remove-wa
Remove the tests/cp/link-heap.sh workaround
2024-01-07 13:14:07 +01:00
Sylvestre Ledru
724305e64f Remove the tests/cp/link-heap.sh workaround
No longer needed since github.com/uutils/coreutils/pull/5789 landed
2024-01-06 23:33:32 +01:00
Sylvestre Ledru
a60c3420d5
Merge pull request #5789 from samueltardieu/issue-5766
Fix seq output
2024-01-06 23:33:02 +01:00
Sylvestre Ledru
b309d64e78
Merge branch 'main' into issue-5766 2024-01-06 22:55:54 +01:00
Kostiantyn Hryshchuk
c867d6bfb1
shred: implemented "--remove" arg (#5790) 2024-01-06 22:50:21 +01:00
Sylvestre Ledru
247f2e55bd
seq: adjust some error messages. GNU's are better (#5798)
* seq: adjust some error messages. GNU's are better
tested by tests/seq/seq.pl

* uucore: remove todo

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-01-06 16:54:29 +01:00
Daniel Hofstetter
d158f1a396
Merge pull request #5799 from ffontaine/main
uucore: add support for sparc64
2024-01-06 14:29:46 +01:00
Fabrice Fontaine
9f4330f94c uucore: add support for sparc64
Add support for sparc64 in uucore to avoid the following build failure
with nushell:

error[E0308]: mismatched types
   --> /home/autobuild/autobuild/instance-7/output-1/build/nushell-0.85.0/VENDOR/uucore/src/lib/features/fs.rs:121:16
    |
111 |     pub fn number_of_links(&self) -> u64 {
    |                                      --- expected `u64` because of return type
...
121 |         return self.0.st_nlink;
    |                ^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
121 |         return self.0.st_nlink.into();
    |                               +++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `uucore` (lib) due to previous error

Fixes:
 - http://autobuild.buildroot.org/results/f9f0287a8e39c65895014ca513ed25071f020add

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-01-06 10:26:54 +01:00
Daniel Hofstetter
a44845d5f7
Merge pull request #5796 from michel-slm/add-homepage-and-repo
uuhelp_parser: add links to homepage and repo
2024-01-06 07:10:30 +01:00
Michel Lind
5de030f119
uuhelp_parser: add links to homepage and repo
When viewing the crate right now, apart from via looking at the dependencies
it's hard to find the associated project and repository.

Add the missing info.

Signed-off-by: Michel Lind <salimma@fedoraproject.org>
2024-01-05 22:21:28 -06:00
Daniel Hofstetter
e13f0d80ee
Merge pull request #5778 from RenjiSann/main
ls: Support QUOTING_STYLE environment variable
2024-01-05 15:55:23 +01:00
Samuel Tardieu
32f0256d7d uucore/num_format: properly display 10ᵖ where p is the precision
`seq --format %.2g 10 10` would display `1` because the precision would
not allow room for the decimal point, and the `0` in `10` would be
trimmed as an insignificant trailing `0`.

This has been fixed by only trimming trailing `0` in the presence of a
decimal point.
2024-01-05 15:40:20 +01:00
Samuel Tardieu
f5179290a6 uucore/num_format: replace saturating_sub by regular subtraction
Using `saturating_sub()` before converting to `usize` gives a wrong
feeling of security as it looks like it ensures that the value will
never go negative. However, since it is applied to `i32`, it can, and
converting it to `usize` would go horribly wrong anyway.

By following the code flow, `exponent` cannot be greater than
`precision`, or the `else` block would not have been taken.  A plain
subtraction will give the same result and will at least panic in debug
mode.
2024-01-05 15:04:12 +01:00
Samuel Tardieu
4c5326ffa3 uucore/num_format: the default precision for %g is 6 2024-01-05 15:00:12 +01:00
Daniel Hofstetter
5950777561
Merge pull request #5780 from sylvestre/terminator
cp/mv: manage with trailing slash in target
2024-01-05 14:24:08 +01:00
Dorian Péron
4372908e84 fix: cargo fmt + fix spelling mistake 2024-01-05 13:55:47 +01:00
Sylvestre Ledru
e64a0b4a26 Various fixes
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-01-05 12:56:27 +01:00
Sylvestre Ledru
aabf5fa577 cp: manages target with trailing '/' 2024-01-05 12:56:27 +01:00
Sylvestre Ledru
cb27b9c9c3 path_ends_with_terminator: rustdoc + unittest 2024-01-05 12:56:27 +01:00
Sylvestre Ledru
108dc4a0cd Move path_ends_with_terminator from mv into uucore 2024-01-05 12:56:27 +01:00
Sylvestre Ledru
4c698d58e0 mv: support the case mkdir a && mv a e/ 2024-01-05 12:56:24 +01:00
Sylvestre Ledru
e341759dfe
Merge pull request #5786 from samueltardieu/style-fixes
uucore: fix style in tests
2024-01-05 12:39:48 +01:00
Sylvestre Ledru
b61e859467
Merge pull request #5787 from samueltardieu/fuzz-fix-fd-leak
fuzz: fix file descriptor leak
2024-01-05 12:38:26 +01:00
Samuel Tardieu
4343ba6695 fuzz: fix file descriptor leak 2024-01-05 11:04:16 +01:00
Samuel Tardieu
e56682893f uucore: fix style in tests
- `Path::new()` returns a `&Path` and does not need to be dereferenced
- Some types can be deduced from the context and are well visible
  already (`parse_size_u128()` or `from_bytes()`)
2024-01-05 10:14:27 +01:00
Daniel Hofstetter
2ba9501013
Merge pull request #5784 from sylvestre/cp-fail
Update a GNU test error check -  tests/cp/fail-perm.sh
2024-01-05 08:31:43 +01:00
Ikko Eltociear Ashimine
9dca071b69
Fix typo in signals.rs (#5781)
* Fix typo in signals.rs

occured -> occurred

* Remove "occurred" from spell-checker:ignore

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-01-05 07:30:23 +01:00
Dorian Péron
c58575edaa tests/ls: Add tests to ensure env var is used as a last resort 2024-01-05 02:10:33 +01:00
cre4ture
9b3cc5437c
head: head_backwards for non-seekable files like /proc/* or fifos (named pipes) (#5732)
* implement head_backwards for non-seekable files like /proc/* or pipes

Signed-off-by: Ulrich Hornung <hornunguli@gmx.de>
2024-01-05 00:25:59 +01:00
Sylvestre Ledru
932ea96cb6 Update a GNU test error check - tests/cp/fail-perm.sh 2024-01-05 00:03:12 +01:00
Sylvestre Ledru
be816027ae
Merge pull request #5782 from samueltardieu/issue-5777
fuzz: reset the exit code global variable after every test
2024-01-04 19:47:54 +01:00
Samuel Tardieu
c23dbd3166 fuzz: reset the exit code global variable after every test 2024-01-04 19:07:24 +01:00
Dorian Péron
6760d63539 ls: Fix clippy warning 2024-01-04 16:51:30 +01:00
Sylvestre Ledru
d07a2f0d86
Add new fuzzers: cut, sort, split and wc (#5760)
* fuzz: use thread to bypass the limitation of output

Closes: #5724

many thanks to @samueltardieu

* fuzz: enable seq as the stalled issue is fixed

* fuzz: add 4 more fuzzers

* fuzz: enable the 4 new fuzzers in the CI

* remove old import

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

* remove comment

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

* remove comment

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

* add more flags

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

* add space

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

* add a comment about sort local

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

* wrong copy/paste

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

* fuzz: import "std::env"

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-01-04 13:40:47 +01:00
Daniel Hofstetter
b74953ab0e
Merge pull request #5779 from sylvestre/gnu-dl
gnu compare: try to use a local copy if the download failed
2024-01-04 08:19:58 +01:00
Sylvestre Ledru
217aa3bd9d gnu compare: try to use a local copy if the download failed 2024-01-03 20:42:25 +01:00
Dorian Péron
e30f191579 ls: Handle the use of QUOTING_STYLE variable 2024-01-03 18:37:51 +01:00
Sylvestre Ledru
78405e6a30
Merge pull request #5775 from cakebaker/du_ignore_duplicate_files_files0_from
du: ignore duplicate names with `--files0-from`
2024-01-03 16:49:40 +01:00
Daniel Hofstetter
f3833bb652
Merge pull request #5758 from sylvestre/fuzz-thread
fuzz: use thread to bypass the limitation of output
2024-01-03 14:47:52 +01:00