1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-16 18:21:01 +00:00
Commit graph

7716 commits

Author SHA1 Message Date
hamflx
b96f825503 mv: Make mv command fallback to copy only if the src and dst are on different device 2025-02-17 00:22:28 +01:00
Sylvestre Ledru
511590ad44
Merge pull request #7303 from rwdj/fix-5692-usage-strings
Fix usage strings for #5692
2025-02-17 00:14:17 +01:00
Jeffrey Finkelstein
464181bb56 rm: simplify remove_dir() helper function 2025-02-16 12:18:37 -05:00
RWDJ
55502cb44f
test: fix usage string
`[` alone is not a valid test command.
`test` alone is a valid test command.
`]` alone is not a valid test command.

Update usage string to match GNU behavior.
2025-02-15 19:27:01 -06:00
RWDJ
9f93bb1932
hashsum: fix usage string
hashsum requires a --<digest> and may accept multiple options.
2025-02-15 18:53:05 -06:00
RWDJ
460dc52e68
unlink: fix usage string
unlink must either take an option or a file. Update usage string to
match GNU behavior.
2025-02-15 18:51:59 -06:00
RWDJ
4649c717b6
runcon: fix usage string
runcon requires a context command. Update usage string to match GNU
behavior.
2025-02-15 18:51:44 -06:00
aimerlief
dd7b45465c
cp: print verbose msg after prompt (#7287)
* cp: fix verbose output order after prompt

Fixes: #7285

* cp: add test for verbose message order

* cp: fix test for interactive prompt ordering

* cp: update test for verbose output order

* cp: fix test cases to use update option
2025-02-11 09:19:08 +01:00
Jeffrey Finkelstein
18f9ca9da4 csplit: don't panic on missing suppressed file
Avoid a panic that would occur when attempting to remove a file that
didn't exist. This would happen when scanning for a regular expression
match, advancing by a positive offset, and suppressing empty files. For
example, before this commit,

    echo a | csplit -z - %a%1

would cause a panic. After this commit, the process terminates as
expected: without error, without output, and without any files written.

Fixes #7251.
2025-02-09 22:04:47 -05:00
Daniel Hofstetter
d86a7fb593
Merge pull request #7274 from jfinkels/touch-obsolete-posix-args
touch: support obsolete POSIX timestamp argument
2025-02-08 15:24:23 +01:00
Jeffrey Finkelstein
864215653e Collapse multiple if statements with && 2025-02-08 08:49:08 -05:00
Daniel Hofstetter
03b6371422
Merge pull request #7273 from RenjiSann/tee-fix-p-broken-stdout
tee: fix -p behavior upon broken pipe stdout
2025-02-07 16:19:18 +01:00
Jeffrey Finkelstein
c9312eba9a cat: error when output is input and appending
Change `cat` so that it terminates with an error message when the input
file is the same as the output file and the output file is being
appended to. For example,

    cat <f >>f
    cat: -: input file is output file

Fixes #7165
2025-02-07 07:45:21 -05:00
Jeffrey Finkelstein
c23e1db9c5 Use the last, not first, two digits as the year 2025-02-06 22:02:47 -05:00
Dorian Peron
67aa0b25ab tee: fix -p behavior upon broken pipe stdout 2025-02-06 11:29:29 +01:00
Jeffrey Finkelstein
6dfa1f8276 touch: support obsolete POSIX timestamp argument
Support obsolete form of timestamp argument for old POSIX versions. In
summary, when older versions of POSIX are used and the first positional
argument looks like a date and time, then treat it as a timestamp
instead of as a filename. For example, before this commit

    _POSIX2_VERSION=199209
    POSIXLY_CORRECT=1
    touch 01010000 11111111

would create two files, `01010000` and `11111111`. After this commit,
the first argument is interpreted as a date and time (in this case,
midnight on January 1 of the current year) and that date and time are
set on the file named `11111111`.

Fixes #7180.
2025-02-05 22:04:47 -05:00
karlmcdowall
f94ff78ea4
head: fix bug reading back through files (#7248)
* head: fix bug reading back through files

Fix issue #7247.
Rework logic for reading/seeking backwards through files.
Bug was seen when reading back through large files.
Added test case to validate fix.
2025-02-03 20:13:46 +01:00
Dorian Péron
f2cf08b4e6 test(cksum): fix and un-ignore test_md5_bits 2025-02-03 11:06:47 +01:00
Dorian Péron
2fadd253f7 cksum: fix --binary reset (issue #6375) 2025-02-03 09:58:52 +01:00
Sylvestre Ledru
717a6921fc
Merge pull request #7246 from RenjiSann/printf-negative-asterisk
printf: negative asterisk param changes alignment
2025-02-02 23:13:56 +01:00
Jeffrey Finkelstein
db280b6e9f printf: error on missing hexadecial escape value
Change `printf` to correctly terminate with an error message when an
escape sequence starts with `\x` but doesn't include a literal
hexadecimal value after. For example, before this commit,

    printf '\x'

would output `\x`, but after this commit, it terminates with an error
message,

    printf: missing hexadecimal number in escape

Fixes #7097
2025-02-02 11:07:31 -05:00
Dorian Peron
dcc2f1b72c printf: remove unneeded Result<> from resolve_asterisk* functions 2025-01-31 16:54:01 +01:00
Dorian Peron
707e346b84 printf: negative asterisk param changes alignement 2025-01-31 16:50:26 +01:00
Daniel Hofstetter
527602248f shuf: adapt to API changes of rand 2025-01-30 10:39:00 +01:00
Daniel Hofstetter
7cff766bdc mktemp: adapt to API change of rand 2025-01-30 08:52:42 +01:00
Daniel Hofstetter
ddb027231f shred: adapt to API changes of rand 2025-01-30 08:52:42 +01:00
Daniel Hofstetter
a5fb8f952b sort: adapt to API changes of rand 2025-01-30 08:52:42 +01:00
Dorian Peron
ae6cb8fed3 printf: show warning message in case of excess arguments 2025-01-29 14:01:35 +01:00
Tommaso Fellegara
1595b6afaa
kill: use only least significant bits to identify signal with -l (#7225)
* kill: check the lower 5 bits when the input is a number

* test/kill: added testcase

* kill: check the last 7 bits

* kill: check only the last 8 bits and the signals in the range [128, 159]

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-01-28 10:21:19 +01:00
Sylvestre Ledru
7747351cb1
Merge pull request #7227 from cakebaker/bump_nom
Bump `nom` and adapt `tr` to API changes
2025-01-27 11:11:52 +01:00
Daniel Hofstetter
5efd51b5ce tr: adapt to API changes in nom 2025-01-27 10:27:08 +01:00
Daniel Hofstetter
120b6aeb73
Merge pull request #7220 from sylvestre/docsrs-uucore
uucore/docs.rs: generate the doc for all features
2025-01-27 09:31:56 +01:00
Sylvestre Ledru
2e09fdcbdf uucore/docs.rs: generate the doc for all features 2025-01-26 19:54:12 +01:00
Alexander Shirokov
ae7238bbdf
od:use derived PartialEq and Eq
Removing custom PartialEq and Eq implementations helps avoid issues like:

    help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
       |
    29 |             (IntWriter(a), IntWriter(b)) => std::ptr::fn_addr_eq(*a, *b),
       |                                             ++++++++++++++++++++++ ~~~ +

Observable on nightly 1.86
2025-01-26 11:42:35 +01:00
Daniel Hofstetter
dfd5885e37
Merge pull request #7207 from sylvestre/thiserror3
Move other programs to thiserror
2025-01-25 14:29:03 +01:00
Sylvestre Ledru
3f38a75164 groups: remove useless comment 2025-01-24 20:11:03 +01:00
Sylvestre Ledru
e3272a38f3 groups: move to thiserror 2025-01-24 20:11:03 +01:00
Sylvestre Ledru
94b655c073 tsort: move to thiserror 2025-01-24 20:11:03 +01:00
Sylvestre Ledru
096e41086d du: move to thiserror 2025-01-24 20:11:03 +01:00
Sylvestre Ledru
3fe1cbe71f mktemp: move to thiserror 2025-01-24 20:11:03 +01:00
Sylvestre Ledru
e7c3a4d018 nohup: move to thiserror 2025-01-24 20:11:03 +01:00
Daniel Hofstetter
2668c98d9d kill: don't allow lowercase signal names with '-' 2025-01-24 16:43:50 +01:00
Daniel Hofstetter
10f43ec936
Merge pull request #7129 from sylvestre/chgrp
chgrp: add option --from
2025-01-24 10:08:35 +01:00
Sylvestre Ledru
4f83924092
Merge branch 'main' into sort-mem-percent 2025-01-23 22:52:00 +01:00
danieleades
5d6a04ab71
Fix clippy warning manual_if_else (#7177)
and enable the rule
2025-01-23 22:49:13 +01:00
Sylvestre Ledru
704421bd6b
Merge pull request #7200 from cakebaker/timeout_add_f_and_p
timeout: add support for `-f` and `-p` short options
2025-01-23 22:47:45 +01:00
Sylvestre Ledru
4c3e9c893a chgrp: split the functions into two 2025-01-23 22:38:38 +01:00
Sylvestre Ledru
d76c561516 chgrp: support the --from=:X syntax 2025-01-23 22:38:38 +01:00
Sylvestre Ledru
8e9a4b5f9a chgrp: adjust the output with group 2025-01-23 22:38:38 +01:00
Sylvestre Ledru
c45bbe3d1c chgrp: add option --from 2025-01-23 22:38:38 +01:00