1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-19 19:51:09 +00:00
Commit graph

7591 commits

Author SHA1 Message Date
jfinkels
f2dbd200aa printf: remove allow(dead_code) directive
Remove an `allow(dead_code)` directive that seems unnecessary.
2025-01-10 11:13:48 +01:00
jfinkels
43c7dfdd91 uucore: remove mention of crash in docs
The `crash!` macro has been removed in https://github.com/uutils/coreutils/pull/7084
2025-01-10 09:34:39 +01:00
Daniel Hofstetter
51f4bfa1a9 uucore: use is_some_and instead of map_or 2025-01-10 08:55:45 +01:00
Daniel Hofstetter
55367205a9 cp: use is_ok_and instead of map_or 2025-01-10 08:53:03 +01:00
Daniel Hofstetter
c872cfa5d1 cp: use is_some_and instead of map_or 2025-01-10 07:28:37 +01:00
Fuad Ismail
694298f0d1 csplit: modify failure in opening file error message 2025-01-09 10:52:19 +01:00
Fuad Ismail
51dce9c5f8 csplit: return UResult instead of io::Result from iterator to handle error message more uniformly. 2025-01-09 10:52:19 +01:00
Fuad Ismail
757c0b260e csplit: defer IO read error handling to iterator. 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
Sylvestre Ledru
20e043c5fc stdbuf: Improve the code 2025-01-08 00:16:37 +01: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
Saúl Valdelvira
6f35be40e8 uucore: Remove crash! macro 2025-01-07 17:37:10 +01: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
7a78213edb
Merge pull request #7060 from DaringCuteSeal/bufcopy-cleanup
uucore/buf-copy: delete redundant functions
2025-01-06 09:08:32 +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
Daringcuteseal
509b755b3b
head: make process fail when writing to /dev/full 2025-01-06 04:58:56 +07:00
Mark
49ae68d443
cp: copy attributes after making subdir (#6884) 2025-01-05 22:12:12 +01:00
Sylvestre Ledru
8d55e4edd1
Merge pull request #7080 from cakebaker/cksum_remove_unnecessary_type_info
cksum: remove some unnecessary type info
2025-01-05 17:58:20 +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
5dfeb809a4 cksum: remove some unnecessary type info 2025-01-05 14:50:14 +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
dd17f9a61c cksum: check ourself the flags --check and --tag and output the correct error 2025-01-05 10:28: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
Jeffrey Finkelstein
5cf5acb4a2 tsort: use std::io::read_to_string to load data 2025-01-04 22:51:57 -05:00
Jeffrey Finkelstein
c9ae4819f5 tsort: use TsortError for errors in tsort 2025-01-04 22:51:52 -05:00
Daringcuteseal
5fe6706c51
head: refactor to use specific error enums 2025-01-05 09:14:02 +07:00
Jeffrey Finkelstein
4f43e7f2dd mkfifo: add missing "mode" feature for uucore dep 2025-01-04 17:58:29 -05: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
Sylvestre Ledru
8ab7bbafe1
Merge pull request #7057 from jfinkels/chroot-set-groups
chroot: fix many issues with chroot
2025-01-03 19:44:49 +01:00
Daringcuteseal
35a044b532
uucore/buf-copy: delete redundant functions 2025-01-03 18:11:18 +07:00
Jeffrey Finkelstein
b29d8f1008 chroot: fix several group setting issues
Fix several issues in the behavior of `chroot`, mostly around setting
group IDs. This commit ensures that supplemental groups provided by
`--groups` are properly handled with respect to the groups implied by
`--userspec`. This commit also ensures that we fall back to numeric
parsing when attempting to lookup user and group IDs from their names.
2025-01-02 20:08:47 -05:00
Jeffrey Finkelstein
b59da37365 chroot: make Options.groups into an Option type
Change the type of `Options.groups` to be `Option<Vec<String>>` so that
the absence of the `--groups` option is meaningfully distinguished from
an empty list of groups. This is important because `chroot --groups=''`
is used specifically to disable supplementary group lookup.
2025-01-02 20:08:47 -05:00
Jeffrey Finkelstein
52c05e2fd6 chroot: improve parsing of --groups parameter
Improve the parsing of the `--groups` parameter to `chroot` so that it
handles more error cases and better matches the behavior of GNU
`chroot`. For example, multiple adjacent commas are allowed:

    --groups=a,,,b

but spaces between commas are not allowed:

    --groups="a, , ,b"
2025-01-02 20:08:47 -05:00
Daniel Hofstetter
e22bcbb74d chroot: remove outdated info from help 2025-01-02 13:38:39 +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
Daniel Hofstetter
7c7a6f89ab
Merge pull request #7016 from sylvestre/ls-mtime
ls: finish the plug of mtime
2025-01-01 08:25:05 +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