Commit graph

8063 commits

Author SHA1 Message Date
Niyaz Nigmatullin
147f83f68a tests/cp: add test for cp-parents.sh 2022-07-17 23:04:09 +03:00
Niyaz Nigmatullin
0ea3a735ca
readlink: symlink loop handling (#3717)
readlink: fix symlink loop handling
2022-07-14 22:32:55 +02:00
Sylvestre Ledru
882cd527ff
Merge pull request #3704 from Sciencentistguy/once_cell
Replace lazy_static with once_cell
2022-07-13 16:15:47 +02:00
Sylvestre Ledru
8938b1f9e1
Merge pull request #3716 from cakebaker/numfmt_reject_suffix
numfmt: reject suffix if unit is "none"
2022-07-13 16:14:43 +02:00
Daniel Hofstetter
9e44acf307 numfmt: reject suffix if unit is "none" 2022-07-13 10:47:59 +02:00
Sylvestre Ledru
db2e5fc6ec
Merge pull request #3714 from niyaznigmatullin/canonicalize_windows_symlink_loop_looking
canonicalize: Loop looking in windows
2022-07-13 10:36:18 +02:00
Sylvestre Ledru
4b27776237
Merge pull request #3713 from cakebaker/numfmt_missing_i_suffix
numfmt: show error if "i" suffix is missing
2022-07-13 10:35:22 +02:00
Sylvestre Ledru
073c432e5e
Merge pull request #3715 from uutils/dependabot/github_actions/vmactions/freebsd-vm-0.1.7
build(deps): bump vmactions/freebsd-vm from 0.1.6 to 0.1.7
2022-07-13 10:34:55 +02:00
dependabot[bot]
2e39f6faf2
build(deps): bump vmactions/freebsd-vm from 0.1.6 to 0.1.7
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 0.1.6 to 0.1.7.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/v0.1.6...v0.1.7)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-13 06:41:10 +00:00
Niyaz Nigmatullin
c829ecfd1d uucore/fs: get back to loop looking in windows as FileInformation
for directory is fixed
2022-07-12 17:15:16 +03:00
Jamie Quigley
1a270361c0
Replace lazy_static with once_cell 2022-07-12 14:08:30 +01:00
Daniel Hofstetter
aef24db90f numfmt: show error if "i" suffix is missing 2022-07-12 10:58:07 +02:00
Niyaz Nigmatullin
de65d4d649
Realpath relative options (#3710)
* realpath: introduce relative options, make correct exit codes, make pass
GNU test mist/realpath.sh
2022-07-12 08:29:20 +02:00
Terts Diepraam
6b00aec48e
Merge pull request #3602 from lendandgit/main
df: better error message when executed in a chroot without /proc #3601
2022-07-11 23:02:39 +02:00
Sylvestre Ledru
e239ed9417
Merge pull request #3692 from jfinkels/cp-preserve-perm-link
cp: correctly copy attributes of a dangling symbolic link
2022-07-11 22:50:24 +02:00
Sylvestre Ledru
8074020a8b
Merge pull request #3705 from cakebaker/numfmt_unit
numfmt: implement "--to-unit" & "--from-unit"
2022-07-11 22:46:56 +02:00
Niyaz Nigmatullin
da5808d4ac
ls: add already listed message (#3707)
* ls: handle looping symlinks infinite printing

* ls: better coloring and printing symlinks when dereferenced

* tests/ls: add dereferencing and symlink loop tests

* ls: reformat changed using rustfmt

* ls: follow clippy advice for cleaner code

* uucore/fs: fix FileInformation to open directory handles in Windows as
well
2022-07-11 17:18:58 +02:00
Sylvestre Ledru
8f4a3266a4
Merge pull request #3709 from uutils/dependabot/cargo/memmap2-0.5.5
build(deps): bump memmap2 from 0.5.4 to 0.5.5
2022-07-11 10:37:05 +02:00
dependabot[bot]
7be2139919
build(deps): bump memmap2 from 0.5.4 to 0.5.5
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/RazrFalcon/memmap2-rs/releases)
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.4...v0.5.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 06:40:50 +00:00
Niyaz Nigmatullin
9d285e953d
Realpath symlinks handling, solves issue #3669 (#3703) 2022-07-10 16:49:25 +02:00
Daniel Hofstetter
1f292dd834 numfmt: implement "--to-unit" & "--from-unit" 2022-07-09 08:01:27 +02:00
Sylvestre Ledru
392ae87a9f
Merge pull request #3700 from cakebaker/comm_enable_output_delimiter_test
comm: enable "output_delimiter" test
2022-07-08 18:41:51 +02:00
Sylvestre Ledru
05823dd619
Merge pull request #3656 from eds-collabora/eds/tee_p
Implement tee -p
2022-07-08 18:41:34 +02:00
Sylvestre Ledru
25f84da10d
Merge pull request #3699 from uutils/dependabot/cargo/regex-1.6.0
build(deps): bump regex from 1.5.6 to 1.6.0
2022-07-08 18:40:43 +02:00
leon
de4cfdbea6 stat: improved error message 2022-07-07 15:24:00 +02:00
leon
97998a64dd df: removed unused import 2022-07-07 15:24:00 +02:00
leon
388e14f208 df: error handling cleanup 2022-07-07 15:24:00 +02:00
leon
72b0ba0b05 df: fixed clippy warning 2022-07-07 15:24:00 +02:00
leon
9d554751ca df: better error message when executed in a chroot without /proc #3601 2022-07-07 15:24:00 +02:00
Ed Smith
607bf3ca4d Terminate on elimination of all writers in tee
tee is supposed to exit when there is nothing left to write to. For
finite inputs, it can be hard to determine whether this functions
correctly, but for tee of infinite streams, it is very important to
exit when there is nothing more to write to.
2022-07-07 15:23:50 +02:00
Ed Smith
5c13e88f8b Do not trap pipe errors in yes
This is part of fixing the tee tests. 'yes' is used by the GNU test
suite to identify what the SIGPIPE exit code is on the target
platform. By trapping SIGPIPE, it creates a requirement that other
utilities also trap SIGPIPE (and exit 0 after SIGPIPE). This is
sometimes at odds with their desired behaviour.
2022-07-07 15:23:50 +02:00
Ed Smith
7a961a94a5 Preserve signal exit statuses in timeout
When the monitored process exits, the GNU version of timeout will
preserve its exit status, including the signal state.

This is a partial fix for timeout to enable the tee tests to pass.  It
removes the default Rust trap for SIGPIPE, and kill itself with the
same signal as its child exited with to preserve the signal state.
2022-07-07 15:23:50 +02:00
Ed Smith
a360504574 Implement tee -p and --output-error
This has the following behaviours. On Unix:

- The default is to exit on pipe errors, and warn on other errors.

- "--output-error=warn" means to warn on all errors

- "--output-error", "--output-error=warn-nopipe" and "-p" all mean
  that pipe errors are suppressed, all other errors warn.

- "--output-error=exit" means to warn and exit on all errors.

- "--output-error=exit-nopipe" means to suppress pipe errors, and to
  warn and exit on all other errors.

On non-Unix platforms, all pipe behaviours are ignored, so the default
is effectively "--output-error=warn" and "warn-nopipe" is identical.
The only meaningful option is "--output-error=exit" which is identical
to "--output-error=exit-nopipe" on these platforms.

Note that warnings give a non-zero exit code, but do not halt writing
to non-erroring targets.
2022-07-07 15:23:50 +02:00
Sylvestre Ledru
922afa29ff
Merge branch 'main' into cp-preserve-perm-link 2022-07-07 15:22:57 +02:00
dependabot[bot]
ea503bf633 build(deps): bump regex from 1.5.6 to 1.6.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.6 to 1.6.0.
- [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.5.6...1.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 15:22:48 +02:00
Daniel Hofstetter
249b398906 comm: enable "output_delimiter" test 2022-07-07 15:22:43 +02:00
Sylvestre Ledru
37b754f462
Build & install grcov ourselves + force the version of crossbeam-epoch (#3702)
Fixes:
https://github.com/uutils/coreutils/issues/3680
https://github.com/mozilla/grcov/issues/849
2022-07-07 15:21:39 +02:00
Sylvestre Ledru
2f46e4020d
Merge pull request #3701 from cakebaker/comm_nul_delimiter
comm: use NUL if delimiter is empty
2022-07-06 22:57:25 +02:00
Daniel Hofstetter
ac35a1b985 comm: use NUL if delimiter is empty 2022-07-06 13:50:23 +02:00
Sylvestre Ledru
450bd3b597
Remove the is_symlink function 2022-07-06 11:18:31 +02:00
Sylvestre Ledru
43a5b8c7d7
Merge pull request #3671 from niyaznigmatullin/fix_realpath_test
test_realpath: fixed test to be the one that was supposed to be
2022-07-06 09:42:15 +02:00
Sylvestre Ledru
38f5a47f76
Merge pull request #3698 from uutils/dependabot/cargo/once_cell-1.13.0
build(deps): bump once_cell from 1.12.0 to 1.13.0
2022-07-06 08:56:12 +02:00
Sylvestre Ledru
334a0c13ba
Merge branch 'main' into cp-preserve-perm-link 2022-07-05 11:08:55 +02:00
Sylvestre Ledru
666fc298dd
Merge pull request #3697 from jfinkels/uucore-is-symlink
uucore: add backport for Path::is_symlink()
2022-07-05 11:08:17 +02:00
dependabot[bot]
6a335236c1
build(deps): bump once_cell from 1.12.0 to 1.13.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.12.0...v1.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 06:51:26 +00:00
Sylvestre Ledru
7ca2ae4627
spell: Ignore backport 2022-07-05 08:31:45 +02:00
Sylvestre Ledru
11bbf46647
Only include is_symink for #[cfg(unix)] 2022-07-05 08:30:52 +02:00
Jeffrey Finkelstein
df83d59b2d uucore: add backport for Path::is_symlink()
Add a `uucore::fs::is_symlink()` function that takes in a
`std::path::Path` and decides whether the given path is a symbolic
link. This is essentially a backport of the `Path::is_symlink()`
function that appears in Rust version 1.58.0. This commit also
replaces some now-duplicate code in `chmod`, `cp`, `ln`, and `rmdir`
that checks whether a path is a symbolic link with a call to
`is_symlink()`.

Technically, this commit slightly changes the behavior of
`cp`. Previously, there was a line of code like this

    if fs::symlink_metadata(&source)?.file_type().is_symlink() {

where the `?` operator propagates an error from `symlink_metadata()`
to the caller. Now the line of code is

    if is_symlink(source) {

in which any error from `symlink_metadata()` has been converted to
just be a `false` value. I believe this is a satisfactory tradeoff to
make, since an error in accessing the file will likely cause an error
later in the same code path.
2022-07-04 17:25:52 -04:00
Sylvestre Ledru
480630bfd6
Merge pull request #3696 from cakebaker/numfmt_remove_default_hints_from_help
numfmt: remove duplicate default hints from help
2022-07-04 15:59:07 +02:00
Sylvestre Ledru
4f1d626a47
Merge pull request #3694 from uutils/dependabot/cargo/crossterm-0.24.0
build(deps): bump crossterm from 0.23.2 to 0.24.0
2022-07-04 15:58:52 +02:00