1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00
Commit graph

3499 commits

Author SHA1 Message Date
Daniel Hofstetter
de18b76555 numfmt: use succeeds/fails instead of run in tests 2025-01-14 16:29:46 +01:00
Sylvestre Ledru
74d80eab0a
Merge pull request #7061 from DaringCuteSeal/cp-stream-2
cp: implement copying from streams
2025-01-13 14:13:13 +01:00
Sylvestre Ledru
40511f6da0
Merge pull request #7122 from jfinkels/dd-error-iflag-directory
dd: error if iflag=directory and input is stdin
2025-01-13 14:11:32 +01:00
Jeffrey Finkelstein
071e72ffc8 split: fix bug with large arguments to -C
Fix the behavior of `split -C` when given large arguments. Before this
commit, bytes were being greedily assigned to a chunk too aggressively,
leading to a situation where a split happened in the middle of a line
even though the entire line could have fit within the next chunk. This
was appearing for large arguments to `-C` and long lines that extended
beyond the size of the read buffer. This commit fixes the behavior.

Fixes #7026
2025-01-13 09:36:48 +01:00
Jeffrey Finkelstein
d9b3b3ef67 dd: error if iflag=directory and input is stdin
Make `dd` error if `iflag=directory` and the input file is not a
directory, as in

    : | dd iflag=directory

Fixes #5900
2025-01-13 09:36:36 +01:00
Sylvestre Ledru
35b896f5e1
Merge pull request #7093 from jfinkels/tsort-print-cycle
tsort: print nodes and cycles as they are visited
2025-01-13 08:52:38 +01:00
Sylvestre Ledru
988cc4eae3
Merge pull request #7115 from jfinkels/stat-format-mtime-precision
stat: fix precision when rendering mtime (%Y)
2025-01-12 17:07:31 +01:00
Anirban Halder
924d40867c chroot: make group option self overwriting 2025-01-12 01:08:38 +05:30
Jeffrey Finkelstein
f59c7899c3 Add more test cases and improve precision 2025-01-11 11:27:18 -05:00
Sylvestre Ledru
6457836f33 chmod: Remove misleading comments 2025-01-11 16:07:07 +01:00
Sylvestre Ledru
78b09f400b chmod: merge some tests into one 2025-01-11 12:48:30 +01:00
Sylvestre Ledru
b0126fdc68 chmod: Implement --dereference, -L, -H, etc
Should fix tests/chmod/symlinks.sh
2025-01-11 12:48:30 +01:00
Sylvestre Ledru
c47ead3639 chmod: split a test into two as they are testing different things 2025-01-11 12:48:30 +01:00
Jeffrey Finkelstein
1d0dcb5962 stat: fix precision when rendering mtime (%Y)
Support precision when rendering the time of last data modification
with `stat`. For example, after this commit

    $ stat --printf='%.1Y\n' f
    1668645806.7

Previously, the precision in the format specification was
ignored. This is implemented with a custom renderer because GNU `stat`
seems to truncate the number as opposed to rounding the number as
would happen when using `format!` with a specified number of digits of
precision.

