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

8036 commits

Author SHA1 Message Date
Ben Wiederhake
af7a939b62 shred: remove unwanted padding in verbose messages
This is tested for in the GNU shred-passes test, so we don't have a
choice if we want to stay compatible.
2025-04-20 18:28:23 +02:00
Daniel Hofstetter
f92ee6a519
Merge pull request #7792 from karlmcdowall/tail_fix_v_option
tail: fix issue with -v flag and stdin
2025-04-20 17:00:37 +02:00
Karl McDowall
e35ef16030 tail: fix issue with -v flag and stdin
Fixes issue #7613
Tail now correctly handles the -v flag when only 1 input file is given.
2025-04-19 09:49:06 -06:00
Daniel Hofstetter
1d89ea5b6d
Merge pull request #7781 from dan-hipschman/env-ignore-flags-after-command
env: ignore flags after the command or -- argument
2025-04-19 14:50:21 +02:00
Daniel Hofstetter
ed3dad81f7
Merge pull request #7786 from siddharthteli12/main
whoami: remove unused libc dependency
2025-04-19 13:29:14 +02:00
Sylvestre Ledru
e7f33f533b
Merge pull request #7776 from karlmcdowall/od_7666
od: fix for issue #7666
2025-04-19 12:03:00 +02:00
Sylvestre Ledru
c76467896a
Merge pull request #7770 from karlmcdowall/yes_splice
yes: Remove usage of vmsplice
2025-04-19 11:41:17 +02:00
jfinkels
3965bc5b9e
Merge pull request #7775 from jfinkels/cp-make-fifo-uucore
cp: factor make_fifo() function out to uucore::fs
2025-04-19 11:40:29 +02:00
siddharthteli12
5a02e74e8b whoami: remove unused libc dependency 2025-04-19 13:52:41 +05:30
Karl McDowall
b692fad45d od: Ensure stdin is left in the correct state
Fixes issue #7666
For `od` utility, if client specifies `-N` maximum bytes to be read
then ensure stdin is left pointing to the next byte when `od` exits.
To do this...
 - Bypass standard buffering on stdin.
 - Instantiate BufReader further up the stack to maintain performance.
