Jeffrey Finkelstein
fbed01dd54
cp: force copying file to itself with --backup
...
Fix the behavior of `cp` when both `--backup` and `--force` are
specified and the source and destination are the same file. Before
this commit, `cp` terminated without copying and without making a
backup. After this commit, the copy is made and the backup file is
made. For example,
$ touch f
$ cp --force --backup f f
results in a backup file `f~` being created.
2022-11-05 19:23:50 -04:00
Daniel Hofstetter
dedb6289dd
numfmt: handle negative zero values
2022-10-24 15:13:02 +02:00
Sylvestre Ledru
c766726e8b
Merge pull request #3281 from jfinkels/split-round-robin
...
split: implement round-robin arg to --number
2022-10-23 09:57:01 +02:00
Jeffrey Finkelstein
ac3fcca6c0
cp: correctly copy ancestor dirs in --parents mode
...
Fix a bug where `cp` failed to copy ancestor directories when using
the `--parents` option. For example, before this commit:
$ mkdir -p a/b/c d
$ cp --parents a/b/c d
$ find d
d
d/c
After this commit
$ mkdir -p a/b/c d
$ cp --parents a/b/c d
$ find d
d
d/a
d/a/b
d/a/b/c
This commit also adds the correct messages for `--verbose` mode:
$ cp -r --parents --verbose a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
Fixes #3332 .
2022-10-23 00:06:56 -04:00
Jeffrey Finkelstein
cd3f7b89a7
cp: make cp -a not fail on Windows
...
Before this commit, `cp -a` would terminate with a non-zero status
code on Windows because there are no extended attributes (xattr) to
copy. However, the GNU documentation for cp states
> Try to preserve SELinux security context and extended attributes
> (xattr), but ignore any failure to do that and print no
> corresponding diagnostic.
so it seems reasonable to do nothing instead of exiting with an error
in this case.
2022-10-23 00:03:26 -04:00
Jeffrey Finkelstein
7dc96697c9
split: implement round-robin arg to --number
...
Implement distributing lines of a file in a round-robin manner to a
specified number of chunks. For example,
$ (seq 1 10 | split -n r/3) && head -v xa[abc]
==> xaa <==
1
4
7
10
==> xab <==
2
5
8
==> xac <==
3
6
9
2022-10-22 23:15:55 -04:00
Sylvestre Ledru
bb27734f6a
Merge pull request #4067 from uutils/dependabot/cargo/filetime-0.2.18
...
build(deps): bump filetime from 0.2.17 to 0.2.18
2022-10-22 19:55:44 +02:00
Huijeong Kim
02f6fa7b24
hashsum: test b3sum::test_nonames for real ( #4027 )
...
* hashsum: test b3sum::test_nonames for real
Signed-off-by: Huijeong Kim <herehuijeong@gmail.com>
* apply cargo format
Signed-off-by: Huijeong Kim <herehuijeong@gmail.com>
2022-10-22 11:23:39 +02:00
dependabot[bot]
5696059d51
build(deps): bump filetime from 0.2.17 to 0.2.18
...
Bumps [filetime](https://github.com/alexcrichton/filetime ) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/alexcrichton/filetime/releases )
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.17...0.2.18 )
---
updated-dependencies:
- dependency-name: filetime
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-22 08:21:48 +00:00
Sylvestre Ledru
5f9e66a2fb
Merge pull request #4064 from dmatos2012/hashsum-process-files-before-exit
...
hashsum: warn on file not found rather than fail
2022-10-22 10:18:05 +02:00
Niyaz Nigmatullin
0eae0fdb74
whoami: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
f95a14537b
touch: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
580bff02f8
sync: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
5ef1745960
tail: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
ff30cacbe1
date: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
b0b7565ba9
hostname: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
05a224d40e
rm: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
c26bf02a04
du: migrate winapi
to windows-sys
crate
2022-10-20 12:16:22 +03:00
Niyaz Nigmatullin
45dea119fa
cp: remove unused winapi
dependency
2022-10-20 12:16:22 +03:00
Jeffrey Finkelstein
aeba601335
cp: break up copy_directory() into helper funcs
...
Add some additional structs and helper functions to make the code in
`copydir.rs` easier to read and maintain. This commit changes only the
organization of the code, not its function.
2022-10-19 22:39:34 -04:00
Jeffrey Finkelstein
d8146d1b5c
cp: move copy_directory to new module copydir.rs
...
Move the `copy_directory()` helper function to a new module
`copydir.rs`. This commit only changes the organization of the code,
not its behavior.
2022-10-19 22:39:12 -04:00
Jeffrey Finkelstein
11d3e0f743
cp: refactor Options::preserve_hard_links()
...
Refactor common code into a helper method
`Options::preserve_hard_links()`. This also eliminates the need for
mutability in a local variable in two places.
2022-10-19 22:35:10 -04:00
David Matos
d46e5df3d3
hashsum: warn on file not found rather than fail
2022-10-19 22:46:47 +02:00
dependabot[bot]
e2c368cee0
build(deps): bump sha3 from 0.10.5 to 0.10.6
...
Bumps [sha3](https://github.com/RustCrypto/hashes ) from 0.10.5 to 0.10.6.
- [Release notes](https://github.com/RustCrypto/hashes/releases )
- [Commits](https://github.com/RustCrypto/hashes/compare/sha3-v0.10.5...sha3-v0.10.6 )
---
updated-dependencies:
- dependency-name: sha3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 06:27:28 +00:00
Niyaz Nigmatullin
505865cce8
split: fix ---io
for clap 4
2022-10-18 00:21:27 +03:00
Sylvestre Ledru
969f821830
Merge pull request #4009 from andrewbaptist/fix_eof_linebytes
...
Match GNU semantics for missing EOF
2022-10-17 16:23:20 +02:00
Niyaz Nigmatullin
3e907e0c06
Fix usage of for_byte_record_with_terminator
from bstr
2022-10-17 11:00:23 +03:00
dependabot[bot]
e48125fc9c
build(deps): bump bstr from 0.2.17 to 1.0.1
...
Bumps [bstr](https://github.com/BurntSushi/bstr ) from 0.2.17 to 1.0.1.
- [Release notes](https://github.com/BurntSushi/bstr/releases )
- [Commits](https://github.com/BurntSushi/bstr/compare/0.2.17...1.0.1 )
---
updated-dependencies:
- dependency-name: bstr
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 10:58:56 +03:00
Sylvestre Ledru
23b0bb3da4
Merge pull request #3991 from tertsdiepraam/clap-4
...
Clap 4
2022-10-14 21:49:05 +02:00
dependabot[bot]
4480d6d714
build(deps): bump smallvec from 1.9.0 to 1.10.0
...
Bumps [smallvec](https://github.com/servo/rust-smallvec ) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases )
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.9.0...v1.10.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-10-14 06:43:33 +00:00
Terts Diepraam
23fc898f79
chcon: fix update to clap 4
2022-10-13 23:05:02 +02:00
Terts Diepraam
14e3c5176c
realpath: require arguments again
2022-10-13 20:06:27 +02:00
Terts Diepraam
b0c200e831
env: handle -
correctly again
2022-10-13 20:06:02 +02:00
Terts Diepraam
d7b08a01b1
yes: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
bfd310553d
whoami: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
53567deb0f
who: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
92c4b32eeb
wc: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
60d51910e6
users: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
e99969b678
uptime: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
12048cda68
unlink: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
23c8d8b0ea
uniq: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
3a234b3b09
unexpand: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
db464bbeb5
uname: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
e94ef2f8b5
tty: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
1d147c03f6
tsort: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
9cce0bed7f
truncate: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
ea8015589b
true: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
acf4ba75fe
tr: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
e54e2e0252
touch: update to clap 4
2022-10-13 17:50:43 +02:00
Terts Diepraam
86cbdbb19e
timeout: update to clap 4
2022-10-13 17:50:43 +02:00