1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00
Commit graph

3511 commits

Author SHA1 Message Date
tommi
61290fd6e8 tests/cksum: test added to check that the --check and --tag flags are meaningless 2025-01-05 10:32:08 +01:00
Jeffrey Finkelstein
f703e88e9f tsort: split edge data on any whitespace chars
Make `tsort` split on any whitespace character instead of just
whitespace within a single line. This allows edge information to be
split with the source node on one line and the target node on another.

For example, after this commit

    $ printf "a\nb\n" | tsort
    a
    b

whereas before this would print an error message.

Closes #7077
2025-01-04 22:52:01 -05:00
Daringcuteseal
9202f23787
tests/head: add test to write to /dev/full 2025-01-05 09:14:05 +07:00
Tommaso Fellegara
b15bc8440c
cksum: fix error message when the flags length and an algorithm different from blake2b are present (#7071)
test length and blake2b algorithm before testing supported algorithms
2025-01-04 21:53:10 +01:00
Sylvestre Ledru
da2a4fedf5 cp: when copying a read only file, make sure that the xattrs can be set properly
on the destination

Should fix tests/misc/xattr.sh
2025-01-04 20:36:43 +01:00
Samuel Tardieu
b5fc19e60e kill: make -s conflict with -l and -t 2025-01-04 15:04:12 +01:00
Samuel Tardieu
c6d3ec688c kill: add -n hidden option for compatibility with bash
GNU coreutils also implements it this way.
2025-01-04 11:33:54 +01:00
Daniel Hofstetter
e5e589afd5 chroot: remove short option "-G" 2025-01-02 13:35:19 +01:00
Sylvestre Ledru
6a8b766d6d
Merge pull request #7020 from jtracey/ls-nonunicode
ls: add better support for non-UTF-8 bytes
2025-01-02 11:16:58 +01:00
Jeffrey Finkelstein
5bd5cdb7c1 chroot: fix parsing of --userspec argument
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.

Closes #7040.
2025-01-02 10:26:13 +01:00
Daniel Hofstetter
a049427e88
Merge pull request #7046 from sylvestre/uniqu
uniq: fix multibyte input
2025-01-01 14:53:03 +01:00
Sylvestre Ledru
6d028cd097
Merge pull request #7034 from alexs-sh/uucore-fix-fp-general-format-output
uucore:format:fix floating-point representation
2025-01-01 14:46:33 +01:00
Sylvestre Ledru
1e23a3fa8d uniq: fix multibyte input
Should fix tests/uniq/uniq.pl
2025-01-01 13:17:52 +01:00
Sylvestre Ledru
958ac72113 ls: finish the plug of mtime
Will help with tests/ls/ls-time
2024-12-31 18:14:41 +01:00
Alexander Shirokov
4c330d43ba
uucore:format:fix floating-point rounding
This change resolves issues with exponent calculation and usage,
ensuring more accurate formatting:

- Exponent for negative values can differ from 0
- Switching to decimal mode now follows the P > X ≥ −4 rule
2024-12-31 13:19:43 +01:00
Daniel Hofstetter
a3b7a08238
Merge pull request #7015 from sylvestre/chroot-user
chroot: handle the error when invalid user
2024-12-31 11:46:04 +01:00
Sylvestre Ledru
ed9e80e488
Merge pull request #7032 from jfinkels/seq-fmt-errors
seq: improve error handling for invalid -f values
2024-12-31 09:33:16 +01:00
jovie :)
646fc394f6
env: don't allow '=' with -u (#7008)
* Added error handling to ensure '=' after -u returns 125 as '=' is not allowed

* Added tests for disallow = on short options

* Added error handling to ensure '=' after -u returns 125 as '=' is not allowed

* Added tests for disallow = on short options

* Disallow only short unset option from having '=' as its starting character

* Remove needless tests and update function name for clarity
2024-12-31 09:16:14 +01:00
Jeffrey Finkelstein
c9acf5ddd4 head: fix subtraction underflow with --bytes=-N
Fix a subtraction underflow that occurred on `head --bytes=-N` when the
input had fewer than `N` bytes. Before this commit,

    printf "a" | head -c -2

would panic. After this commit, it terminates successfully with no
output as expected.
2024-12-30 21:07:45 -05:00
Jeffrey Finkelstein
cccab35337 seq: improve error handling for invalid -f values
Improve the error message produced by `seq` when given invalid format
specifiers for the `-f` option. Before this commit:

    $ seq -f "%" 1
    seq: %: invalid conversion specification
    $ seq -f "%g%" 1
    seq: %: invalid conversion specification

After this commit:

    $ seq -f "%" 1
    seq: format '%' ends in %
    $ seq -f "%g%" 1
    seq: format '%g%' has too many % directives