2025-04-18 21:14:29 -06:00
Dan Hipschman
814e82ea4e env: ignore flags after the command or -- argument 2025-04-18 18:48:37 -07:00
Sylvestre Ledru
0f061dee68
Merge pull request #7779 from cakebaker/ci_lint_selinux
ci: lint with selinux
2025-04-18 14:36:27 +02:00
Lukas
d59ac4912c
csplit: removed unnecesary implementation of From<io::Error> (#7778) 2025-04-18 14:28:13 +02:00
Daniel Hofstetter
0309ccd28b selinux: fix empty_line_after_doc_comments 2025-04-18 13:47:31 +02:00
Daniel Hofstetter
6cccd340f7
Merge pull request #7774 from jfinkels/mv-refactor-into-helpers
mv: factor rename_with_fallback function into helpers
2025-04-18 09:45:03 +02:00
Daniel Hofstetter
6ea58ea0aa
Merge pull request #7768 from sylvestre/ls-selinux
ls: add selinux support
2025-04-18 09:07:10 +02:00
Jeffrey Finkelstein
3b2db58a78 mv: factor rename_with_fallback func into helpers
Factor out helper functions from the `rename_with_fallback()` function
so that there is one fallback helper per file type (symlink, directory,
or file). This doesn't change the functionality of `mv`, it is just a
re-organization of the code.
2025-04-17 20:36:56 -04:00
Terts Diepraam
d99b7b31a6
Merge pull request #7740 from Ecordonnier/eco/enable-utmpx-for-musl
enable utmpx feature for musl
2025-04-17 22:46:23 +02:00
Aaron Ang
da351d242f
more: keep only screen lines in mem (#7680)
* more: keep only screen lines in memory

* more tests: allow clippy warning for builder method
2025-04-17 22:44:41 +02:00
Sergei Patiakin
4190fe22ef
fix: df: filter filesystem types after mount point resolution (#7452)
Closes: #6194
2025-04-17 22:06:20 +02:00
Sylvestre Ledru
4651a58b82 ls: add selinux support 2025-04-17 18:27:54 +02:00
Leo Emar-Kar
538355fb67
ls: add -T support and fix --classify output (#7616)
* add -T option parsing

* add usage of tab_size in display_grid

* fix test_ls_columns with \t

since this behavior is on by default

* update test_tabsize_formatting

* use grid DEFAULT_SEPARATOR_SIZE

* update Tabs

* fix test with column width

* fix cspell

* fix linter warning on match bool

* add comment for 0 tab_size

* update tabsize test with -C

* update one of the tabs tests to use -x

* remove comment and split tests for both x/C args
2025-04-17 14:29:22 +02:00
Daniel Hofstetter
42782d6053 selinux: rename check_selinux_enabled()
to is_selinux_enabled() and change return type to bool
2025-04-17 10:18:31 +02:00
Karl McDowall
d1f84cdc41 Remove usage of vmsplice from yes
Addresses issue #7625
Remove the usage of vmsplice from `yes` utility since it can cause
errors.
2025-04-16 16:40:10 -06:00
Dorian Péron
349e56897c
Merge pull request #7694 from drinkcat/printf-fix-empty
uucore: parser: num_parser: Return error if no digit has been parsed
uucore: parser: num_parser: Ignore empty exponents
uucore: parser: num_parser: Parse "0x"/"0b" as PartialMatch
2025-04-16 23:32:39 +02:00
Daniel Hofstetter
219e87d57c
Merge pull request #7752 from sylvestre/stat-C
stat: add support for selinux
2025-04-16 11:06:36 +02:00
Sylvestre Ledru
c7d39dded6 stat: add support for selinux 2025-04-16 10:21:37 +02:00
Sylvestre Ledru
8220f061ef selinux: add function get_selinux_security_context to uucore
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-04-16 10:21:31 +02:00
Nicolas Boichat
a4c56fbcee uucore: parser: num_parser: Parse "0x"/"0b" as PartialMatch
printf treats "0x" as a partial match of 0 and "x".
2025-04-15 20:59:23 +02:00
Nicolas Boichat
8363274f75 uucore: parser: num_parser: Ignore empty exponents
Numbers like 123.15e or 123.15e- should return PartialMatch.

Numbers like `e`, `.e` are not valid.

Fixes #7685.
2025-04-15 20:59:23 +02:00
Nicolas Boichat
e5eb004793 uucore: parser: num_parser: Return error if no digit has been parsed
This is mostly important when parsing digits like `.` and `0x.`
where we should return an error.

Fixes #7684.
2025-04-15 20:59:23 +02:00
Yuri Astrakhan
8a5a2eed2a
Merge pull request #7702 from nyurik/iters
feat: optimize iter matching
2025-04-15 19:54:58 +02:00
Etienne Cordonnier
bc8acbb6db add musl utmpx limitation to --help texts
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-04-15 15:16:16 +02:00
Etienne Cordonnier
f0440ae85f enable utmpx feature for musl
bump libc to 0.2.172

musl provides stubs of utmpx functions, and those stubs are available in the
libc crate version 0.2.172. Thus let's enable the feature so that it can
compile with musl.  Note that those stubs always return a success exit value,
and commands such as "users" will report an empty list of users, when calling
those stubs.

This is consistent with the behavior of GNU coreutils which does the same thing.

The coreutils utillities using utmpx are "pinky", "uptime", "users", "who".
This is the expected behavior when using those utilities compiled with those musl utmpx stubs:
```
root@qemuarm64:~# users
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# pinky
Login    Name                 TTY      Idle   When         Where
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# uptime
 12:58:47 up 0 min,  0 users,  load average: 0.07, 0.02, 0.00
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# who
root@qemuarm64:~# echo $?
0
```

Closes #1361

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-04-15 12:51:55 +02:00
Sylvestre Ledru
148b3415ec
Merge pull request #7697 from nyurik/names
chore: address a few clippy lints that break API
2025-04-15 09:56:10 +02:00
Daniel Hofstetter
2a816e35f4 sleep: remove unused fundu from Cargo.toml 2025-04-15 07:25:21 +02:00
Dorian Péron
3dcee17572
Merge pull request #7675 from Qelxiros/7669-sleep-hex-parsing
fix(sleep): use uucore's from_str to support parsing hex
2025-04-15 00:50:15 +02:00
Yuri Astrakhan
61fafe9bda chore: address a few clippy lints that break API
* Disabled `avoid-breaking-exported-api` and sorted items in Clippy.toml
* Renamed `BSD` -> `Bsd`, `SYSV` -> `SysV`, and `CRC` -> `Crc` to match Rust naming rules
* Renamed items in `BackupMode` and `UpdateMode` because they repeated the same word in every item - making it redundant and harder to read
2025-04-14 18:49:33 -04:00
Sylvestre Ledru
a067b58707
Merge pull request #7716 from nyurik/clippy-all
fix low-count lints in all crates
2025-04-14 22:08:01 +02:00
Yuri Astrakhan
c1d2a07c62
Merge pull request #7704 from nyurik/optimize-dd
feat: optimize `dd` parsing, bugfix
2025-04-14 21:58:11 +02:00
Yuri Astrakhan
6e22b69e9c fix a low-count lints in all crates
Running this command showed a list of all lints across all crates:

```shell
cargo clippy --all-targets --workspace --message-format=json --quiet | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' | sort | uniq -c | sort -h -r
```

This resulted in a list that I added to the `[workspace.lints.clippy]` in the root Cargo.toml. Afterwards, I commented out a few simpler lints. Subsequentely, I will go through this list, trying to address items in smaller batches.
2025-04-14 13:41:48 -04:00
Jeremy Smart
6eb3e3cd94
parse_time: support hex durations, update sleep/timeout accordingly 2025-04-14 07:34:01 -04:00
Dan Hipschman
d37f500bd3 cp: cp -P hardlink-to-symlink hardlink-to-same-symlink should noop 2025-04-14 13:06:53 +02:00
Dorian Péron
c35d26dc51
Merge pull request #7693 from sargas/escape_empty_string
uucore/quoting_style: Add support for quoting/escaping empty strings
2025-04-13 23:05:28 +02:00
Sylvestre Ledru
efb09204a2
Merge pull request #7748 from cakebaker/clippy_move_lints_from_ci_to_cargo_toml
Move clippy lints from CI to `Cargo.toml`
2025-04-13 18:51:53 +02:00
Daniel Hofstetter
26e0585775 df: fix warnings from default_trait_access lint 2025-04-13 17:44:29 +02:00
Daniel Hofstetter
64140b8ec9 head: allow cognitive_complexity in test 2025-04-13 17:35:05 +02:00
Sylvestre Ledru
4c796caba5
Merge pull request #7721 from Qelxiros/7166-head-maxint
head: fix overflow errors
2025-04-13 16:37:13 +02:00
Daniel Hofstetter
80b6a2155c
Merge pull request #7635 from sylvestre/temp-selinux-impl
mkdir: add the selinux support
2025-04-13 14:49:52 +02:00
Sylvestre Ledru
291473e3a4
Merge pull request #7744 from BenWiederhake/dev-clippy-0-1-87-nightly
Apply suggestions from clippy 0.1.87+nightly
2025-04-13 12:11:50 +02:00