Commit graph

4802 commits

Author SHA1 Message Date
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
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
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
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
Daniel Hofstetter
bd29a8c472 numfmt: remove duplicate default hints from help 2022-07-04 10:28:47 +02:00
dependabot[bot]
ffd49076d9
build(deps): bump filetime from 0.2.16 to 0.2.17
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/alexcrichton/filetime/releases)
- [Commits](https://github.com/alexcrichton/filetime/commits/0.2.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 06:36:19 +00:00
Jeffrey Finkelstein
4780690caa cp: copy attributes of dangling symbolic link
Fix a bug in which `cp` incorrectly exited with an error when
attempting to copy the attributes of a dangling symbolic link (that
is, when running `cp -P -p`).

Fixes #3531.
2022-07-03 15:17:00 -04:00
Jeffrey Finkelstein
a7a9da9672 cp: refactor convenience function is_symlink()
Refactor common code used in several places into a convenience
function `is_symlink()` that behaves like `Path::is_symlink()` added
in Rust 1.58.0. (We support earlier versions of Rust so we cannot use
the standard library version of this function.)
2022-07-03 15:17:00 -04:00
Gergely Kalas
4f043ff57f Fix 'wc' gnu test-suite compatibility #3678
This change will extract a utility already present in ls to uucore.
This utility is used by dir and vdir too, which are adjusted to
look it up in uucode. No further changes to ls, dir or dirv intended.

The change here largely fiddles with the output of uu_wc to match
that of GNU wc. This is the case to the extent to make unit tests
pass, however, there are differences remaining. One specific
difference I did not tackle is that GNU wc will not align the
output columns (compute_number_width() -> 1) in the specific case
of the input for --files0-from=- being a named pipe, not real stdin.
This difference can be triggered using the following two invocations.
  - wc --files0-from=- < files0 # use a named pipe, GNU does align
  - cat files0- | wc --files0-from=- # use real stdin, GNU does not
    align.
2022-07-01 16:43:09 +02:00
Sylvestre Ledru
64bc20c2d8
Merge pull request #3686 from cakebaker/show_error_if_padding_is_zero
numfmt: show error if --padding is zero
2022-07-01 15:57:29 +02:00
Daniel Hofstetter
6d8aa1aaff cp: disable "extra_unused_lifetimes" lint 2022-07-01 14:54:20 +02:00
Daniel Hofstetter
220c3ca4fb numfmt: show error if --padding is zero 2022-07-01 13:34:05 +02:00
Sylvestre Ledru
f6a88552ab
Merge pull request #3667 from cakebaker/set_default_missing_value
uniq: set default missing value for "group" and "all-repeated" args
2022-07-01 00:01:21 +02:00
Sylvestre Ledru
63bf7db171
Merge pull request #3682 from cakebaker/ticket_3246
df: fix output if input path is device name
2022-06-30 23:55:58 +02:00
Sylvestre Ledru
753e7fd798
Merge pull request #3684 from uutils/dependabot/cargo/smallvec-1.9.0
build(deps): bump smallvec from 1.8.0 to 1.9.0
2022-06-30 23:54:11 +02:00
Sylvestre Ledru
5b34b9a97b
Merge pull request #3681 from cakebaker/realpath_add_no_symlinks_alias
realpath: add "--no-symlinks" alias
2022-06-30 18:42:05 +02:00
Daniel Hofstetter
72862512da uniq: set default missing value for args 2022-06-30 11:52:46 +02:00
dependabot[bot]
39d62e08d5 build(deps): bump strum_macros from 0.24.1 to 0.24.2
Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.24.1 to 0.24.2.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 11:51:28 +02:00
Daniel Hofstetter
113f0bd92b realpath: add "--no-symlinks" alias 2022-06-30 11:51:24 +02:00
Daniel Hofstetter
9b9d369298 df: fix output if input path is device name
Fixes #3246
2022-06-30 11:51:20 +02:00
dependabot[bot]
01017ac301 build(deps): bump smallvec from 1.8.0 to 1.9.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.8.0...v1.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 11:51:13 +02:00
Daniel Hofstetter
62d9305785 shuf: add missing spaces to about text 2022-06-27 09:21:48 +02:00
Sylvestre Ledru
6be25eee26
Merge pull request #3670 from tertsdiepraam/rm-completion-fix
`rm`: fix help text mistakenly being used as the long option
2022-06-25 22:06:45 +02:00
Terts Diepraam
aab9134062 rm: fix help text mistakenly being used as the long option 2022-06-24 20:03:27 +02:00
Patrick Jackson
78a77c4211
dd: fix output issues (#3610) 2022-06-24 08:58:10 +02:00
Sylvestre Ledru
b6bb476aa0
Merge pull request #3659 from cakebaker/ticket_3637
paste: implement "-z" flag
2022-06-23 22:20:09 +02:00
Sylvestre Ledru
2fb743b72a
Merge pull request #3663 from niyaznigmatullin/fix_install_C_test
Fix install c test
2022-06-23 17:09:02 +02:00
Sylvestre Ledru
7c7c694837
Merge pull request #3657 from ElijahSink/main
closes #3650: install -V does not show the filename
2022-06-23 16:57:35 +02:00
Niyaz Nigmatullin
61ad2c17b0 uu_install: add inconsistent args check 2022-06-22 19:56:22 +03:00
Niyaz Nigmatullin
b22d2470ac uu_install: check for permission change on -C option 2022-06-22 19:55:26 +03:00
Niyaz Nigmatullin
5262c043f3 uu_install: add 'removed file' message on overwriting file 2022-06-22 19:54:37 +03:00
Daniel Hofstetter
cf605c24d0 unexpand: handle too large "tabs" arguments 2022-06-22 09:30:11 +02:00
Daniel Hofstetter
d0f608c69f paste: implement "-z" flag
Fixes #3637
2022-06-22 09:30:00 +02:00
ElijahSink
f62909c1ff
Merge branch 'uutils:main' into main 2022-06-22 00:45:41 -04:00
Jan Scheer
75edeea5e4
tail: reduce CPU load for polling (#3618)
* tail: reduce CPU load for polling

This reduces the CPU load for polling drastically (from ~80% down to ~5%)
by removing/fixing several previous workarounds related to polling,
while still passing all related GNU test-suite checks.
* set Notify::PollWatcher delay to: sleep_sec/10 instead of
  sleep_sec/100
* set recv_timeout to sleep_sec instead of sleep_sec/100
* remove the manual polling of watched files

Bugs:
* fix an issue with headers to consistently pass
"test_follow_name_retry_headers" and "gnu/tests/tail-2/overlay-headers.sh"

Code clean-up and refactor
* make fields of struct FileHandling private (and add getters/setters)
to ensure that the paths are absolute and match the paths returned by
Notify::Events
* replace calls to "crash!" with "return USimpleError"
* clean-up formatting
2022-06-21 22:21:19 +02:00
Elijah Sink
2b70ccd61b install: handle when both -t and -D used together 2022-06-20 17:32:28 -05:00
Sylvestre Ledru
c277e933c9
Merge pull request #3647 from philgebhardt/backup-protect-source
cp: make `--b=simple` protective of source
2022-06-20 17:27:11 +02:00
Sylvestre Ledru
7d807f3e73
Merge pull request #3642 from Garfield96/shuf-find-seps
shuf: improve performance
2022-06-19 17:00:08 +02:00
Sylvestre Ledru
7c49bf4bd1
the cat /dev/random can be too long, use the Shakespeare text 2022-06-19 16:59:44 +02:00
Phil Gebhardt
c49d8e6113
cp: make --b=simple protective of source
When `--backup` is supplied, `cp` will take a backup of *destination* before *source* is copied. When `--backup=simple` is supplied, it is possible for the backup path for *destination* to equal the path for *source*, destroying source before the copy is made. This change prevents this by returning an error instead.

This fixes https://github.com/uutils/coreutils/issues/3629
2022-06-18 03:56:46 -07:00
Sylvestre Ledru
ad05b2f7cb
Ignore word "tmpfs" 2022-06-18 08:32:40 +02:00
Christian Menges
35e97fe88a
shuf: update BENCHMARKING.md
Signed-off-by: Christian Menges <christian.menges@outlook.com>
2022-06-17 20:57:04 +02:00
Daniel Hofstetter
edf4fee48f unexpand: implement "tabs" shortcuts 2022-06-17 14:31:40 +02:00
Sylvestre Ledru
fa51f8b986
Merge pull request #3643 from cakebaker/fix_invalid_enum_variant_in_docstring
uucore: fix invalid enum variant in docstring
2022-06-17 10:31:29 +02:00
Daniel Hofstetter
1655e85a13 expand: simplify signature of expand_shortcuts() 2022-06-16 15:59:41 +02:00
Daniel Hofstetter
72aa2ff0ab uucore: fix invalid enum variant in docstring 2022-06-16 14:43:01 +02:00
Christian Menges
19a43bf1b7
shuf: improve performance
Use memchr crate to speed up splitting input data by a separator.

Signed-off-by: Christian Menges <christian.menges@outlook.com>
2022-06-16 13:23:44 +02:00
Sylvestre Ledru
9cfb92df3f
Merge pull request #3612 from cakebaker/ticket_3575
expand: add support for "--tabs" shortcuts
2022-06-16 13:18:38 +02:00
Sylvestre Ledru
e232bb49f3
Merge pull request #3639 from cakebaker/dircolors_quote
dircolors: escape "'" and ":"
2022-06-16 10:05:58 +02:00
Terts Diepraam
bc4f193b5a
Merge pull request #3630 from sylvestre/gnu-sleep
sleep: customize one of the tests (tests/misc/sleep.sh)
2022-06-15 19:50:33 +02:00
Daniel Hofstetter
46b4b94c42 dircolors: escape "'" and ":" 2022-06-15 15:22:14 +02:00
Sylvestre Ledru
5920de5adc
Merge pull request #3614 from sylvestre/rm-ioctl
cp: Replace ioctl-sys by libc for the call to ficlone
2022-06-15 09:07:44 +02:00
Sylvestre Ledru
1747b20cf0 sleep: return 1 is no arg + customize one of the tests (tests/misc/sleep.sh) 2022-06-15 08:57:30 +02:00
Sylvestre Ledru
2fcf892dbc cp: Replace ioctl-sys by libc for the call to ficlone 2022-06-14 16:01:44 +02:00
Sylvestre Ledru
b242e6592c
Merge pull request #3617 from jfinkels/dd-float-format-stats-2
dd: only print concise byte counts if count is sufficiently large
2022-06-14 08:01:28 +02:00
Sylvestre Ledru
81a9106b76
Merge pull request #3622 from cakebaker/remove_unnecessary_spaces
du: remove unnecessary spaces from help
2022-06-13 19:26:49 +02:00
Daniel Hofstetter
dc94a08196 du: remove unnecessary spaces from help 2022-06-13 16:25:22 +02:00
Sylvestre Ledru
a07f331665
Merge branch 'main' into dependabot/cargo/strum_macros-0.24.1 2022-06-13 16:01:46 +02:00
Sylvestre Ledru
a4ce3011fd
Merge pull request #3619 from uutils/dependabot/cargo/strum-0.24.1
build(deps): bump strum from 0.24.0 to 0.24.1
2022-06-13 16:01:18 +02:00
Sylvestre Ledru
76d6a4a889
Merge pull request #3613 from Ganneff/lswidthoctal
Forbid octal numbers for width parameter
2022-06-13 16:00:36 +02:00
dependabot[bot]
28786a0fb4 build(deps): bump strum_macros from 0.24.0 to 0.24.1
Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.24.0 to 0.24.1.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 08:50:59 +02:00
dependabot[bot]
502cd11713 build(deps): bump strum from 0.24.0 to 0.24.1
Bumps [strum](https://github.com/Peternator7/strum) from 0.24.0 to 0.24.1.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 08:50:50 +02:00
Sylvestre Ledru
b1fbbb6ede doc: ignore a 'typo' 2022-06-13 08:49:35 +02:00
Sylvestre Ledru
a5861e8b43
Merge pull request #3605 from cakebaker/set_value_name
unexpand: set value name of arg
2022-06-12 16:03:06 +02:00
Sylvestre Ledru
e62ff8cd0b
Merge pull request #3600 from patricksjackson/dd-reuse-buffer
dd: reuse buffer for the most common cases
2022-06-12 16:02:39 +02:00
Sylvestre Ledru
f36b58854b
Merge pull request #3593 from str4d/2930-hashsum-isolate-non-gnu-options
hashsum: Refactor `uu_app` to isolate non-"GNU Coreutils" options
2022-06-12 16:01:34 +02:00
Joerg Jaspert
fd1e0e6dd7 Correctly parse numbers starting with 0 as octal 2022-06-12 12:55:33 +02:00
Jeffrey Finkelstein
a375644c50 dd: only print concise byte counts if large enough
Update `dd` to only print a concise form of the number of bytes with
an SI prefix (like "1 MB" or "2 GB") if the number is at least
1000. Similarly, only print the concise form with an IEC prefix (like
"1 MiB" or "2 GiB") if the number is at least 1024. For example,

    $ head -c 999 /dev/zero | dd > /dev/null
    1+1 records in
    1+1 records out
    999 bytes copied, 0.0 s, 999.0 KB/s

    $ head -c 1000 /dev/zero | dd > /dev/null
    1+1 records in
    1+1 records out
    1000 bytes (1000 B) copied, 0.0 s, 1000.0 KB/s

    $ head -c 1024 /dev/zero | dd > /dev/null
    2+0 records in
    2+0 records out
    1024 bytes (1 KB, 1024 B) copied, 0.0 s, 1.0 MB/s
2022-06-11 23:16:16 -04:00
Sylvestre Ledru
98cf16586e
Merge pull request #3603 from cakebaker/return_result_instead_of_crash
unexpand: return Result instead of calling crash!
2022-06-11 19:55:20 +02:00
Sylvestre Ledru
3461b6c452
Merge pull request #3607 from jhscheer/cut_fix_delimiter
cut: fix argument parsing for the delimiter
2022-06-11 19:54:48 +02:00
anastygnome
8693eaa3b9
Remove unnecessary trailing space when using the comma format (-m)
unnecessary trailing space was being added. because we were padding for alignment,
which is not required with -m

fixes #3608

Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
2022-06-11 08:41:08 +02:00
Joerg Jaspert
aec63c06fd Forbid octal numbers for width parameter 2022-06-10 23:42:16 +02:00
Daniel Hofstetter
e3cac647f6 expand: add support for "--tabs" shortcuts
Fixes #3575
2022-06-10 13:55:27 +02:00
Jack Grigg
fccab8a691 hashsum: Refactor uu_app to isolate non-"GNU Coreutils" options
Several binaries have been added to `hashsum` that have never been part
of GNU Coreutils:

- `sha3*sum` (uutils/coreutils#869)
- `shake*sum` (uutils/coreutils#987)
- `b3sum` (uutils/coreutils#3108 and uutils/coreutils#3164)

In particular, the `--bits` option, and the `--no-names` option added in
uutils/coreutils#3361, are not valid for any GNU Coreutils `*sum` binary
(as of Coreutils 9.0).

This commit refactors the argument parsing so that `--bits` and
`--no-names` become invalid options for the binaries intended to match
the GNU Coreutils API, instead of being ignored options. It also
refactors the custom binary name handling to distinguish between
binaries intended to match the GNU Coreutils API, and binaries that
don't have that constraint.

Part of uutils/coreutils#2930.
2022-06-10 10:07:00 +02:00
Patrick Jackson
881f0c3d06 dd: add BENCHMARKING instructions 2022-06-10 10:06:54 +02:00
Patrick Jackson
a186adbff1 dd: fixing clippy warnings. 2022-06-10 10:06:54 +02:00
Patrick Jackson
4cc058a789 dd: reuse buffer for the most common cases 2022-06-10 10:06:54 +02:00
Daniel Hofstetter
0c0e4dbda4 unexpand: return Result instead of calling crash! 2022-06-10 10:06:28 +02:00
Daniel Hofstetter
d8f73c3f24 unexpand: set value name of arg 2022-06-10 10:06:24 +02:00
dependabot[bot]
6412232e2b build(deps): bump exacl from 0.8.0 to 0.9.0
Bumps [exacl](https://github.com/byllyfish/exacl) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/byllyfish/exacl/releases)
- [Changelog](https://github.com/byllyfish/exacl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/byllyfish/exacl/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-10 10:06:13 +02:00
Jan Scheer
fa64407cb0
cut: fix argument parsing for the delimiter
This fixes the argument parsing for the delimiter for the two special
cases `-d=` and `-d ''`.
2022-06-09 22:14:43 +02:00
Junji Wei
1ba0bfc67a mktemp: respect POSIXLY_CORRECT env var when parsing args
Signed-off-by: Junji Wei <harukawei99@gmail.com>
2022-06-09 20:51:51 +08:00
Sylvestre Ledru
702a0b7a34
Merge pull request #3558 from uutils/dependabot/cargo/once_cell-1.12.0
build(deps): bump once_cell from 1.11.0 to 1.12.0
2022-06-07 15:06:52 +02:00
Sylvestre Ledru
d7b7b7f8c1
Merge pull request #3595 from cakebaker/specifier_only_allowed_with_last_value
expand: allow specifier only with last value
2022-06-07 15:06:40 +02:00
Sylvestre Ledru
0532c743f1
Merge pull request #2695 from jhscheer/tail_notify
`tail` overhaul (--follow=name, etc.)
2022-06-07 12:05:16 +02:00
Jeffrey Finkelstein
6da070cdd3 mktemp: error on empty --suffix in some situations
Make `mktemp` exit with an error if the `--suffix` option is the empty
string and the template argument does not end in an "X". Previously,
the program succeeded.

Before this commit,

    $ mktemp --suffix= aXXXb
    apBEb

After this commit,

    $ mktemp --suffix= aXXXb
    mktemp: with --suffix, template 'aXXXb' must end in X
2022-06-06 21:24:59 -04:00
dependabot[bot]
5a42c06b25
build(deps): bump once_cell from 1.11.0 to 1.12.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.11.0 to 1.12.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.11.0...v1.12.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-06-06 19:18:28 +00:00
Sylvestre Ledru
3a45f00fed
Merge pull request #3312 from uutils/dependabot/cargo/rust-ini-0.18.0
build(deps): bump rust-ini from 0.17.0 to 0.18.0
2022-06-06 21:13:59 +02:00
Jan Scheer
e8834597f3
Merge branch 'main' into tail_notify 2022-06-06 16:00:46 +02:00
Daniel Hofstetter
3c18da471d dircolors: update error message 2022-06-06 14:56:46 +02:00
Jan Scheer
beb2b7cf5e
tail: use functionality from uucore::error where applicable
* minor code clean-up
* remove test-suite summary from README
2022-06-06 14:36:51 +02:00
Daniel Hofstetter
804240164b expand: allow specifier only with last value 2022-06-06 14:15:33 +02:00
Sylvestre Ledru
fc5aedfbb7
Merge pull request #3594 from cakebaker/handle_too_large_tab_stop
expand: handle too large tab size
2022-06-06 13:39:19 +02:00
dependabot[bot]
82e81da967 build(deps): bump bytecount from 0.6.2 to 0.6.3
Bumps [bytecount](https://github.com/llogiq/bytecount) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/llogiq/bytecount/releases)
- [Commits](https://github.com/llogiq/bytecount/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 10:07:55 +02:00
Sylvestre Ledru
3f203c7ab1
Merge pull request #3586 from jfinkels/mktemp-multiple-x-sequences
mktemp: only replace last contiguous block of Xs
2022-06-06 10:06:44 +02:00
Sylvestre Ledru
63347abd19
Merge pull request #3592 from anastygnome/fork
Implement the --sync flag for df. (fixes #3564)
2022-06-06 10:05:51 +02:00
Sylvestre Ledru
c4c6d42f02
Merge pull request #3591 from jhscheer/fix_3589
dircolors: add support for stdin "-" (fix: #3589)
2022-06-06 10:04:42 +02:00
Daniel Hofstetter
c14ff14e99 expand: handle too large tab size 2022-06-05 13:49:11 +02:00
anastygnome
54590c0507 Implement the --sync flag for df. (fixes #3564)
This PR reuses the defined --sync flag for df, which was previously a
no-op, assigns its default value and uses the fact that
get_all_filesystems takes CLI options as a parameter to perform a sync
operation before any fs call.

Fixes #3564

Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
2022-06-05 09:43:59 +02:00
Sylvestre Ledru
c874802285
Add a word to the spell ignore list 2022-06-05 09:32:24 +02:00
Sylvestre Ledru
e2782e2f75
Merge pull request #3583 from cakebaker/ticket_3574
expand: show error if --tabs arg has invalid chars
2022-06-05 09:31:21 +02:00
Jan Scheer
e0efd6cc90
tail: update readme
* add clippy fixes
* add cicd fixes
2022-06-03 13:35:58 +02:00
Daniel Hofstetter
9651cff6c0 expand: show error if --tabs arg has invalid chars
Fixes #3574
2022-06-03 10:36:42 +02:00
Jan Scheer
f1b38e94cd
dircolors: add support for stdin "-" (fix: #3589) 2022-06-03 02:08:09 +02:00
Terts Diepraam
626ed43e05 ls: fix double quoting when color is enabled
When color was enabled the escape_name function was called twice which led to names like `hello world` being displayed as `"'hello world'".
2022-06-03 00:29:56 +02:00
Jan Scheer
70fed83305
tail: refactor and fixes to pass more GNU test-suite checks
* add fixes to pass:
    - tail-2/F-vs-rename.sh
    - tail-2/follow-name.sh
    - tail-2/inotify-hash-abuse.sh
    - tail-2/inotify-only-regular.sh
    - tail-2/retry.sh
* add/improve documentation
2022-06-02 17:11:51 +02:00
Jan Scheer
8ee806a444
Merge branch 'main' into tail_notify 2022-06-02 16:31:25 +02:00
Sylvestre Ledru
68cc9312c8
Merge pull request #3585 from cakebaker/multiple_tabs
expand: allow multiple "tabs" args
2022-06-02 10:08:45 +02:00
Sylvestre Ledru
aeb01c6f52
Merge pull request #3563 from sylvestre/hard-to-sym
ln: Implement -L -P to make tests/ln/hard-to-sym.sh work
2022-06-02 08:19:17 +02:00
Jeffrey Finkelstein
cff7833bf6 mktemp: only replace last contiguous block of Xs
Fix a bug in which `mktemp` would replace everything in the template
argument from the first 'X' to the last 'X' with random bytes, instead
of just replacing the last contiguous block of 'X's.

Before this commit,

    $ mktemp XXX_XXX
    2meCpfM

After this commit,

    $ mktemp XXX_XXX
    XXX_Rp5

This fixes test cases `suffix2f` and `suffix2d` in
`tests/misc/mktemp.pl` in the GNU coreutils test suite.
2022-06-01 18:21:21 -04:00
Sylvestre Ledru
08fed8fb7b
Merge pull request #3541 from cakebaker/split_set_names_for_arg_values
split: set names for arg values
2022-06-01 23:12:36 +02:00
Sylvestre Ledru
36e5b60617
Merge pull request #3566 from cakebaker/print_ls_colors
dircolors: implement --print-ls-colors
2022-06-01 23:11:57 +02:00
Sylvestre Ledru
06c2aea1b4 ln: Implement -L -P to make tests/ln/hard-to-sym.sh work 2022-06-01 23:03:50 +02:00
Daniel Hofstetter
864c666467 expand: allow multiple "tabs" args 2022-06-01 16:18:57 +02:00
Jeffrey Finkelstein
43e9fb73b1 mktemp: simplify file path parameter logic
Simplify the logic of computing the file path parameters (the
directory, prefix, suffix, and number of random characters) for the
temporary file created by `mktemp`. This commits adds an `Options`
struct as a layer of indirection between the application logic and
`clap`, and a `Params` struct whose associated function is responsible
for determining the file path parameters from the `Options`. This is
an improvement because the previous code had some logic for
determining file path parameters in one place and some in another
place.
2022-05-31 19:35:01 -04:00
Sylvestre Ledru
e276e652dc
Merge pull request #3579 from jfinkels/df-total-label-target-column
df: show "total" label in correct column
2022-05-31 07:42:06 +01:00
Terts Diepraam
a240b1cef3
Merge pull request #3578 from jfinkels/mktemp-usage-error-status-1
mktemp: exit with status 1 on usage errors
2022-05-30 18:34:27 +02:00
Jeffrey Finkelstein
d7b528f60b df: show "total" label in correct column
Show the "total" label in the "source" column or in the "target"
column if the "source" column is not visible.

Before this commit,

    $ df --total --output=target .
    Mounted on
    /
    -

After this commit,

    $ df --total --output=target .
    Mounted on
    /
    total
2022-05-30 11:22:07 -04:00
Jeffrey Finkelstein
dfc1c8a2dd mktemp: exit with status 1 on usage errors 2022-05-30 09:30:47 -04:00
Daniel Hofstetter
df2507bdf2 expand: remove empty line from error message 2022-05-30 14:31:39 +02:00
Daniel Hofstetter
6d82523a99 dircolors: implement --print-ls-colors 2022-05-30 09:11:27 +02:00
Daniel Hofstetter
2261051239 split: set names for arg values 2022-05-30 09:10:18 +02:00
Jan Scheer
767eeede34
tail: update README
* add summary of implemented/missing features
* add summary of gnu test suite results
2022-05-28 01:38:53 +02:00
Jan Scheer
4cb6b094f5
Merge branch 'main' into tail_notify 2022-05-27 23:44:24 +02:00
Jan Scheer
bb5dc8bd2f
tail: verify that -[nc]0 without -f, exit without reading
This passes: "gnu/tests/tail-2/tail-n0f.sh"

* add tests for "-[nc]0 wo -f"

* add bubble-up UResult
* rename return_code -> exit_code
2022-05-27 23:36:31 +02:00
Terts Diepraam
7861cc9dca
Merge pull request #3569 from cakebaker/overridable_args
dircolors: make -b & -c args overridable
2022-05-27 13:08:25 +02:00
Daniel Hofstetter
e750a5a06a dirname: add missing "\n\" to usage message 2022-05-27 10:52:51 +02:00
Daniel Hofstetter
598fdc4430 dircolors: make -b & -c args overridable 2022-05-27 10:36:49 +02:00
Daniel Hofstetter
3a0aaabd27 tail: fix typo 2022-05-26 15:17:20 +02:00
Jan Scheer
4bbf708c81
tail: fix handling of PermissionDenied Error
* add tests for opening unreadable files
2022-05-26 13:00:40 +02:00
Jan Scheer
6bd9a1d537
Merge branch 'main' into tail_notify 2022-05-26 00:33:12 +02:00
Jan Scheer
5f86e238ae
tail: refactor FileHandling and fixes for new tests
Refactor and fixes, mostly to pass test_follow_name_move2.
2022-05-26 00:31:03 +02:00
Sylvestre Ledru
172f5c4182
Merge pull request #3504 from cakebaker/read_blocksize_from_env_vars
df: read block size from env vars
2022-05-25 16:41:41 +02:00
Sylvestre Ledru
fa577603c2
Merge pull request #3471 from 353fc443/mktemp-set-dir-mode
mktemp: change directory permission after creation
2022-05-25 14:56:45 +02:00
Sylvestre Ledru
549c642519
Merge pull request #3559 from cakebaker/update_dircolors_database
dircolors: update internal db
2022-05-25 13:10:28 +02:00
Daniel Hofstetter
ba746250fb dircolors: update internal db 2022-05-24 13:56:15 +02:00
Daniel Hofstetter
c90a1c759a df: fix rounding behavior in humanreadable mode
Fixes #3422
2022-05-23 15:21:51 +02:00
Daniel Hofstetter
ea284ce55e df: read block size from env vars 2022-05-23 09:24:07 +02:00
Sylvestre Ledru
c818ca0039
Merge pull request #3551 from jfinkels/mktemp-too-few-xs-suffix
mktemp: include suffix in error message
2022-05-23 08:38:15 +02:00
Jan Scheer
dc4b6f2cf9
Merge branch 'main' into tail_notify 2022-05-23 01:10:32 +02:00
Jan Scheer
6a7b6ccdbe
tail: add test_follow_name_move_retry
* add fixes to pass test_follow_name_move_retry
* fix test_follow_name_remove

* bump notify to 5.0.0-pre.15
* adjust PollWatcher::with_delay -> PollWatcher::with_config
2022-05-23 00:51:02 +02:00