This matches the behavior of GNU `seq`.
2024-12-30 12:30:26 -05:00
Justin Tracey
b0837a0ca5
ls: add better support for non-UTF-8 bytes 2024-12-28 22:27:22 -05:00
Daringcuteseal
e07cc67b30
tests/install: add tests to install from stdin 2024-12-29 07:17:41 +07:00
Sylvestre Ledru
7d628c65d3 chroot: handle the error when invalid user
Currently fails with:
```
2024-12-28T14:55:18.9330231Z thread 'main' panicked at src/uu/chroot/src/chroot.rs:284:46:
2024-12-28T14:55:18.9330718Z called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "Not found: nobody:+65535" }
2024-12-28T14:55:18.9331305Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
2024-12-28 22:29:27 +01:00
Sylvestre Ledru
067b2964c6
Merge pull request #6993 from jtracey/wc-fixes
wc: fix escaping
2024-12-28 12:52:12 +01:00
Justin Tracey
ff8a31e835
wc: fix escaping
GNU wc only escapes file names with newlines in them.
2024-12-27 11:37:16 -05:00
Daniel Hofstetter
f62b8d7975 csplit: allow offset without sign in pattern 2024-12-27 16:08:48 +01:00
Daniel Hofstetter
20dfb27057 cut: fix handling of newline as delimiter 2024-12-27 09:12:47 +01:00
Solomon
98c9be5ec4
mv: improve move-to-self error handling (#6995)
- improve move-to-self detection, so this errors without data loss:

```diff
 mkdir mydir
 mv mydir mydir/subdir
-mv: No such file or directory (os error 2)
+mv: cannot move 'mydir' to a subdirectory of itself, 'mydir/subdir'
```

- align "cannot move source to a subdirectory of itself" and "same file"
  errors more closely with coreutils:

```diff
 mkdir mydir
 mv mydir/ mydir/..
-mv: cannot move 'mydir/' to a subdirectory of itself, 'mydir/../mydir/'
+mv: 'mydir/' and 'mydir/../mydir' are the same file
```

Causing: https://github.com/nushell/nushell/issues/13082
2024-12-26 20:48:29 +01:00
Sylvestre Ledru
b4cdc36573
Merge pull request #6997 from cakebaker/echo_handle_double_hyphen
echo: handle double hyphens
2024-12-26 12:19:07 +01:00
Daniel Hofstetter
db37c316af csplit: add support for -q 2024-12-26 09:40:55 +01:00
Daniel Hofstetter
90465357e2 echo: handle double hyphens 2024-12-24 17:01:45 +01:00
Daniel Hofstetter
2c2f5f14a4 echo: use succeeds() to simplify some tests 2024-12-24 16:03:00 +01:00
Daniel Hofstetter
d3db8dc29f
Merge pull request #6987 from sylvestre/setcap
ls: when a file has capabilities (setcap), change the color
2024-12-22 17:12:35 +01:00
Sylvestre Ledru
9a97c18877 ls: when a file has capabilities (setcap), change the color
Should fix tests/ls/capability.sh
2024-12-22 16:17:05 +01:00
Daniel Hofstetter
392c48002c cut: don't merge adjacent ranges 2024-12-22 15:07:04 +01:00
Sylvestre Ledru
913d5d413b
Merge pull request #6957 from karlmcdowall/sort_merge_chunking_rework
sort: Rework merge batching logic
2024-12-21 23:19:44 +01:00
Daniel Hofstetter
a152687d48
Merge pull request #6971 from sylvestre/mkfifo
mkfifo: better handle the mode + umask
2024-12-21 15:31:15 +01:00
Sylvestre Ledru
31ffc3a0eb mkfifo: better handle the mode + umask
Should make tests/misc/mknod.sh pass
2024-12-20 18:17:52 +01:00
Daniel Hofstetter
cf8a81c6c2 cut: fix overriding of -d= 2024-12-20 10:02:36 +01:00
Daniel Hofstetter
6224c374ae cut: use short and long args in two tests 2024-12-18 16:17:30 +01:00
Daniel Hofstetter
5ea4903632 cut: rename some tests 2024-12-18 14:52:04 +01:00
Daniel Hofstetter
9aca24365f cut: simplify test by removing assert_eq! calls 2024-12-18 14:44:12 +01:00
Daniel Hofstetter
2f82853bfa cut: move two tests to better places within file 2024-12-18 14:42:18 +01:00
Daniel Hofstetter
d414dbc83b basenc: ignore case with "--base16 --decode" 2024-12-17 10:52:25 +01:00
Sylvestre Ledru
6755956bc4
cut.pl: adjust to our messages as they are better (#6921)
* cut.pl: adjust to our messages as they are better

but we still have some differences on this test

* cut: add some missing line return when needed

* cut: add failing tests covered by cut.pl

* Remove dup test

* cut: add spell-checker:ignore line to test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-12-16 15:37:29 +01:00
Karl McDowall
6bdcad32da sort: Rework merge batching logic
Fix bug #6944
Rework the way batching is done with sort such that it doesn't open
more input files than necessary. Previously, the code would always
open one extra input file which causes problems in ulimit scenarios.
Add additional test case.
2024-12-15 12:40:15 -07:00
Daniel Hofstetter
ee0426e3f3 seq: use allow_hyphen_values instead of
allow_negative_numbers because clap removed support for "exotic" negative
numbers like -.1
2024-12-15 16:14:01 +01:00
Daniel Hofstetter
209ec0b817
Merge pull request #6929 from RenjiSann/cksum-fixes
cksum: even more fixes
2024-12-12 10:16:48 +01:00
Dorian Péron
958222a07c test(cksum): un-ignore tests that are now implemented 2024-12-12 09:49:53 +01:00
Dorian Péron
df16c1c655 test(cksum): Add tests 2024-12-10 13:09:04 +01:00