Commit graph

5487 commits

Author SHA1 Message Date
papparapa
4e7ae2d46a
du: move help strings to markdown file (#4384) 2023-02-21 16:51:59 +01:00
Yang Hau
9322580967 Add checksum algorithm abstractions 2023-02-21 21:14:58 +08:00
Cheng-Hao
7cfeba0d22 mkdir: move help strings to markdown file 2023-02-20 16:29:20 -08:00
David Matos
dd4299c32e chmod: supress verbose output when not verbose 2023-02-20 22:18:07 +01:00
David Matos
fe4da2b8e5 cp: modify archive flag to copy dir contents rather than dir 2023-02-20 16:49:33 +01:00
Terts Diepraam
cc0a77d357
Merge pull request #4395 from papparapa/kill-move-help-strings-to-md-file
kill: move help strings to markdown file
2023-02-20 14:16:42 +01:00
Koki Ueha
9bf9bba7c3 kill: move help strings to markdown file 2023-02-20 11:56:39 +00:00
Koki Ueha
e0470c0294 tac: move help strings to markdown file 2023-02-20 11:30:33 +00:00
Kyle Manna
05db5f7442 install: address merge request feedback
* Explicitly handle Err() in match.
* Move metdata functions deeper into `chown_optional_user_group()`.
* Add `ChownFailed` to propagate errors.
* Use `show_if_err!()` to wrap `chown_optional_user_group`.
* Simplify chown verbose message handling.
2023-02-19 11:47:45 -06:00
Koki Ueha
044f3d3a43 yes: move help strings to markdown file 2023-02-19 14:54:33 +00:00
Sylvestre Ledru
f77a44df8b
Merge pull request #4385 from cakebaker/uucore_procs_help_about
uucore_procs: extract "about" and "usage" info from new help structure
2023-02-19 11:47:18 +01:00
Yang Hau
109553436d add function profile 2023-02-19 18:09:34 +08:00
Kyle Manna
376f4d90ef install: add tests for invalid owner and group
* Move the user and group resolution to the behavior decoding instead of
  re-running on every file/directory creation.  Simplifies code.
* Update error output to match GNU coreutils.
* Add tests to verify invalid owner and group.
2023-02-18 22:46:12 -06:00
Kyle Manna
5876cd2581 install: add missing directory chown
* Re-factor the copy function chown into a function that can be re-used.
* Fix bug where the group overwrote the user.
* Add chown compatibility to follow GNU coreutils.
* Reduce two chown calls to a single syscall only when needed.
* Fixes #4361
2023-02-18 22:46:12 -06:00
Kyle Manna
7aa7f219a0 install: fix issue #4360 with bad target directory permissions
* Correct bug that set the last directory to the mode the file should
  have been set to.
* Add unit test to verify correct functionality.
2023-02-18 22:32:31 -06:00
Yang Hau
2cd19522e4 fix: Fix panic in multi-byte characters
Closes #4353
2023-02-19 10:15:53 +08:00
Jeffrey Finkelstein
c52647a632 dd: add support for skipping in input FIFO
For example, `dd skip=1 if=fifo` will now work.
2023-02-18 21:24:16 +01:00
Jeffrey Finkelstein
9c3f810f97 dd: add support for seeking in output FIFOs
For example, `dd seek=1 of=fifo` will now work.
2023-02-18 21:24:16 +01:00
Jeffrey Finkelstein
cf72c990f2 dd: create Source enum and simpler Input struct
This mirrors a recent commit that introduced the `Dest` enum and a
simplified `Output` struct. These changes allow us to add new types of
inputs and output more easily.
2023-02-18 21:24:16 +01:00
Yang Hau
678a11dcf2 cksum: Implement option -a
Implement option -a --algorithm.
Move digest to src/uucore/src/lib/features and rename it to hash.

fix lint

fix Cargo.toml
2023-02-18 20:58:53 +08:00
Daniel Hofstetter
dcc7c4ed7b Use help_about! & adapt help files for its usage 2023-02-17 16:40:22 +01:00
Daniel Hofstetter
2c027a9312 uucore_procs: add help_about macro 2023-02-17 15:39:26 +01:00
Daniel Hofstetter
1ba0c6853c uucore_procs: drop need for "Usage" header in help 2023-02-17 14:51:40 +01:00
Daniel Hofstetter
94eddc4701 uucore_procs: separate file opening & parsing 2023-02-17 11:37:25 +01:00
Terts Diepraam
9fdce975fd
Merge pull request #4359 from dmatos2012/chmod-multiple-files-error
chmod: change permissions for files present even when there is a missing file
2023-02-17 11:27:32 +01:00
David Matos
946c8d2d4a chmod: change permissions for files present even when there is a missing file 2023-02-16 23:13:06 +01:00
Joining7943
cca54089fb tail: Cargo.toml: Remove unneeded features of uucore and the nix dependency 2023-02-16 20:00:38 +01:00
Terts Diepraam
ff5000d4d0
Merge pull request #4239 from Joining7943/tail-fix-parsing-of-sleep-interval
`tail`: fix argument parsing of sleep interval
2023-02-16 15:14:53 +01:00
Sylvestre Ledru
d3fc0e8706
Merge pull request #4314 from cakebaker/comm_total_with_output_delimiter
comm: use delimiter on "total" line
2023-02-16 14:24:02 +01:00
Koki Ueha
5cc9130490 cat: move help strings to markdown file 2023-02-16 10:47:34 +00:00
papparapa
34e31f20e7
cp: move help strings to markdown file (#4372)
* cp: move help strings to markdown file

* cp: change markdown section order
2023-02-16 11:23:32 +01:00
Daniel Hofstetter
675c55ba01 stat: fix markdown formatting 2023-02-15 16:16:10 +01:00
Sylvestre Ledru
76034a8fe2
Merge pull request #4367 from cakebaker/replace_get_long_usage_fn_with_const
Replace get_long_usage fns with const
2023-02-15 08:18:36 +01:00
Terts Diepraam
df7fe29095
Merge pull request #4339 from howjmay/tr-newline
tr: Remove the extra newline in stderr
2023-02-14 22:58:40 +01:00
Guilherme A. de Souza
04b6d806a2
nproc: replace num_cpus crate with thread::available_parallelism (#4352)
* nproc: replace num_cpus crate with std:🧵:available_parallelism

* nproc: unwrap Result for Windows

* nproc: if thread::available_parallelism results in err return 1

* nproc: wrap the call to available_parallelism into a function

* nproc: remove comment in the wrong place

* nproc: fix style violation

* nproc: fix comment, refers to the new function
2023-02-14 22:43:09 +01:00
Yang Hau
ec81a23afc tr: Remove the extra newline in stderr
closes #4301
2023-02-15 02:04:43 +08:00
Daniel Hofstetter
99f3fc8356 Replace get_long_usage fns with const 2023-02-14 09:51:28 +01:00
Jeffrey Finkelstein
c6d9d7f11c Clippy fixes 2023-02-13 21:33:42 -05:00
Daniel Hofstetter
c433f8b475 uniq: remove suppression of use_self lint 2023-02-13 08:53:26 +01:00
Joining7943
0ed6a9f882 tail: Fix parsing of sleep interval. Use duration parser from fundu crate.
Activate tests for parsing sleep interval
2023-02-12 20:23:55 +01:00
Thayne McCombs
5b190dbf76 Stop saying --sparse is not implemented for cp
It is implemented, so update the --help text to reflect that
2023-02-12 01:41:36 -07:00
Terts Diepraam
bf8e9333f6 tee: use retain_mut from std instead of the deprecated retain_mut crate 2023-02-11 18:54:55 +01:00
Terts Diepraam
ae27c82020 Use workspace inheritance for dependencies 2023-02-11 18:54:46 +01:00
Terts Diepraam
d60fc40f2f Clippy fixes for MSRV 1.64 2023-02-11 13:59:50 +01:00
Yang Hau
0b1edd33fc rm: Remove remove_dir_all dependency
Closes #4335
2023-02-11 01:04:30 +08:00
Terts Diepraam
152be8527d update blake2_simd to 1.0.1
This fixes the duplicate constant-time-eq dependency.
2023-02-10 09:56:24 +01:00
Terts Diepraam
357001dabc fix double dependency of memoffset by upgrading nix, libc and ctrlc 2023-02-09 14:02:40 +01:00
Yang Hau
6299b418f5 typo 2023-02-09 00:33:54 +08:00
Daniel Hofstetter
d4cd4d310f ln: fix format of help text 2023-02-08 15:00:35 +01:00
Daniel Hofstetter
ba7a222a55 Start about texts with uppercase char 2023-02-07 14:54:25 +01:00
Daniel Hofstetter
a2796d4585 env: start about text with uppercase char 2023-02-07 10:20:04 +01:00
Daniel Hofstetter
ccf999473c comm: use delimiter on "total" line 2023-02-07 09:22:55 +01:00
Sylvestre Ledru
486defe893
Merge pull request #4313 from cakebaker/ptx_remove_unnecessary_join
ptx: fix warning from unnecessary_join lint
2023-02-05 21:23:36 +01:00
Daniel Hofstetter
ee261359bd ptx: fix warning from unnecessary_join lint 2023-01-30 10:11:40 +01:00
Sylvestre Ledru
00717a6440
Merge pull request #4308 from ctsk/chore/clippy-warnings
clippy: fix unnecessary return warnings
2023-01-30 09:25:20 +01:00
dependabot[bot]
204d96b7df
build(deps): bump regex from 1.7.0 to 1.7.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.0...1.7.1)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 06:13:54 +00:00
ctsk
ef32061f82 clippy: fix unnecessary return warnings 2023-01-29 22:09:11 +01:00
Sylvestre Ledru
efc70ade68
Merge pull request #4260 from sbentmar/expand-fix-perl-failures
expand: improve plus specifier handling
2023-01-28 18:15:08 +01:00
Sylvestre Ledru
d8c3205d4c
Merge pull request #4300 from cakebaker/comm_total
comm: implement --total
2023-01-28 18:14:17 +01:00
Sylvestre Ledru
a75cfd9655
Merge pull request #4171 from uutils/dependabot/cargo/blake3-1.3.2
build(deps): bump blake3 from 1.3.1 to 1.3.2
2023-01-28 01:16:04 +01:00
dependabot[bot]
423ff9fe8b build(deps): bump gcd from 2.1.0 to 2.2.0
Bumps [gcd](https://github.com/frewsxcv/rust-gcd) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/frewsxcv/rust-gcd/releases)
- [Commits](https://github.com/frewsxcv/rust-gcd/compare/2.1.0...2.2.0)

---
updated-dependencies:
- dependency-name: gcd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-27 21:10:27 +01:00
Sylvestre Ledru
13fac01d31
Merge branch 'main' into dependabot/cargo/blake3-1.3.2 2023-01-27 21:10:06 +01:00
Sebastian Bentmar Holgersson
999957791a expand: minor simplification of mode logic 2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
1bf723fe40 expand: fix formatting issues and cleanup 2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
69d8729598 expand: replace while loop with constant time algorithm 2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
ddc6fabca0 expand: all perl tests passing 2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
cbab8677e6 expand: improve handing of + 2023-01-27 21:08:16 +01:00
TechHara
3ad36a49cb
cut: refactor (#4255)
refactors `cut field` logic to reduce code duplication by factoring out the common `Searcer`, which is _templatized_ on a specific `Matcher` -- `ExactMatcher` for an explicit delimiter and `WhitespaceMatcher` for white-space delimiter.

before
- code duplication in `Searcher` and `WhitespaceSearcher`
- code duplication in `cut_fields` and `cut_fields_whitespace`

after
- two versions of `Matcher`s
- one `Searcher`
- simplify `cut_fields` by delegating actual work to specific functions
2023-01-27 21:07:36 +01:00
Daniel Hofstetter
f6b646e4e5 clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00
Daniel Hofstetter
b06485990d comm: implement --total 2023-01-24 16:49:43 +01:00
Sylvestre Ledru
dce8a021da
Merge pull request #4299 from Joining7943/fix-4298-build-fails-on-s390x-and-risc64
`uucore`: Fix #4298: Fails to build on s390x (and riscv64)
2023-01-24 11:47:20 +01:00
Joining7943
9796e70a28 uucore: Fix #4298: Build on s390x and riscv64 architectures fails 2023-01-23 21:13:59 +01:00
Sylvestre Ledru
2df4aaccd9
Merge pull request #4263 from cakebaker/od_cleanup_format_strings
od: remove "width = width" from format strings
2023-01-22 21:32:59 +01:00
Sylvestre Ledru
6f95f0953b
Merge pull request #4271 from eds-collabora/eds/nice
Support legacy argument syntax for nice
2023-01-22 20:57:08 +01:00
Sylvestre Ledru
f30124e497 uname: use the same version of platform-info as arch 2023-01-21 23:24:53 +01:00
Terts Diepraam
4d3dc78686 Version 0.0.17 2023-01-21 10:38:18 +01:00
Emil Suleymanov
50c1833c11
cp: require preserve only certain attributes (#4099)
* cp: require preserve only certain attributes

# Conflicts:
#	src/uu/cp/src/copydir.rs
#	src/uu/cp/src/cp.rs

* tests/cp: preserve all and preserve xattr tests with todos

* tests/cp: rename preserve tests

* tests/cp: add android fail test for preserve=xattr

On Android, this cp with explicit preserve of xattr must fail, because of the limitations of the filesystem setup used on Android.

* cp: verify some metadata in cp preserve tests

# Conflicts:
#	tests/by-util/test_cp.rs

* cp: run test_cp_preserve_all in all OS's but only check metadata on linux

* test/cp: don't expect the mode to change in explicit cp preserve

* cp: attributes struct instead of enum for unified required tracking

* cp: refactor preserver and handle_preserve

# Conflicts:
#	src/uu/cp/src/cp.rs

* cp: update preserve attr to max

* test/cp: fix the preserve xattr test

Access timestamps appear to be modified only in this test. Running the command directly does not alter the access timestamp.

* cp/test: preserve all and context case

* cp: fix preserve args value source

* test/cp: don't check mtime on freebsd

* test/cp: don't check mtime on macos

* test/cp: fix freebsd deps

* test/cp: support freebsd tests

* cp: simplify try_set_from_string

* cp: parse context attr in preserve in any case to show warning later

* cp: print warnings for attribute errors if not required

* cp: show SELinux warning only once

* cp: show SELinux warning without error

* Revert "cp: show SELinux warning without error"

This reverts commit d130cf0d8c8e28ac2c903413992613241decf879.

* cp: add documentation for preserve components

* cp: simplify try_set_from_string

* cp: EN_US "behavior" spelling for cspell
2023-01-19 13:02:06 +01:00
Ed Smith
34e10f9aa8 nice: Remove use of show_warning
This is required to pass the GNU nice test suite. Failure to produce
the advisory message when unable to change the process priority must
be fatal, and without this commit our version of nice will exit, but
before the commit the exit code will be 101 (due to eprintln!
panicking), and it must be 125 to pass the test suite.

Signed-off-by: Ed Smith <ed.smith@collabora.com>
2023-01-18 11:44:41 +01:00
Ed Smith
07e7372311 nice: Permit --adjustment to be specified multiple times
This is tested by the GNU coreutils test suite, and the
correct behaviour is the last specification wins.

Signed-off-by: Ed Smith <ed.smith@collabora.com>
2023-01-18 11:44:41 +01:00
Ed Smith
8aa9f346ef Support legacy argument syntax for nice
This introduces an argument preprocessing step for the nice tool in
order to support the legacy nice adjustment syntax (`nice -1 foo`,
`nice --1 foo`, `nice -+1 foo` and so forth).

This is a preprocessing step because the interaction between these
arguments and the existing `nice -n -1` syntax becomes context
dependent, in a way that is currently difficult to capture through
clap.

Signed-off-by: Ed Smith <ed.smith@collabora.com>
2023-01-18 11:44:41 +01:00
Sylvestre Ledru
8c137f5d7c
Merge pull request #4278 from cakebaker/sum
sum: fix output when using BSD sum algo (-r)
2023-01-18 11:33:41 +01:00
Sylvestre Ledru
afbe850115
Merge pull request #4279 from rivy/up.uname
change/uname ~ update and revise
2023-01-18 11:33:29 +01:00
Sylvestre Ledru
f12202e39c
Merge pull request #4281 from cakebaker/default_trait_access
clippy: use type name instead of Default::default
2023-01-18 11:33:09 +01:00
Daniel Hofstetter
3489647407 cp: remove empty line from version output 2023-01-18 10:20:17 +01:00
Daniel Hofstetter
e09d718ca7 join: remove NAME constant 2023-01-17 16:10:32 +01:00
Daniel Hofstetter
f50c352adc clippy: use type name instead of Default::default 2023-01-16 10:52:28 +01:00
Roy Ivy III
03e55d2ecb docs ~ update spell-checker exceptions 2023-01-14 22:53:26 -06:00
Roy Ivy III
ead457171b refactor/uname ~ rename vars to standards 2023-01-14 22:53:26 -06:00
Roy Ivy III
759f32fe4f fix/uname ~ correct --all help description 2023-01-14 22:53:25 -06:00
Roy Ivy III
b5eaa8822f fix/uname ~ strip any trailing NUL(s) from nodename() (from bug in platform-info) 2023-01-14 22:53:25 -06:00
Roy Ivy III
27d20129fe fix/dd ~ correct usage error display text 2023-01-13 22:14:48 -06:00
Roy Ivy III
3d93e25160 fix/touch ~ correct usage error display text 2023-01-13 22:14:48 -06:00
Roy Ivy III
10f35fc282 refactor/uname ~ use platform_info-v1.0.2 2023-01-13 22:13:26 -06:00
Daniel Hofstetter
747bc2513e sum: fix output when using BSD sum algo (-r) 2023-01-13 10:05:09 +01:00
Sylvestre Ledru
6a9660f9f6
Merge pull request #4268 from rivy/fix.sleep
Fix `sleep` argument parsing and errors
2023-01-12 18:41:04 +01:00
Sylvestre Ledru
22821c8ac6
Merge pull request #4272 from cakebaker/mv_remove_unnecessary_not
mv: remove unnecessary "!"
2023-01-12 18:32:31 +01:00
Daniel Hofstetter
74ed737460 remove NAME constants 2023-01-12 15:21:11 +01:00
Sylvestre Ledru
74c9abb359
Merge pull request #4274 from cakebaker/sum_fix_output_of_about_string
sum, unexpand: fix output of about string
2023-01-11 16:33:39 +01:00
Daniel Hofstetter
5ad3cbe965 unexpand: fix output of about string 2023-01-11 15:55:37 +01:00
Daniel Hofstetter
0f79b3cf2d sum: fix output of about string 2023-01-11 14:44:59 +01:00