Fixes #3233
2025-01-10 21:31:01 -05:00
Daniel Hofstetter
e75abb2dbd cp: fix error from large_stack_arrays lint in test 2025-01-10 08:33:28 +01:00
Daniel Hofstetter
e777db9304 ls: compile regexes outside of loop in tests 2025-01-10 07:42:13 +01:00
Daniel Hofstetter
6096767442 csplit: simplify test 2025-01-09 15:20:22 +01:00
Fuad Ismail
a4fdecbf48 tests/csplit: use printf instead of echo -n for maximum portability with all UNIX systems 2025-01-09 10:52:19 +01:00
Fuad Ismail
981019138d tests/csplit: ignore IRWXU from cspell check 2025-01-09 10:52:19 +01:00
Fuad Ismail
96929734ea tests/csplit: modify no_such_file test expected error to conform better with original csplit error 2025-01-09 10:52:19 +01:00
Fuad Ismail
c8bc5d2455 tests/csplit: handle directory input file test for Windows separately 2025-01-09 10:52:19 +01:00
Fuad Ismail
19f990f29a tests/csplit: add directory input file test. 2025-01-09 10:52:19 +01:00
Fuad Ismail
1dc463fd26 tests/csplit: add named pipe input file test. 2025-01-09 10:52:19 +01:00
Tommaso Fellegara
33ac58383c
csplit: fix bug when --suppress-matched flag is active and positive/negative offset is present (#7088)
* tests/csplit: modified test test_up_to_match_offset_option_suppress_matched according to issue #7052 and modified also test_up_to_match_negative_offset_option_suppress_matched

* csplit: managed the positive and negative offset when the --suppressed-matched flag is active

* tests/csplit: modified test test_up_to_match_offset_option_suppress_matched according to issue #7052 and modified also test_up_to_match_negative_offset_option_suppress_matched

* csplit: managed the positive and negative offset when the --suppressed-matched flag is active

* csplit: swapped if and else blocks for better readability
2025-01-09 09:20:48 +01:00
Daniel Hofstetter
c531fb3973
Merge pull request #7090 from sylvestre/env
env/stbuf: better handling of the errors
2025-01-08 10:36:06 +01:00
Jeffrey Finkelstein
af99952de6 tsort: print nodes and cycles as they are visited
Update `tsort` so that

* nodes are printed as they are visited,
* cycles are printed as they are discovered,
* finding a cycle doesn't terminate the traversal,
* multiple cycles can be found and displayed.

Fixes #7074
2025-01-07 21:35:56 -05:00
Sylvestre Ledru
04d4c9e1ef stdbuf: better handling when non existing files
Should fix tests/misc/stdbuf
2025-01-08 00:13:31 +01:00
Sylvestre Ledru
79645d45ce stdbuf: better handling of the error message when no perm
Tested in tests/misc/stdbuf
2025-01-08 00:13:31 +01:00
Sylvestre Ledru
58f6afdeb4 env: handle the error properly
instead of:
env: unknown error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
2025-01-08 00:13:31 +01:00
Daringcuteseal
c6d1923701
tests/cp: add test to copy from stdin 2025-01-06 20:21:13 +07:00
Daringcuteseal
b75d0f9446
tests/cp: remove FreeBSD guard in FIFO copy test
Copying FIFOs now work under FreeBSD and other UNIX platforms.
2025-01-06 19:40:12 +07:00
Daniel Hofstetter
d8d635d014 echo: add support for POSIXLY_CORRECT 2025-01-06 09:51:41 +01:00
Sylvestre Ledru
934e85f4cd
cp: make --backup and --no-clobber are mutually exclusive (#7082)
* cp: make --backup and --no-clobber are mutually exclusive

Should fix tests/cp/cp-i.sh

* simplify the test

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

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-01-06 09:40:41 +01:00
Sylvestre Ledru
0459369e92
Merge pull request #7068 from DaringCuteSeal/head-dev-full
head: make head fail when writing to /dev/full
2025-01-06 09:07:28 +01:00
Mark
49ae68d443
cp: copy attributes after making subdir (#6884) 2025-01-05 22:12:12 +01:00
Daniel Hofstetter
e3acd5ab07
Merge pull request #7078 from jfinkels/tsort-split-whitespace
tsort: split edge data on any whitespace chars
2025-01-05 15:27:43 +01:00
Daniel Hofstetter
d9936ca583
Merge pull request #7079 from Felle33/cksum_--tag_meaningless_with_--check
cksum: the --tag is meaningless with --check
2025-01-05 14:43:38 +01:00
Daniel Hofstetter
4ff48c3d85
Merge pull request #7009 from sylvestre/xattrs
cp: when copying a read only file, make sure that the xattrs can be set properly
2025-01-05 13:51:00 +01:00
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