Commit graph

7261 commits

Author SHA1 Message Date
renovate[bot]
c075d78efd
fix(deps): update rust crate wild to 2.2.1 2024-05-03 05:40:58 +00:00
renovate[bot]
5f445871ea
fix(deps): update rust crate quote to 1.0.36 2024-05-03 05:01:12 +00:00
Daniel Hofstetter
19901055a2 clippy: fix warnings introduced with Rust 1.78 2024-05-02 16:47:44 +02:00
renovate[bot]
d9ac8a70c1
fix(deps): update rust crate cpp to 0.5.9 2024-05-02 09:48:51 +00:00
renovate[bot]
e76891726a
chore(deps): update rust crate tempfile to 3.10.1 2024-05-02 07:01:17 +00:00
renovate[bot]
783926806c
chore(deps): update rust crate cpp_build to 0.5.9 2024-05-01 12:37:37 +00:00
Sylvestre Ledru
45bf1991d1
Merge pull request #6251 from tertsdiepraam/multicall-list
multicall: add --list to list all utils
2024-05-01 10:17:01 +02:00
Terts Diepraam
3346b4147a
ls: upgrade uutils-term-grid to 0.5 (#5485) 2024-05-01 10:16:15 +02:00
Ben Wiederhake
900c3916d5 tail: remove unused spell-checker:disable 2024-04-30 18:28:20 +02:00
Ben Wiederhake
95b36f2d4f uucore: remove unused spell-checker:disable 2024-04-30 18:28:20 +02:00
Terts Diepraam
b1ba249528 multicall: add --list to list all utils 2024-04-30 17:26:02 +02:00
Laurent Cheylus
ee4392e30c
sort: disable clippy::suspicious_open_options on OpenBSD
- Avoid error on OpenBSD stable/7.5 with clippy (lint)
- suspicious_open_options added in Rust 1.77.0 (1.76 used on OpenBSD 7.5)
  https://rust-lang.github.io/rust-clippy/master/index.html#/suspicious_open_options

Fix uutils/coreutils#6290

Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-04-30 10:05:28 +02:00
Ben Wiederhake
4f5a3b4716 id: mark passwd-format and pretty-print as conflicting
These are non-sensical to combine, and didn't work reasonably anyway.
Also, passwd-formatting is our own extension, so there is no need for
compatibility anyway.
2024-04-28 23:05:43 +02:00
Ben Wiederhake
e978fe5382 id: permit repeated flags 2024-04-28 22:39:14 +02:00
renovate[bot]
9e52aa0cb1
fix(deps): update rust crate data-encoding-macro to 0.1.15 2024-04-28 10:39:08 +00:00
renovate[bot]
dcf7a50392
fix(deps): update rust crate data-encoding to 2.6 2024-04-28 09:21:27 +00:00
Darius Carrier
5ee9c69f59
kill: adding support for handling SIGEXIT (#6269)
kill: convert SIGEXT (0) to None so nix takes correct action
2024-04-27 17:33:45 +02:00
Sylvestre Ledru
4090d468c0
Merge pull request #6162 from BenWiederhake/dev-undo-custom-exit-codes
all: Undo custom exit codes
2024-04-25 08:11:41 +02:00
Sylvestre Ledru
72b4a0888d
Merge pull request #6268 from jadijadi/fix-netbsd-build
Fixing the build issue on NetBSD
2024-04-24 18:26:26 +02:00
Jadi
ac87b73244 Fixing the build issue on NetBSD.
The NetBSD was missing for target-os checks on fsext.rs

Fixed #6261
2024-04-24 15:26:02 +00:00
Daniel Hofstetter
91b4ce6426 ls: add uucore/format feature 2024-04-24 17:06:13 +02:00
Daniel Hofstetter
89af8b9769 du,uucore: add words to spell-checker:ignore 2024-04-24 16:54:32 +02:00
Michael Vogt
61e0450c66 du: give -h output the same precision as GNU coreutils
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same by sharing the code with `ls`.

Closes: #6159
2024-04-24 16:53:08 +02:00
Michael Vogt
d07fb73630 ls,uucore: extract display human_readable() helper from ls
This commit extract the `display_size()` helper from `ls` into
`uucore` as `human_readable` to be similar to the gnulib helper
so that the human readable display of sizes can be shared between
ls, du, df.
2024-04-24 16:53:08 +02:00
Anton Patrushev
423494421b
more: use dev tty instead of mio to avoid panics (#6262)
* more: use dev tty instead of mio to avoid panics

* move more specific dependecy to more package
2024-04-23 16:48:21 +02:00
Anirban Halder
421b820ec2
Fix the debug results in cp --debug (#6220) 2024-04-22 17:02:21 +02:00
Daniel Hofstetter
d8792d7b69 env: add missing space to help output 2024-04-22 16:56:21 +02:00
Ulrich Hornung
d202baba97 use num_prime for factorisation to fix gnu test 2024-04-21 11:24:25 +02:00
Sylvestre Ledru
64027e5a57
Merge pull request #6252 from sylvestre/hash-error
hashsum: improve the error management to match GNU
2024-04-21 09:55:16 +02:00
sreehari prasad
a1717436a4
cp: gnu "same-file" test case compatibility (#6190)
* cp: -b doesn't ignore "version control" env

* cp: gnu "same-file" test compatibility fix
2024-04-21 09:49:45 +02:00
Sylvestre Ledru
6ef08d7f1c hashsum: improve the error management to match GNU
Should make tests/cksum/md5sum.pl and tests/cksum/sha1sum.pl pass
2024-04-21 09:08:27 +02:00
Sylvestre Ledru
94f5e82dbd hashsum: ignore empty lines in --check 2024-04-21 09:08:27 +02:00
Sylvestre Ledru
beb7395c84 hashsum: move handle_captures & gnu_re_template move away from the hashsum function 2024-04-21 09:08:27 +02:00
Daniel Hofstetter
c83cec7c0c env: move unit tests to env.rs 2024-04-21 01:26:50 +02:00
Sylvestre Ledru
4e1dbcd3fc
Merge pull request #6230 from sylvestre/hash-ignore-missing
hashsum: implement the ignore-missing option
2024-04-17 23:43:38 +02:00
Sylvestre Ledru
f817018f90 hashsum: --ignore-missing needs -c 2024-04-15 22:19:44 +02:00
Sylvestre Ledru
e194022c1f
Merge pull request #6240 from cakebaker/factor_remove_zero_method
factor: remove unused method `zero`
2024-04-15 20:09:49 +02:00
Sylvestre Ledru
40600f2419
Merge pull request #6241 from cakebaker/factor_allow_dead_code
factor: suppress some "never used" warnings
2024-04-15 20:09:37 +02:00
Daniel Hofstetter
d60fe6e9e9 factor: suppress some "never used" warnings 2024-04-15 16:40:11 +02:00
Daniel Hofstetter
dd25bab9b5 factor: remove unused method "zero" 2024-04-15 16:10:11 +02:00
Daniel Hofstetter
c9137a8075 od: remove print_width_block field of OutputInfo 2024-04-15 15:16:21 +02:00
Sylvestre Ledru
10def29b96
seq: fuzz PreciseNumber::from_str (#6183)
* fuzz the seq parse number functions

* run fuzz_parse_number into the CI
2024-04-15 08:07:06 +02:00
Haisham
b617876372 kill: ignore signal case on -s 2024-04-15 03:27:51 +02:00
Haisham
524be6e4ae kill: accept all casings for signal names in --list 2024-04-15 03:27:51 +02:00
Sylvestre Ledru
7f71611849
Merge pull request #6231 from LucasLarson/copy-recursive-option
swap `cp`’s short `-r` and alias `-R` recursive options
2024-04-14 22:09:07 +02:00
Lucas Larson
ffab3a12e7
fix: swap cp’s short -r and alias -R recursive options
the only implementable portion of #6223 is “to switch `-R` and `-r`
to `-r` being the alias because `-R` is the POSIX flag”

https://github.com/uutils/coreutils/issues/6223#issuecomment-2054097049

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
2024-04-14 15:30:17 -04:00
Sylvestre Ledru
b977d61f67 hashsum: implement the ignore-missing option
Tested by gnu/tests/cksum/md5sum.pl
2024-04-14 20:05:39 +02:00
Ben Wiederhake
3854569856 tee: ensure that -h and --help are identical 2024-04-14 15:42:13 +02:00
Ben Wiederhake
9527341714 pr: return correct exit code on error 2024-04-14 15:42:13 +02:00
Ben Wiederhake
f5f8cf08e0 hostid: return correct exit code on error 2024-04-14 15:42:13 +02:00
Ben Wiederhake
91679fc747 wc: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:47 +02:00
Ben Wiederhake
a699bfd1fb uniq: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
3285f95eb3 touch: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
25245bde65 tee: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
88a2ea4f3b tail: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
872ec050e4 sort: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
70d84e168c shred: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
1dd7d8e0db od: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
2646944bee numfmt: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
3877d14504 ls: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
27a81f3d32 du: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
d4546ced26 cp: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake
4ec82948b6 uucore: properly handle aliases in ShortcutValueParser 2024-04-14 15:39:46 +02:00
Haisham
333e4d9fe9
kill: print --table as vertical (#6216)
* kill: print --table as vertical

* kill: remove signal padding on --table

* kill: skip exit signal in --table

* kill: replace "skip" with "filter"

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-04-14 15:08:51 +02:00
Jadi
9b4a787be7
kill: return 1 and gnu style stderr in case of no pid (#6225)
* kill: return 1 and gnu style stderr in case of no pid

closes #6221

* Update src/uu/kill/src/kill.rs

Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>

---------

Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
2024-04-14 14:13:15 +02:00
Daniel Hofstetter
aaaf4c3f91 kill: don't show EXIT with --list 2024-04-14 13:42:55 +02:00
Haisham
693149d683 kill: support multiple signals for --list 2024-04-12 06:21:48 +02:00
Chad Williamson
9d82fa3b9a mv: avoid attempting to set xattr on redox 2024-04-12 06:16:48 +02:00
Daniel Hofstetter
5bf939aec6
Merge pull request #6207 from BenWiederhake/pr/6069
cp: handle update prompt with and without interactive mode enabled
2024-04-11 14:55:26 +02:00
Qiu Chaofan
11c9351a9c
Initial AIX support (#6209)
* Initial AIX support

Add support to build on AIX operating system. Most of the changes are
in fs part. Since AIX is still tier-3 target, current support is minimal
and does not require passing all tests.

* Fix spell checking failure
2024-04-10 13:40:44 +02:00
Vikrant2691
9b9c0cc237 cp: handle update prompt with and without interactive mode enabled 2024-04-09 15:14:33 +02:00
Sylvestre Ledru
aeafabd23f
Merge pull request #6185 from maxer137/main
seq: Removed zero-padding of string when parsing with parse_exponent_no_decimal
2024-04-08 09:14:42 +02:00
Haisham
843407faf8 kill: removed unnecessary calls to print in print_signals 2024-04-07 22:48:15 +02:00
Haisham
6e4c9119fb kill: print signals vertically 2024-04-07 22:48:15 +02:00
Ben Wiederhake
d5e7f9a4a4 wc: count ASCII control characters as word characters 2024-04-07 02:12:22 +02:00
Ulrich Hornung
eca8130a4a feature: env argv0 overwrite (unix only) 2024-04-07 01:27:30 +02:00
maxer137
538f5ba6c2
Merge branch 'main' into main 2024-04-05 20:43:02 +00:00
maxer137
0fdefc3767 seq: remove zero padding from parse_decimal_and_exponent
This adds the same fix applied to `parse_exponent_no_decimal`.
This way we don't need to create large strings
2024-04-05 15:01:18 +02:00
Daniel Hofstetter
ac12957307 cksum: fix code formatting 2024-04-05 07:14:37 +02:00
Jadi
4312f3c43e cksum: adding -b as the short form for --base64
closes #5706
2024-04-04 15:09:17 +03:30
maxer137
cdfcae4d4f seq: Reverted change in is_minus_zero check
I had made the mistake of not running all the tests. This is indeed needed. However, you still need to add the exponent if it's positive for 0 numbers.
This way, 0 numbers (such as 0e+5) will be counted as having a width of 5.

This change also removes the memory allocation needed for the previous implementation. Where the string itself would be padded with zeros on the right side. Creating large numbers this method would cause large allocations in memory.

This does not seem to fix issue #6182.
2024-04-03 19:20:27 +02:00
maxer137
362deeca84 seq: remove exponent exponent less than 0 check.
When exponent is greater than 0 we previously created a new string causing us to create a new string with a much larger size.
This would the get passed to the BigDecimal crate which would get stuck.
2024-04-03 16:07:31 +02:00
maxer137
efd7b6116c seq: remove is_minus_zero_float check on parse_exponent_no_decimal 2024-04-03 16:07:04 +02:00
Sylvestre Ledru
2fe5dc874e Fix clippy warning match_bool 2024-04-03 09:28:22 +02:00
Ben Wiederhake
714b4ff589 ls: fix exit code for --time-style when used 2024-04-01 22:57:18 +02:00
Ben Wiederhake
4a1bd78f48 ls: compute correct exit code on error
Note in particular that this seems to be the only tool where invalid
stringly-enum values cause a different exit code than invalid arguments.
2024-04-01 22:57:18 +02:00
Carbrex
49c7e65f5d Use time-style only if time is provided 2024-04-01 17:09:59 +02:00
Sylvestre Ledru
4482a6248f
Merge pull request #6157 from BenWiederhake/dev-tee-fail-open
tee: Correctly handle read-only files, avoid unnecessary wrapping
2024-04-01 01:41:40 +02:00
Michael Vogt
af0ba86657 date: support -f - to read from stdin
So far `date -f -` was not reading from stdin. This commit fixes
this.

Closes: #6058
2024-03-31 22:05:47 +02:00
Ben Wiederhake
675dd9404a tee: avoid unnecessarily cloning argument list 2024-03-31 18:47:32 +02:00
Ben Wiederhake
8ab825c49f tee: correctly handle writing to read-only files 2024-03-31 18:47:32 +02:00
Ben Wiederhake
5c36ed92b8 tee: remove unnecessary memory indirection
This removes two layers of Box<NamedWriter<...>>.
The indirection appears to be unintentional, and makes it harder to
understand and change the code.
2024-03-31 17:01:49 +02:00
Daniel Hofstetter
0ef06bd82d
Merge pull request #6131 from sylvestre/0.0.26
Try to release 0.0.26 to see if the artifacts are generated
2024-03-31 12:47:55 +02:00
Sylvestre Ledru
b869c67d6a
Merge pull request #6150 from BenWiederhake/dev-dircolors-repeated
dircolors: accept repeated flags
2024-03-31 12:08:55 +02:00
Sylvestre Ledru
01ea23ba21 Try to release 0.0.26 to see if the artifacts are generated 2024-03-30 22:51:24 +01:00
Ben Wiederhake
8e794d0654 dircolors: accept repeated flags 2024-03-30 22:50:57 +01:00
Ben Wiederhake
9dbf2c362d dirname: accept repeated flag 2024-03-30 22:50:52 +01:00
Sylvestre Ledru
c99e1c6813
Merge pull request #6025 from cre4ture/feature/dd_direct_progress
dd: handle SIGUSR1 directly. not just every 1sec
2024-03-30 22:36:03 +01:00
Michael Vogt
3a6bf34284
date: fix date -f dates.txt is failing (#6148)
* date: fix `date -f dates.txt is failing`

This commit is a trivial followup for:
https://github.com/uutils/coreutils/pull/4917
and
https://github.com/uutils/parse_datetime/pull/12

The functionality to parse the datetime was moved into the parse_datetime
crate and the only (tiny) piece left is to call it from `date`.

It also adds the test-case from the original issue. I did not include
the two tests from PR#4917 because they appear to work even without
this change. I am happy to include them of course if prefered.

Closes: #4657

Thanks to Ben Schofield

* tests: tweak changes to test_date.rs to be more idiomatic

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-03-30 15:17:10 +01:00
Daniel Hofstetter
eca8bafcc1
Merge pull request #6147 from sylvestre/tail-pid
tail: allow multiple usage of --pid to match upstream (regression of …
2024-03-30 14:07:33 +01:00
Daniel Hofstetter
28f7d56f6d
Merge pull request #6146 from sylvestre/mktemp
mktemp: adjust the error message to match 9.5
2024-03-30 08:12:15 +01:00
Sylvestre Ledru
f0286eb77d tail: allow multiple usage of --pid to match upstream (regression of 9.5)
tested by tests/tail/pid
2024-03-30 07:28:31 +01:00
Sylvestre Ledru
ee198126af mktemp: adjust the error message to match 9.5 2024-03-29 21:52:48 +01:00
Ben Wiederhake
e9045be593 tr: fix order inside class [:blank:] 2024-03-29 00:55:34 +01:00
Lucas Larson
3bf5582dbb
docs: date: Remove unimplemented example
also treated in #2685 and #3463

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
2024-03-26 13:44:23 -04:00
Sylvestre Ledru
2d7fa36aef
Merge pull request #6106 from sargas/fmt-negative-widths
fmt: allow negative widths as first argument
2024-03-25 13:43:54 +01:00
Terts Diepraam
d060134d97
uniq: print version and help on stdout again (#6123)
* uniq: print version and help on stdout again

* uniq: format test

* uniq: replace redundant closure with fn

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-25 09:40:36 +01:00
Terts Diepraam
e4a1455af5
Merge pull request #6114 from BenWiederhake/dev-csplit-repeated-args
csplit: Handle repeated args, fix remainder after error
2024-03-25 09:27:06 +01:00
Joseph Jon Booker
7b928f792c fmt: allow negative widths as first argument
Also fix error messages for consistency with GNU fmt
2024-03-24 20:59:53 -05:00
Daniel Hofstetter
6f07bf10a1
Merge pull request #6112 from BenWiederhake/dev-comm-all-args
comm: Handle duplicated flags and output-delimiter correctly
2024-03-24 16:39:05 +01:00
Daniel Hofstetter
5803d3b683
comm: remove "comm" from error msg 2024-03-24 16:09:15 +01:00
Ben Wiederhake
388021833e factor: correctly handle repeated flag 2024-03-24 00:07:08 +01:00
Ben Wiederhake
884ef1f54b comm: implement and test correct handling of repeated flags 2024-03-23 23:35:40 +01:00
Ben Wiederhake
801edbbcb4 comm: implement and test correct handling of repeated --output-delimiter 2024-03-23 23:35:40 +01:00
Ben Wiederhake
1fa0b032e5 comm: permit and test separators that contain a hyphen 2024-03-23 23:35:40 +01:00
Ben Wiederhake
27fd3e5d39 csplit: do not emit remainder of input after an error 2024-03-23 23:21:53 +01:00
Ben Wiederhake
44fa2e960a csplit: correctly handle repeated arguments 2024-03-23 23:21:53 +01:00
Sylvestre Ledru
dcb53b6c99 head: add missing features 2024-03-23 22:41:31 +01:00
Sylvestre Ledru
2246a0fad1 0.0.24 => 0.0.25 2024-03-23 22:08:05 +01:00
Sylvestre Ledru
ff1ecf6242
Merge pull request #6108 from BenWiederhake/dev-truncate-reference-create
truncate: correctly handle file (non-)creation
2024-03-23 18:46:16 +01:00
Ben Wiederhake
a1ad751aa9 truncate: deduplicate fifo check, fix handling of missing files
The fifo check used to include 'metadata(filename)?', which would error
if the file does not exist. In our case however, this is not an error.
2024-03-23 17:50:39 +01:00
Ulrich Hornung
174e9a0af9
add documentation 2024-03-23 16:51:12 +01:00
Ben Wiederhake
a3ab064f35 truncate: don't error in --no-create with reference case 2024-03-23 13:57:16 +01:00
Ulrich Hornung
a35dafcd30 consider "fullblock" cmd line arg also for block writes 2024-03-23 12:22:58 +01:00
Ulrich Hornung
a626899416 reduce cognitive complexity by splitting away part of dd_copy 2024-03-23 12:22:58 +01:00
Ulrich Hornung
43b2b3fbaa handle SIGUSR1 directly. not just every 1sec 2024-03-23 12:22:58 +01:00
Sylvestre Ledru
6d89f96d86 shred: only run zero when the file isn't empty 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
bb5111cc71 shred: fails in case of permissions issue 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
844f077401 shred: as we already got the metadata info, use it directly 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
f410d0967f shred: if the file is empty, don't run passes on it 2024-03-23 12:22:32 +01:00
Sylvestre Ledru
322c2b4df6 shred: simplify the code
The formatting directive {:2.0} will handle both cases (single-digit and double-digit numbers)
by ensuring at least two characters wide with no decimal places
2024-03-23 12:22:32 +01:00
Sylvestre Ledru
88ff42e840
Merge pull request #6102 from Krysztal112233/main
lint: fix lints of new Rust version
2024-03-23 12:21:03 +01:00
Sylvestre Ledru
06e80c7af1
Merge pull request #6105 from cre4ture/fix/findings_for_env_string_args
Fix/findings for env string args
2024-03-23 10:17:14 +01:00
Krysztal112233
d21dc125d0
lint: fix clippy::suspicious_open_options of project. 2024-03-23 16:49:35 +08:00
Ulrich Hornung
30d61d8a97
extract more functions for run_env() 2024-03-22 23:06:35 +01:00
Ulrich Hornung
59df0b8fb8
replace comment with extracted function 2024-03-22 22:36:57 +01:00
Ulrich Hornung
4c1e68c9f4
replace comment with extracted function 2024-03-22 22:34:05 +01:00
Ulrich Hornung
526cc8846c
extract functions blocks to reduce cognitive complexity 2024-03-22 22:17:48 +01:00
Daniel Hofstetter
5e6fa49ef5 more: fix incorrect tests 2024-03-22 15:13:53 +01:00
Krysztal112233
35c39a65e5
Merge branch 'uutils:main' into main 2024-03-22 16:48:47 +08:00
Krysztal112233
48e376e1e0
lint: allow clippy::suspicious_open_options in sort.rs 2024-03-22 00:42:33 +08:00
Krysztal112233
2b5e7caf8b
lint: fix clippy::manual_str_repeat in parse_glob.rs 2024-03-22 00:02:04 +08:00
Krysztal112233
eb3fac3567
lint: fix clippy::needless_borrows_for_generic_args in perms.rs 2024-03-21 23:54:37 +08:00
Krysztal112233
b66d6dffcf
lint: fix clippy::needless_borrows_for_generic_args in perms.rs 2024-03-21 23:53:32 +08:00
Krysztal112233
72b7266f71
lint: allow clippy::needless_borrow in perms.rs 2024-03-21 23:50:23 +08:00
Krysztal112233
0bb179311d
lint: fix clippy::bool_assert_comparison in perms.rs 2024-03-21 23:47:57 +08:00
Krysztal112233
63d92cdbda
lint: fix clippy::useless_vec in unit_tests.rs 2024-03-21 23:46:24 +08:00
Krysztal112233
21d6eab847
lint: fix lint clippy::suspicious_open_options 2024-03-21 23:36:48 +08:00
hanbings
c35c96f127
Merge branch 'main' into main 2024-03-21 22:57:20 +08:00
hanbings
30452ced73
Add 0xDE flag to to support zfs file system. 2024-03-21 22:20:31 +08:00
Daniel Hofstetter
77a67559eb
Merge pull request #5966 from Ideflop/more-implement-argument-pattern
More implement argument pattern
2024-03-21 10:51:31 +01:00
Sylvestre Ledru
597a29be46
Merge pull request #6095 from cakebaker/cksum_enable_encoding_feature
cksum: enable encoding feature
2024-03-20 11:10:59 +01:00
Daniel Hofstetter
3ad226cf54 fmt: show error if goal > default width 2024-03-20 10:26:11 +01:00
Daniel Hofstetter
45bdca9f16 fmt: replace two magic numbers with consts 2024-03-20 10:23:33 +01:00
sreehari prasad
660014e532
dd: misc gnu test (#6084)
* dd: check file is a dir for iflag directory

* Improve english

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

* dd: stderr output checking for "iflag directory" testcase

* dd: replace #[cfg(unix)] with #[test]

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-20 06:55:54 +01:00
Sylvestre Ledru
08172c28c0
Merge pull request #5801 from cre4ture/feature/env_string_args_try_with_shell_words
env: support string args by "-S", "-vS" or "--split-strings"
2024-03-19 19:32:04 +01:00
Daniel Hofstetter
7c8dfca4a7
Merge pull request #6094 from sargas/fmt-small-widths
fmt: Make sure goal is always positive
2024-03-19 16:55:10 +01:00
Joseph Jon Booker
f456b9531f fmt: Make sure goal is always positive
A debug assertion was added to enforce "width >= goal" to catch
that case before a panic in linebreak.rs. A few warnings in linebreak.rs
were addressed as well, and some isize's that should always be positive
(if there's no width/goal bugs) were changed to usizes to catch bugs
earlier.

test_fmt_width is updated to test for the same result as GNU fmt
2024-03-19 08:52:04 -05:00
Daniel Hofstetter
2b4cfcc8b8 cksum: enable encoding feature 2024-03-19 09:29:41 +01:00
Ulrich Hornung
c62ba559d0 env: support string args by "-S", "-vS" or "--split-strings" 2024-03-19 00:45:05 +01:00
Ben Wiederhake
133cdde885 cksum: implement and test --base64 output method 2024-03-18 20:59:59 +01:00
Ben Wiederhake
7b219aee63 cksum: implement trivial --tag flag 2024-03-18 20:59:59 +01:00
Ben Wiederhake
edb1eb0a76 cksum: allow repeated flags and arguments 2024-03-18 20:59:59 +01:00
Ulrich Hornung
32b5591736
df: switch from u64 to u128 to handle fs with large inodes nr (#6071) 2024-03-18 17:03:23 +01:00
Daniel Hofstetter
05731d13af
tr: remove fixed todo 2024-03-18 13:56:49 +01:00
Krysztal112233
4712015e61 tr: lazily generate the character mapping as necessary 2024-03-18 18:33:07 +08:00
Daniel Hofstetter
e569b0bbe1 csplit: remove "crate_name" attribute 2024-03-18 09:43:30 +01:00
Daniel Hofstetter
2f4969c0e9
Merge pull request #6090 from sylvestre/csplit2
csplit: adjust the error message to match GNU's
2024-03-18 09:33:54 +01:00
Sylvestre Ledru
696615099c
Merge pull request #6088 from cre4ture/fix/gnu_test_dd_not_rewound_sh
`dd` fix gnu test `not-rewound.sh`
2024-03-17 23:03:22 +01:00
Ulrich Hornung
40577177b2
re-use existing fd for stdout even if its a seek-able file
this is important as the fd holds the file offset we need to use
2024-03-17 20:46:49 +01:00
Sylvestre Ledru
b49fbd9a21 csplit: run the file check before the arguments verifications 2024-03-17 19:09:34 +01:00
Sylvestre Ledru
8551c55ab3 csplit: adjust the error message to match GNU's
Should fix tests/csplit/csplit
2024-03-16 22:21:44 +01:00
Daniel Hofstetter
e450ce8af2
Merge pull request #6072 from zhitkoff/cut-delim
cut: refactor delimiters OsString handling
2024-03-15 16:33:42 +01:00
Daniel Hofstetter
6d8b21da80 Fix two "item x is imported redundantly" warnings 2024-03-15 14:53:00 +01:00
Sylvestre Ledru
62a3fb8d3f
Merge pull request #5909 from cakebaker/split_fix_error_message_if_file_doesnt_exist
split: fix error message shown if file doesn't exist
2024-03-13 17:41:56 +01:00
zhitkoff
4f9497f266 cut: refactor delimiters osstring 2024-03-12 18:02:43 -04:00
Ulrich Hornung
38b15c9736
wait for child to stop after sending signal 2024-03-12 19:04:46 +01:00
Ulrich Hornung
abfd000367
avoid sending twice same signal to child process 2024-03-12 19:04:15 +01:00
Sylvestre Ledru
1725479c06
hashsum: also escape/unescape files with checks (#5868)
* hashsum: make tag conflicts with --text and --check

* hashsum: change the case in one of the gnu test

* build-gnu.sh: use symlink instead of copy

Plus: it won't cp new md5

* hashsum: also escape/unescape files with checks

Should fix tests/cksum/md5sum-bsd.sh

* improve the variable name

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

* Improve test

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

* Improve test

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

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-12 14:56:27 +01:00
Daniel Hofstetter
c619dbc99c split: fix error msg shown if file doesn't exist 2024-03-12 14:28:25 +01:00
Daniel Hofstetter
14ac1e160f cat: adapt to type change of unistd::write()
nix 0.28 changed "write(fd: RawFd, buf: &[u8]) -> Result<usize>" to "write<Fd: AsFd>(fd: Fd, buf: &[u8]) -> Result<usize>"
2024-03-12 08:31:15 +01:00
Daniel Hofstetter
6fd37da3e2 stty: remove ofill output flag
flag was removed from nix::sys::termios::OutputFlags in nix 0.28
2024-03-12 08:31:15 +01:00
Daniel Hofstetter
1413054c53 tty: unistd::ttyname takes AsFd instead of RawFd
change introduced by nix 0.28
2024-03-12 08:31:15 +01:00
Daniel Hofstetter
15cb0242ea uucore/pipes: adapt to new return type of nix fn
nix 0.28 changed the return type of unistd::pipe() from Result<(RawFd, RawFd), Error> to Result<(OwnedFd, OwnedFd), Error>
2024-03-12 08:31:15 +01:00
Sylvestre Ledru
ffb70592ec
Merge pull request #5851 from cre4ture/fix/install_invalid_link_at_destination
Fix install: invalid link at destination
2024-03-12 08:02:18 +01:00
Ulrich Hornung
7cd754eb1f
Fix install: invalid link at destination
also remove some FixMEs for FreeBsd
2024-03-11 23:31:26 +01:00
Sylvestre Ledru
93b1abff39
Merge pull request #6036 from cj-zoltan-kiss/zoltankiss/globfix
parser: if closing square bracket not found, stop looking for it again
2024-03-11 19:51:18 +01:00
Zoltan Kiss
be24742282 parser: if closing square bracket not found, stop looking for it again
This solves #5584, where the fuzzing would take hours without this.
2024-03-11 17:24:01 +01:00
Sylvestre Ledru
df585edff9 cp: Split the copy_file function a bit 2024-03-11 14:55:22 +01:00
Sylvestre Ledru
89b326fe1e
cp: improve the support of --attributes-only (#6051)
* cp: improve the support of --attributes-only

* remove useless comments

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

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-11 08:35:27 +01:00
Sylvestre Ledru
80702d5391
Merge pull request #6014 from BenWiederhake/dev-shuf-range-off-by-one
shuf: Fix off-by-one errors in range handling
2024-03-10 22:44:12 +01:00
Sylvestre Ledru
fe0c814bd5
Merge pull request #6012 from BenWiederhake/dev-tr-stream
tr: Stream output instead of buffering
2024-03-10 22:38:13 +01:00
Sylvestre Ledru
2e8f0e501c
Merge pull request #6039 from BenWiederhake/dev-chcon-repeat-args
chcon: Handle repeated flags and overrides between --no-XXX and --XXX
2024-03-10 22:36:57 +01:00
Yury Zhytkou
156d3f7ee7
cut: allow non utf8 characters for delimiters (#6037) 2024-03-10 22:36:17 +01:00
Ideflop
986c70c098 more: add test for search_pattern_in_file function 2024-03-10 22:14:26 +01:00
Ideflop
fbd3fa3f21 more: implementing pattern option 2024-03-10 22:14:26 +01:00
Terts Diepraam
a578fe9e55
Merge pull request #6050 from matrixhead/main
dd : treat arg as bytes if it contains a 'B'
2024-03-10 12:52:29 +01:00
Yash Thakur
d11d595fda
touch: Respect -h when getting metadata (#5951)
* Add tests that stat symlinks

* Check follow first in stat

* Don't run tests on FreeBSD

It would be possible to get them to run on FreeBSD by avoiding
get_symlink_times, but the behavior we're testing is not
platform-specific, so it's fine to not test it on FreeBSD.

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-03-10 08:05:59 +01:00
Sylvestre Ledru
8c7940260b
Merge pull request #6047 from cakebaker/bump_chrono
Bump chrono to 0.4.35 & replace usage of deprecated functions
2024-03-10 07:51:50 +01:00
Ben Wiederhake
8be5f7a89d chcon: allow repeated flags and arguments 2024-03-09 22:52:55 +01:00