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

7624 commits

Author SHA1 Message Date
Daniel Hofstetter
7edd045206 date: use UTC if TZ is empty 2025-01-16 11:44:45 +01:00
Daniel Hofstetter
ada18863a7 date: adapt to API change in chrono-tz 2025-01-16 11:44:45 +01:00
Alexander Shirokov
b3c0633b95
seq:add bounds for exponents
Add bounds for exponents to avoid overflow issues for inputs like 'seq
1e-9223372036854775808'
2025-01-15 22:35:24 +01:00
Daniel Hofstetter
1b5e321fc2 dircolors: move use declaration to top 2025-01-15 14:19:05 +01:00
Alexander
05ada0d204
seq:add floating point support (#6959)
* seq:enable parsing of hexadecimal floats

Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue #6935

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-01-15 11:53:18 +01:00
Daniel Hofstetter
c322fb5c73
Merge pull request #7134 from jfinkels/date-timezone-name
date: display %Z alphabetic time zone abbreviation
2025-01-15 11:07:46 +01:00
Krishna Nagam
d82d038b54 date: display %Z alphabetic time zone abbreviation
Improve the display of dates formatted with the `%Z` specifier so that
the timezone abbreviation is displayed, not just its numeric offset.

Fixes #3756

Co-authored-by: Jeffrey Finkelstein <jeffrey.finkelstein@protonmail.com>
2025-01-14 17:49:11 -05:00
Jeffrey Finkelstein
dac35129d2 date: add dependencies for managing time zones
Add dependencies on third-party packages `chrono-tz` and
`iana-time-zone` to our `date` package. Together, these two packages
allow us to produce time zone abbreviations (like `UTC`) from numeric
timezone offsets.
2025-01-14 17:49:11 -05:00
Sylvestre Ledru
106873171d dircolors: ignore spell issues 2025-01-14 23:25:32 +01:00
Sylvestre Ledru
591cdc1d31 dircolors: split the code to remove the clippy warning 2025-01-14 23:25:32 +01:00
Sylvestre Ledru
1db2e2356a dircolors: fix empty COLORTERM matching with ?* pattern
should fix tests/misc/dircolors
2025-01-14 23:25:32 +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
da40b3564e
Merge pull request #7116 from jfinkels/df-error-on-overmounted
df: error on over-mounted device
2025-01-12 21:28:47 +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
ctsk
02e49a40c0 df: error on over-mounted device
Make `df` error when two devices are mounted at the same directory and
the earlier one is given as a positional argument to `df`. This is
called "over-mounting". After this commit, an error message is printed
like this:

    df: cannot access '/dev/loop1': over-mounted by another device

Fixes #3970

Co-authored-by: Jeffrey Finkelstein <jeffrey.finkelstein@protonmail.com>
2025-01-11 12:41:25 -05:00
Jeffrey Finkelstein
62879244cb tsort: use Option::inspect over map 2025-01-11 11:58:51 -05:00
jfinkels
700a5f007a
tsort: use iterators to remove from vec
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-01-11 11:47:23 -05:00
Sylvestre Ledru
b9765a746b
Merge pull request #7121 from sylvestre/prep-release
Prepare release 0.0.29
2025-01-11 17:43:58 +01:00
Jeffrey Finkelstein
f59c7899c3 Add more test cases and improve precision 2025-01-11 11:27:18 -05:00
Sylvestre Ledru
f042a9a222 chmod: remove the option from configure_symlink_and_recursion 2025-01-11 16:46:37 +01:00
Sylvestre Ledru
aef4234fb5 New release 2025-01-11 14:01:27 +01:00
Sylvestre Ledru
bb3741067a chmod/chown/chgrp: deduplicate get metadata 2025-01-11 12:48:30 +01:00
Sylvestre Ledru
1a0f41e4cc chmod/chown/chgrp: deduplicate some arg management 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
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
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
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
Jeffrey Finkelstein
1bb33e0446 tsort: derive Default trait for Node struct
Replace custom `Node::new` function with derived `Default`
implementation, which does the same thing but more concisely.
2025-01-07 19:41:16 -05: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
Daringcuteseal
77fadc6897
cp: implement copying content from streams
Previously, the only stream that cp supports copying are FIFOs. Any other files will be handled using
std::io::copy which does not handle special files like block devices or character specials. This
commit fixes the previously missing support by using std::io::copy or splice syscall for Linux to
handle those cases.
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