Commit graph

4933 commits

Author SHA1 Message Date
Daniel Hofstetter
fcb7185279 Disable "broken intra doc links" lint 2022-08-12 14:48:59 +02:00
Daniel Hofstetter
689000576b du: remove useless transmute to fix clippy warning 2022-08-12 10:56:13 +02:00
Daniel Hofstetter
898914b6fb touch: remove transmute to fix clippy warning 2022-08-12 10:54:59 +02:00
Daniel Hofstetter
bfa6e23166 numfmt: implement Eq to fix clippy warning 2022-08-12 07:49:05 +02:00
Daniel Hofstetter
c0c26c4c58 Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
Sylvestre Ledru
a2e0296ef2 remove some unnecessary parentheses 2022-08-10 22:58:27 +02:00
Sylvestre Ledru
9f1219005d fix the significant_drop_in_scrutinee clippy warning 2022-08-10 21:37:48 +02:00
Sylvestre Ledru
8692301ec7
Merge pull request #3754 from ackerleytng/main
Add `parse_glob` module and update `du` to use `parse_glob`
2022-08-10 19:28:40 +02:00
Sylvestre Ledru
e304758f61
Merge pull request #3801 from niyaznigmatullin/sort_wait_for_signal_handling
sort: wait when SIGINT was raised for the program to finish properly
2022-08-10 19:26:50 +02:00
Niyaz Nigmatullin
898be12a33 sort: add comments to wait_if_signal function and its usage 2022-08-10 15:31:03 +03:00
Niyaz Nigmatullin
e43872d4c7 sort: rename lock binding variable 2022-08-10 12:20:25 +03:00
Niyaz Nigmatullin
50f1e9a5fa sort: fix test_tmp_files_deleted_on_sigint, wait for signal handling at
the end of the program
2022-08-10 12:15:27 +03:00
Niyaz Nigmatullin
13e912bcbd touch: fix error handling 2022-08-10 11:07:22 +03:00
Ackerley Tng
c2bb9596d9 du: update du to use parse_glob::from_str 2022-08-09 10:36:23 +02:00
Ackerley Tng
898689d924 du: refactor pattern building in du 2022-08-09 10:36:23 +02:00
Ackerley Tng
defde8c91e uucore: add parse_glob module 2022-08-09 10:36:23 +02:00
dependabot[bot]
54840b5fe1
build(deps): bump ouroboros from 0.15.0 to 0.15.2
Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.15.0 to 0.15.2.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases)
- [Commits](https://github.com/joshua-maros/ouroboros/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 06:30:58 +00:00
Koutheir Attouchi
81a762ced6 Use u64 instead of ino_t/dev_t types 2022-08-06 02:50:19 -04:00
Terts Diepraam
fa47af73d0
Merge pull request #3774 from sylvestre/consistency
Add more consistency in the --help output and declarations
2022-08-04 23:53:51 +02:00
Sylvestre Ledru
d957a11f34 Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
Daniel Hofstetter
07b218e55a Replace possible_values() with value_parser() 2022-08-04 14:38:10 +02:00
Pierre Marsais
e1991525af
cp: Implement --sparse flag (#3766)
* cp: Refactor `reflink`/`sparse` handling to enable `--sparse` flag

`--sparse` and `--reflink` options have a lot of similarities:
 - They have similar options (`always`, `never`, `auto`)
 - Both need OS specific handling
 - They can be mutually exclusive

Prior to this change, `sparse` was defined as `CopyMode`, but `reflink`
wasn't. Given the similarities, it makes sense to handle them similarly.

The idea behind this change is to move all OS specific file copy
handling in the `copy_on_write_*` functions. Those function then
dispatch to the correct logic depending on the arguments (at the moment,
the tuple `(reflink, sparse)`).

Also, move the handling of `--reflink=never` from `copy_file` to the
`copy_on_write_*` functions, at the cost of a bit of code duplication,
to allow `copy_on_write_*` to handle all cases (and later handle
`--reflink=never` with `--sparse`).

* cp: Implement `--sparse` flag

This begins to address #3362

At the moment, only the `--sparse=always` logic matches the requirement
form GNU cp info page, i.e. always make holes in destination when
possible.

Sparse copy is done by copying the source to the destination block by
block (blocks being of the destination's fs block size). If the block
only holds NUL bytes, we don't write to the destination.

About `--sparse=auto`: according to GNU cp info page, the destination
file will be made sparse if the source file is sparse as well. The next
step are likely to use `lseek` with `SEEK_HOLE` detect if the source
file has holes. Currently, this has the same behaviour as
`--sparse=never`. This `SEEK_HOLE` logic can also be applied to
`--sparse=always` to improve performance when copying sparse files.

About `--sparse=never`: from my understanding, it is not guaranteed that
Rust's `fs::copy` will always produce a file with no holes, as
["platform-specific behavior may change in the
future"](https://doc.rust-lang.org/std/fs/fn.copy.html#platform-specific-behavior)

About other platforms:
 - `macos`: The solution may be to use `fcntl` command `F_PUNCHHOLE`.
 - `windows`: I only see `FSCTL_SET_SPARSE`.

This should pass the following GNU tests:
 - `tests/cp/sparse.sh`
 - `tests/cp/sparse-2.sh`
 - `tests/cp/sparse-extents.sh`
 - `tests/cp/sparse-extents-2.sh`

`sparse-perf.sh` needs `--sparse=auto`, and in particular a way to skip
holes in the source file.

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2022-08-04 13:22:59 +02:00
Pierre Marsais
90a9829287
cp: truncate destination when --reflink is set (#3759)
* cp: truncate destination when `--reflink` is set

This is needed in order to allow overriding an existing file.

```
$ truncate -s 512M /tmp/disk.img
$ mkfs.btrfs /tmp/disk.img
[...]
$ mkdir /tmp/disk
$ sudo mount /tmp/disk.img /tmp/disk
$ sudo chown $(id -u):$(id -g) -R /tmp/disk
$ for i in $(seq 0 8192); do echo -ne 'a' >>/tmp/disk/src1; done
$ echo "success" >/tmp/disk/src2
$
$ # GNU ls supports overriding files created with `--reflink`
$ cp --reflink=always /tmp/disk/src1 /tmp/disk/dst1
$ cp --reflink=always /tmp/disk/src2 /tmp/disk/dst1
$ cat /tmp/disk/dst1
success
$
$ # Now testing with uutils
$ cargo run cp --reflink=always /tmp/disk/src1 /tmp/disk/dst2
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `target/debug/coreutils cp --reflink=always /tmp/disk/src1 /tmp/disk/dst2`
$ cargo run cp --reflink=always /tmp/disk/src2 /tmp/disk/dst2
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target/debug/coreutils cp --reflink=always /tmp/disk/src2 /tmp/disk/dst2`
cp: failed to clone "/tmp/disk/src2" from "/tmp/disk/dst2": Invalid argument (os error 22)
$ cat /tmp/disk/dst2
[lots of 'a']
$
$ # With truncate(true)
$ cargo run cp --reflink=always /tmp/disk/src1 /tmp/disk/dst3
    Finished dev [unoptimized + debuginfo] target(s) in 7.98s
     Running `target/debug/coreutils cp --reflink=always /tmp/disk/src1 /tmp/disk/dst3`
$ cargo run cp --reflink=always /tmp/disk/src2 /tmp/disk/dst3
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
     Running `target/debug/coreutils cp --reflink=always /tmp/disk/src2 /tmp/disk/dst3`
$ cat /tmp/disk/dst3
success
```
2022-08-04 08:50:19 +02:00
Daniel Hofstetter
7c3116330e Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
Sylvestre Ledru
c660fc700f
Merge pull request #3757 from cakebaker/clap_update
bump clap from 3.1.18 to 3.2.15
2022-08-02 09:56:01 +02:00
Sylvestre Ledru
dba21d5ee0
Merge pull request #3763 from uutils/dependabot/cargo/sha3-0.10.2
build(deps): bump sha3 from 0.10.1 to 0.10.2
2022-08-02 09:54:39 +02:00
Sylvestre Ledru
9b81e09f7a
Merge pull request #3764 from cakebaker/numfmt_preserve_trailing_zeros
numfmt: preserve trailing zeros
2022-08-01 13:32:55 +02:00
Daniel Hofstetter
e642ca90dd numfmt: preserve trailing zeros 2022-08-01 09:48:13 +02:00
dependabot[bot]
92778de1f4
build(deps): bump sha3 from 0.10.1 to 0.10.2
Bumps [sha3](https://github.com/RustCrypto/hashes) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha3-v0.10.1...sha3-v0.10.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 06:39:05 +00:00
Pierre Marsais
4ad0d5c5a3
ls: Implement --zero flag. (#2929) (#3746)
* ls: Implement --zero flag. (#2929)

This flag can be used to provide a easy machine parseable output from
ls, as discussed in the GNU bug report
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49716.

There are some peculiarities with this flag:

 - Current implementation of GNU ls of the `--zero` flag implies some
   other flags. Those can be overridden by setting those flags after
   `--zero` in the command line.
 - This flag is not compatible with `--dired`. This patch is not 100%
   compliant with GNU ls: GNU ls `--zero` will fail if `--dired` and
   `-l` are set, while with this patch only `--dired` is needed for the
   command to fail.

We also add `--dired` flag to the parser, with no additional behaviour
change.

Testing done:
```
$ bash util/build-gnu.sh
 [...]
$ bash util/run-gnu-test.sh tests/ls/zero-option.sh
 [...]
 PASS: tests/ls/zero-option.sh
 ============================================================================
 Testsuite summary for GNU coreutils 9.1.36-8ec11
 ============================================================================
 # TOTAL: 1
 # PASS:  1
 # SKIP:  0
 # XFAIL: 0
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
 ============================================================================
```

* Use the US way to spell Behavior

* Fix formatting with cargo fmt -- tests/by-util/test_ls.rs

* Simplify --zero flag overriding logic by using index_of

Also, allow multiple --zero flags, as this is possible with GNU ls
command. Only the last one is taken into account.

Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
2022-07-31 19:02:50 +02:00
Sylvestre Ledru
38679f1c1b
Merge pull request #3751 from cakebaker/numfmt_format
numfmt: implement --format
2022-07-29 18:40:18 +02:00
Daniel Hofstetter
fc4544c42b bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
Sylvestre Ledru
35f6e2a53a
Merge pull request #3749 from uutils/dependabot/cargo/lscolors-0.11.0
build(deps): bump lscolors from 0.10.0 to 0.11.0
2022-07-28 21:56:41 +02:00
Owen Anderson
8bdee49cdd
Speed up sum by using reasonable read buffer sizes. (#3741)
* Speed up sum by using reasonable read buffer sizes.

Use a 4K read buffer for each of the checksum functions, which seems
reasonable. This improves the performance of BSD checksums on
odyssey1024.txt from 399ms to 325ms on my laptop, and of SysV
checksums from 242ms to 67ms.

* Add BENCHMARKING.md for `sum`.

* Add comment regarding block sizes.

* Improve portability of BENCHMARKING.md

* Make `div_ceil` const and enhance comment.
2022-07-28 14:38:09 +02:00
Daniel Hofstetter
ee13bc41e7 numfmt: implement --format 2022-07-28 09:59:30 +02:00
dependabot[bot]
0a8d0eaf6e
build(deps): bump lscolors from 0.10.0 to 0.11.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.10.0...v0.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 06:51:09 +00:00
Sam Nystrom
4e72e284b5
ls: silently ignore -T option (#3718)
* ls: silently ignore `-T` option
2022-07-26 10:35:43 +02:00
Niyaz Nigmatullin
e5fc8bca8d basenc: fix error code on on wrong arguments, fix usage printing test 2022-07-25 23:12:10 +03:00
Sylvestre Ledru
2fa4d6a2bb
Merge pull request #3740 from resistor/main
Implement wc fast paths that skip Unicode decoding.
2022-07-25 21:15:13 +02:00
Daniel Hofstetter
34b4853890 numfmt: don't round floats if --from is "none" 2022-07-24 16:25:52 +02:00
Sylvestre Ledru
62305e67d1
Merge pull request #3719 from andrewbaptist/main
split: Don't overwrite files
2022-07-23 22:54:57 +02:00
Owen Anderson
d5f59f23fa Implement wc fast paths that skip Unicode decoding.
Byte, character, and line counting can all be done on the raw bytes
of the incoming stream without decoding the Unicode characters. This
fact was previously exploited in specific fast paths for counting
characters and counting lines. This change unifies those fast paths into
a single shared fast paths, using const generics to specialize the
function for each use case. This has the benefit of making sure that all
combinations of these Unicode-oblivious fast paths benefit from the same
optimization.

On my laptop, this speeds up `wc -clm odyssey1024.txt` from 840ms to
120ms. I experimented with using a filter loop for line counting, but
continuing to use the bytecount crate came out ahead by a significant
margin.
2022-07-23 10:45:26 -07:00
Sylvestre Ledru
ec9130a4d7
Merge pull request #3735 from resistor/main
Implement a fast path for character counting in wc.
2022-07-22 13:29:47 +02:00
Sylvestre Ledru
f82ada645e
Merge pull request #3731 from sylvestre/fs-doc
document some common fs functions
2022-07-22 13:29:15 +02:00
Niyaz Nigmatullin
5f3f1112d1
Basename arguments simple format (#3736)
* basename: support simple format

* tests/basename: add tests for simple format

* basename: follow clippy advice
2022-07-22 13:28:54 +02:00
John Eckersberg
282b368b28 nice: Move call to Errno::clear() outside of unsafe block
Minor nitpick (of my own previous patch!), Errno::clear() is a safe
function, it should not be inside of the unsafe block.
2022-07-21 15:57:21 -04:00
Andrew Baptist
f2cfc15a70 split: Don't overwrite files
Check that a file exists by calling create_new and changing the
interface of instantiate_current_writer to return a Result rather
than calling unwrap.
2022-07-21 12:06:13 -04:00
Owen Anderson
417ad0e384 Add rustdoc comment. 2022-07-20 23:32:50 -07:00
Owen Anderson
13762cae05 Implement a fast path for character counting in wc.
When wc is invoked with only the -m flag, we only need to count the
number of Unicode characters in the input. In order to do so, we don't
actually need to decode the input bytes into characters. Rather, we can
simply count the number of non-continuation bytes in the UTF-8 stream,
since every character will contain exactly one non-continuation byte.

On my laptop, this speeds up `wc -m odyssey1024.txt` from 745ms to
109ms.
2022-07-20 22:35:40 -07:00
Sylvestre Ledru
ba24565b60
Merge pull request #3732 from cakebaker/numfmt_auto_suf_si_i
numfmt: show "invalid suffix" error for "i" suffix
2022-07-20 22:51:14 +02:00
Sylvestre Ledru
ba44fd0e2b document some common fs functions 2022-07-20 17:51:53 +02:00
Daniel Hofstetter
74bd9a26d6 numfmt: show "invalid suffix" error for "i" suffix 2022-07-20 17:51:36 +02:00
Niyaz Nigmatullin
9f2a9fa6ff uucore/fs: make function more generic 2022-07-19 17:34:52 +03:00
Niyaz Nigmatullin
b76c53c090 ln: fix windows non-compiling code 2022-07-19 17:34:52 +03:00
Niyaz Nigmatullin
80ff3b3b40 ln: change error messages, extract common code 2022-07-19 17:34:52 +03:00
Andrew Baptist
cc08e1cc3a Update to handle all the latest cargo warnings 2022-07-18 13:20:49 -04:00
Owen Anderson
735db78b3d
wc: specialize scanning loop on settings. (#3708)
* wc: specialize scanning loop on settings.

The primary computational loop in wc (iterating over all the
characters and computing word lengths, etc) is configured by a
number of boolean options that control the text-scanning behavior.
If we monomorphize the code loop for each possible combination of
scanning configurations, the rustc is able to generate better code
for each instantiation, at the least by removing the conditional
checks on each iteration, and possibly by allowing things like
vectorization.

On my computer (aarch64/macos), I am seeing at least a 5% performance
improvement in release builds on all wc flag configurations
(other than those that were already specialized) against
odyssey1024.txt, with wc -l showing the greatest improvement at 15%.

* Reduce the size of the wc dispatch table by half.

By extracting the handling of hand-written fast-paths to the
same dispatch as the automatic specializations, we can avoid
needing to pass `show_bytes` as a const generic to
`word_count_from_reader_specialized`. Eliminating this parameter
halves the number of arms in the dispatch.
2022-07-18 12:16:52 +02:00
dependabot[bot]
d15b95533e
build(deps): bump nix from 0.24.1 to 0.24.2
Bumps [nix](https://github.com/nix-rust/nix) from 0.24.1 to 0.24.2.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/v0.24.2/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.24.1...v0.24.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 06:41:18 +00:00
Niyaz Nigmatullin
4db08273b3 ln: error on --force when src=dst and dst is regular file 2022-07-18 08:17:37 +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
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
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
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
05823dd619
Merge pull request #3656 from eds-collabora/eds/tee_p
Implement tee -p
2022-07-08 18:41:34 +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
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