Commit graph

3808 commits

Author SHA1 Message Date
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
Sylvestre Ledru
6bc68cdcdf
Merge branch 'main' into refactor/add_nix_error_auto_conversion 2022-11-04 12:54:35 +01:00
Orhun Parmaksız
be49eb68f3
fix: address test failures 2022-11-04 13:35:54 +03:00
Daniel Hofstetter
7df36bb153 mv: fix "needless borrow" clippy warnings 2022-11-04 10:07:21 +01:00
Daniel Hofstetter
59f37d88d0 rm: fix "needless borrow" clippy warnings 2022-11-04 10:07:21 +01:00
Sylvestre Ledru
d76da1dc95
Merge pull request #4106 from bnjbvr/remove-unused-dependencies2
Remove unused dependencies
2022-11-04 09:24:06 +01:00
dependabot[bot]
c44c7ac7b2
build(deps): bump num_cpus from 1.13.1 to 1.14.0
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.1...v1.14.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-04 06:07:50 +00:00
Benjamin Bouvier
c2a6f6c77b Remove unused dependencies 2022-11-03 21:14:38 +01:00
Sylvestre Ledru
2d79c4f693
Merge pull request #4091 from dmatos2012/allow-default-value-mktemp
mktemp: allow default missing value
2022-11-03 20:46:11 +01:00
Sylvestre Ledru
f60e861232
Merge pull request #4074 from jfinkels/cp-force-dangling-symlink
cp: restrict copy through dangling symlink with -f
2022-11-03 08:27:41 +01:00
David Matos
53c4b0b81e mktemp: allow default missing value 2022-11-03 08:27:08 +01:00
Sylvestre Ledru
9293cbb05b
Merge pull request #4040 from uutils/dependabot/cargo/binary-heap-plus-0.5.0
build(deps): bump binary-heap-plus from 0.4.1 to 0.5.0
2022-11-03 08:25:30 +01:00
Daniel Hofstetter
2d4810b91b numfmt: allow ' ' as field separator 2022-11-01 10:04:46 +01:00
Daniel Hofstetter
27c233f294 numfmt: allow "-" in field list 2022-10-31 14:53:41 +01:00
Terts Diepraam
ba3bb56041
Merge pull request #4013 from palaster/rm-correct-prompts
rm: rm3 now passes
2022-10-31 10:17:27 +01:00
Sylvestre Ledru
f2f2f7033e
Merge branch 'main' into refactor/add_nix_error_auto_conversion 2022-10-30 15:54:13 +01:00
Sylvestre Ledru
bc126085c4
Merge branch 'main' into cp-force-dangling-symlink 2022-10-29 20:01:07 +02:00
Pat Laster
7049c64790
Merge branch 'main' into rm-correct-prompts 2022-10-29 11:10:20 -05:00
Pat Laster
4b4222ffe3
Bump libc version from "0.2.136" to "0.2.137" 2022-10-29 11:09:52 -05:00
Daniel Hofstetter
3a8feedf2d numfmt: allow hyphen values for --field option 2022-10-29 16:50:41 +02:00
Sylvestre Ledru
b3af47a390
Merge branch 'main' into cp-force-dangling-symlink 2022-10-28 21:24:42 +02:00
Sylvestre Ledru
4b2138e61e
Merge pull request #4087 from uutils/dependabot/cargo/libc-0.2.137
build(deps): bump libc from 0.2.136 to 0.2.137
2022-10-28 21:23:42 +02:00
Pat Laster
c7af9a6a80
Bump libc version from "0.2.135" to "0.2.136" 2022-10-27 13:41:55 -05:00
Pat Laster
c4417bf9b2
Merge branch 'main' into rm-correct-prompts 2022-10-27 13:38:41 -05:00
Sylvestre Ledru
00d93ff451
Merge pull request #4088 from tertsdiepraam/hashsum-test-no-names
hashsum: enable testing --no-names
2022-10-27 19:55:45 +02:00
Daniel Hofstetter
2eb0b6dfe0 numfmt: round values if precision is 0 2022-10-27 15:33:20 +02:00
Sylvestre Ledru
34eabca299 pwd: support the env variable 'POSIXLY_CORRECT'
Should fix tests/misc/pwd-option.sh
2022-10-26 11:40:46 +02:00
Terts Diepraam
96b6252910
Merge pull request #4081 from sylvestre/chown-sep
chown: fails when XXXX. or XXXX: is provided (when XXXX is numeric value)
2022-10-26 11:24:35 +02:00
Terts Diepraam
bbc3495896 hashsum: enable testing --no-names
Co-authored-by: Huijeong Kim <herehuijeong@gmail.com>
2022-10-26 11:10:26 +02:00
dependabot[bot]
69c1f28c66
build(deps): bump libc from 0.2.136 to 0.2.137
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.136 to 0.2.137.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.136...0.2.137)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 06:42:06 +00:00
Sylvestre Ledru
67a36cf55d
Merge pull request #4082 from uutils/dependabot/cargo/libc-0.2.136
build(deps): bump libc from 0.2.135 to 0.2.136
2022-10-26 08:40:14 +02:00
Pat Laster
0079f73568
Merge branch 'main' into rm-correct-prompts 2022-10-25 20:58:01 -05:00
Sylvestre Ledru
52d82d54a3 Revert "hashsum: test b3sum::test_nonames for real (#4027)"
This reverts commit 02f6fa7b24.
2022-10-25 23:44:05 +02:00
dependabot[bot]
2213ad5d1c build(deps): bump libc from 0.2.135 to 0.2.136
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.135 to 0.2.136.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.135...0.2.136)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 23:28:47 +02:00
Sylvestre Ledru
76a0794823
Merge pull request #4072 from jfinkels/clippy-fixes
clippy fixes
2022-10-25 23:28:20 +02:00
Sylvestre Ledru
42fad7c4e5
Merge pull request #4078 from sylvestre/update-i
{cp, mv} -i --update source existing should not do anything and exit 0
2022-10-25 08:31:39 +02:00
Sylvestre Ledru
9f1ac221cd chown: fails when XXXX. or XXXX: is provided (when XXXX is numeric values)
If the arg starts with an id numeric value, the group isn't set but the separator is provided,
we should fail with an error

Should fix tests/chown/separator.sh
2022-10-25 08:25:05 +02:00
Pat Laster
9069d4832a
Merge branch 'main' into rm-correct-prompts 2022-10-24 18:36:52 -05:00
Sylvestre Ledru
6e8f8034ba {cp, mv} -i --update source existing should not do anything and exit 0
Should fix tests/mv/update.sh
2022-10-24 21:03:30 +02:00
Daniel Hofstetter
dedb6289dd numfmt: handle negative zero values 2022-10-24 15:13:02 +02:00
Jeffrey Finkelstein
d48a650966 cp: restrict copy through dangling symlink with -f
Change `cp` to terminate with an error when attempting to copy through
a dangling symbolic link with the `--force` option. Before this
commit,

    touch src
    ln -s no-such-file dest
    cp -f src dest

would incorrectly replace `dest` with the contents of `src`. After
this commit, it correctly fails with the error message

    cp: not writing through dangling symlink 'dest'
2022-10-23 20:17:20 -04:00
Jeffrey Finkelstein
55b3766c10 clippy fixes 2022-10-23 13:56:20 -04: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
Pat Laster
744481c800
Updated handle_writable_directory comment 2022-10-22 18:00:17 -05:00
Pat Laster
99942b4234
Merge branch 'main' into rm-correct-prompts 2022-10-22 14:12:55 -05:00
Orhun Parmaksız
f117f36313
Merge branch 'main' into refactor/add_nix_error_auto_conversion 2022-10-22 20:35:43 +02:00
Orhun Parmaksız
81ea9521ce
fix: conditionally enable nix error conversions 2022-10-22 21:34:45 +03: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
Sylvestre Ledru
fd13ceddcb
Merge branch 'main' into rm-correct-prompts 2022-10-22 10:22:29 +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
dependabot[bot]
c6a88c8374
build(deps): bump binary-heap-plus from 0.4.1 to 0.5.0
Bumps [binary-heap-plus](https://github.com/sekineh/binary-heap-plus-rs) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/sekineh/binary-heap-plus-rs/releases)
- [Changelog](https://github.com/sekineh/binary-heap-plus-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sekineh/binary-heap-plus-rs/commits)

---
updated-dependencies:
- dependency-name: binary-heap-plus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-22 08:19:47 +00:00
Sylvestre Ledru
74624b27f1
Merge branch 'main' into refactor/add_nix_error_auto_conversion 2022-10-22 10:19:09 +02: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
Pat Laster
5968f53ef4 Fixed merge conflict 2022-10-20 15:42:55 -05:00
Pat Laster
00af775cd9
Merge branch 'main' into rm-correct-prompts 2022-10-20 15:03:37 -05: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
Orhun Parmaksız
50be73d99f
refactor: add automatic conversion for nix::Errno 2022-10-19 00:13:59 +03:00
Pat Laster
79895a73e6
Merge branch 'main' into rm-correct-prompts 2022-10-18 10:48:26 -05:00
Pat Laster
87df47dee3
Merge branch 'main' into rm-correct-prompts 2022-10-17 17:41:44 -05:00
Pat Laster
2e61580b99 Cleaner force_prompt_never 2022-10-17 17:40:33 -05: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
Pat Laster
03578a7aca Fixed invert issue 2022-10-16 13:14:17 -05:00
Pat Laster
b612ce5cd7 Cleaner force_prompt_never 2022-10-16 10:57:12 -05:00
Pat Laster
b3b90e453c Forgot fmt again 2022-10-15 17:41:11 -05:00
Pat Laster
1c507c6739 Updated to clap4 2022-10-15 17:39:10 -05:00
Pat Laster
430652193b Fixed merge conflicts 2022-10-15 15:08:28 -05:00
Pat Laster
7e62945fd3
Merge branch 'main' into rm-correct-prompts 2022-10-15 14:58:13 -05: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
Pat Laster
21b066a58e Why is S_IWUSR showing up as a u16 on macos 2022-10-13 20:03:35 -05:00
Pat Laster
fddc8c9d9d More readable unix write permissions for directory using libc 2022-10-13 20:03:35 -05:00
Pat Laster
a3f35a726c Add override for prompting 2022-10-13 20:03:35 -05:00
Pat Laster
e11dd50eb4 Added comments 2022-10-13 20:03:35 -05:00
Pat Laster
355136936f Fixed force rm 2022-10-13 20:03:35 -05:00
Pat Laster
3a1098489e Small fix 2022-10-13 20:03:35 -05:00
Pat Laster
3c39a57da0 Check force position in rm 2022-10-13 20:03:35 -05:00
Pat Laster
50d2948aa1 Fixed rm --force argument not forcing prompt to not show up 2022-10-13 20:03:35 -05:00
Pat Laster
6856ce0bf4 Fixed handle_writable_directory on windows 2022-10-13 20:03:35 -05:00
Pat Laster
1f50df2af6 Fixed spelling error 2022-10-13 20:03:35 -05:00
Pat Laster
30adc8e037 Added windows version of handle_writable_directory 2022-10-13 20:03:35 -05:00
Pat Laster
6245029445 rm: rm3 now passes 2022-10-13 20:03:35 -05: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
Terts Diepraam
72d7287b11 test: update to clap 4 2022-10-13 17:50:43 +02:00
Terts Diepraam
b15c6eb293 tee: update to clap 4 2022-10-13 17:50:43 +02:00
Terts Diepraam
c8536c0985 tail: update to clap 4 2022-10-13 17:50:43 +02:00
Terts Diepraam
0611bd6fda tac: update to clap 4 2022-10-13 17:50:43 +02:00
Terts Diepraam
c7a7c4f2f2 sync: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
02f6d4d5c8 sum: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
5722e47474 stty: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
b6a4f32889 stdbuf: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
1f67351efa stat: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
261b18d6f3 split: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
c11d6b45cc sort: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
6a98c4c7d0 sleep: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
4d52449667 shuf: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
dfdd55b428 shred: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
4cfc90c077 seq: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
d92f2f6195 runcon: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
634a4aab8e rmdir: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
c228556791 rm: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
63147b9c83 relpath: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
2faf0b62df realpath: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
b2cf7be43f readlink: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
9dc9e44cd5 pwd: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
62b963a353 ptx: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
aad802616b printf: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
63b751f351 printenv: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
8ac1eaf2d6 pr: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
b5ab886f4d pinky: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
a2023c8d15 pahtchk: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
e346253a30 paste: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
cdde016501 od: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
c99d89152a numfmt: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
d17c99a3cf nproc: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
405e5fba67 nohup: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
4b574d6228 nl: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
8b9971c54e nice: update to clap 4 2022-10-13 17:50:40 +02:00
Terts Diepraam
5faae817ba mv: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
ca135d3ef3 more: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
1e9e790b7c mktemp: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
1d6c5d14b2 mknod: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
d509c16a22 mkfifo: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
67ba0c8195 dir, vdir: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
f432e5809c mkdir: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
c6cff20f18 ls: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
eadbea74d6 logname: update to clap 4 2022-10-13 17:50:36 +02:00
Terts Diepraam
56ea8bb4ac ln: update to clap 4 2022-10-13 17:50:33 +02:00
Terts Diepraam
838479f86a link: update to clap 4 2022-10-13 17:50:33 +02:00
Terts Diepraam
6eb7c64f7a kill: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
879a9bec29 join: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
a529a27a23 install: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
a3a50eb4ef id: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
0f642451e1 hostname:" update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
0253a0bcfa hostid: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
4f3c94968e head: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
b95c5ce279 hashsum: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
6df2187397 groups: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
6ee19a42a4 fold: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
c485c47503 fmt: update to cla p 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
8260090ea1 false: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
458c2c8b85 factor: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
86d24176e4 expr: update to clap 4 and remove custom argument parsing 2022-10-13 17:50:29 +02:00
Terts Diepraam
6cc6f35155 expand: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
b7c1216a1a env: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
b007318b51 echo: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
8f3c43b238 du: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
98673ad76f dirname: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
aaf1e362bf dircolors: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
811a06fd66 df: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
2420830e9d dd: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
8183f4cf06 date: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
5556d23e21 cut: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
e8d24f97ae csplit: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
042bb3c4e3 cp: update to clap 4 2022-10-13 17:50:26 +02:00
Terts Diepraam
34ad013155 comm: update to clap 4 2022-10-13 17:50:26 +02:00
Terts Diepraam
73a7b7f982 cksum: update to clap 4 2022-10-13 17:50:26 +02:00
Terts Diepraam
a6816c1613 chroot: update to clap 4 2022-10-13 17:50:23 +02:00
Terts Diepraam
c6aabd9023 chmod: update to clap 4 2022-10-13 17:50:23 +02:00
Terts Diepraam
624700f835 chown: update to clap 4 2022-10-13 17:50:23 +02:00
Terts Diepraam
075245235e chgrp: update to clap 4 2022-10-13 17:50:23 +02:00
Terts Diepraam
7a3cb35352 chcon: update to clap 4 2022-10-13 16:22:47 +02:00
Terts Diepraam
717402b46a cat: update to clap 4 2022-10-13 16:22:47 +02:00
Terts Diepraam
649dab36f1 basename: update to clap 4 2022-10-13 16:22:45 +02:00
Terts Diepraam
26309dc9d7 base{32, 64, enc}: update to clap 4 2022-10-13 16:22:24 +02:00
Terts Diepraam
cb8831af71 arch: update to clap 4 2022-10-13 16:20:46 +02:00
Terts Diepraam
28127a433e
Merge pull request #4043 from sylvestre/clippy
Fix some clippy warnings
2022-10-13 14:03:57 +02:00
Sylvestre Ledru
6e14dea73b Fix some clippy warnings
Fixed with `cargo clippy --features unix  --fix`
and manually
2022-10-13 09:07:22 +02:00
Sylvestre Ledru
26cc5b9c20
Merge pull request #4011 from tertsdiepraam/env-signal-handling
`env`: reraise signal from child process
2022-10-13 09:02:21 +02:00
dependabot[bot]
5261a307f7
build(deps): bump libc from 0.2.132 to 0.2.135
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.132 to 0.2.135.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.132...0.2.135)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-12 12:55:41 +00:00
Terts Diepraam
d9f36eed6e chroot: declare fs feature of uucore in Cargo.toml 2022-10-12 10:55:42 +02:00
Sylvestre Ledru
b7c298afee
Merge pull request #4020 from ackerleytng/main
dircolors: align TERM matching behavior with that of GNU dircolors
2022-10-12 09:27:34 +02:00
Terts Diepraam
f15c4f2d3e Version 0.0.16 2022-10-11 23:03:39 +02:00
Sylvestre Ledru
d768b19f2b chroot: improve support of --skip-chdir
Should unbreak tests/misc/chroot-fail.sh
2022-10-10 14:07:45 +02:00
Sylvestre Ledru
ad0ca2f042
Merge pull request #3973 from jfinkels/cp-directory-preserve-permissions
cp: preserve permissions when copying directory and don't terminate early on inaccessible file
2022-10-10 08:16:27 +02:00
Ackerley Tng
1239fc477b dircolors: align TERM matching behavior with that of GNU dircolors 2022-10-09 18:47:20 -07:00
Jeffrey Finkelstein
b89e8e54c4 cp: continue directory walk if file inaccessible
Stop `cp` from terminating prematurely if a file in a directory is
inaccesible due to insufficient permissions.
2022-10-09 17:31:41 -04:00
Jeffrey Finkelstein
2450493302 cp: preserve permissions when copying directory
Make cp preserve the permissions of a directory when copying
it. Before this commit,

    cp -pR src/ dest/

failed to copy the permissions of `src/` to `dest/`. After this
commit, the permissions are correctly copied.
2022-10-09 17:29:29 -04:00
Jeffrey Finkelstein
c370b678b1 cp: refactor copy_attributes() function
Create a `copy_attributes()` function to contain the loop that copies
each of a specified set of attributes in turn.
2022-10-09 17:28:43 -04:00
jfinkels
349320ae61
Merge branch 'main' into cp-symbolic-link-loop 2022-10-09 17:28:30 -04:00
Terts Diepraam
7d8917bb35
Merge pull request #4003 from sylvestre/sync2
sync: various compatibility improvement
2022-10-09 11:07:44 +02:00
Ackerley Tng
d84803b72f ls: align --ignore behavior with that of GNU ls 2022-10-08 16:54:07 -07:00
Terts Diepraam
ca820bf674 env: reraise signal from child process 2022-10-08 19:38:00 +02:00
Andrew Baptist
4922d34177 Match GNU semantics for missing EOF
While the rust coreutils semantics were arguably more correct,
they were different than the gnu split semantics when handling a
file without a trailing EOF. This patch addresses that difference
and allows passing one more GNU test suite.
2022-10-07 17:50:26 -04:00
Sylvestre Ledru
97dd4824e5
Merge pull request #3976 from andrewbaptist/implement_suffix_start
Add support for starting suffix numbers
2022-10-07 21:07:07 +02:00
Sylvestre Ledru
f255dcbf6d
Merge pull request #3979 from jfinkels/cp-cow-module
cp: move copy_on_write funcs to platform module
2022-10-07 14:58:45 +02:00
Sylvestre Ledru
88fb43c8e4
Merge branch 'main' into cp-symbolic-link-loop 2022-10-06 09:53:02 +02:00
Sylvestre Ledru
32112d627a
Add fiemap to the spelling 2022-10-06 09:34:48 +02:00
Jeffrey Finkelstein
8bfd96fb59 cp: correct error message on copying dir to itself
Correct the error message produced when attempting to copy a directory
into itself with `cp`. Before this commit, the error message was

    $ cp -R d d
    cp: cannot copy a directory, 'd', into itself, 'd'

After this commit, the error message is

    $ cp -R d d
    cp: cannot copy a directory, 'd', into itself, 'd/d'
2022-10-05 21:37:30 -04:00
Jeffrey Finkelstein
2d0f59c51d cp: move copy_on_write funcs to platform module
Move the copy-on-write functions for `cp` to their own module. This
provides a layer of indirection so that the `cp.rs` module need only
use `platform::copy_on_write()`, and the `platform` module is
responsible for providing the appropriate implementation for the
current platform. This commit does not change the behavior of the
code, just its organization.
2022-10-05 21:35:55 -04:00
Sylvestre Ledru
ae7c45d27a
Merge pull request #3988 from dmatos2012/add-date-format-ls
ls: add support for +FORMAT in timestyle
2022-10-05 18:41:15 +02:00
Andrew Baptist
49e1cc6c71 Add support for starting suffix numbers
This commit now allows split to pass split/numeric.sh
2022-10-05 09:52:20 -04:00
Pat Laster
493a2628d2
rm: Added descend messages for interactive mode Fixes #3817 (#3931)
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2022-10-05 13:35:31 +02:00
Jeffrey Finkelstein
24630db45e cp: allow removing symbolic link loop destination
Allow `cp --remove-destination` to remove a symbolic link loop (or a
symbolic link that initiates a chain of too many symbolic
links). Before this commit, if `loop` were a symbolic link to itself,
then

    cp --remove-destination file loop

would fail with an error message. After this commit, it succeeds. This
matches the behaviotr of GNU cp.
2022-10-05 13:32:21 +02:00
Sylvestre Ledru
6edf8ebf41 sync: Verify that the files can be opened 2022-10-05 13:30:19 +02:00
Sylvestre Ledru
fc1c7755b9 sync: make fail like GNU - tests/misc/sync.sh 2022-10-05 13:30:19 +02:00
David Matos
b8a5588b81 ls: add support for +FORMAT in timestyle 2022-10-05 13:29:19 +02:00
Terts Diepraam
25db814671
Merge pull request #4002 from sylvestre/cmd-test
test: add a bunch of operations
2022-10-04 12:00:00 +02:00
Sylvestre Ledru
45a7e52ed9
Merge pull request #3982 from jfinkels/cp-sparse-copy
cp: make copy_on_write_linux() func more readable
2022-10-03 23:19:01 -10:00
Sylvestre Ledru
436b7006f2
Merge pull request #3998 from sylvestre/wc-doc
wc: document the long match
2022-10-03 20:37:21 -10:00
Sylvestre Ledru
33de6c89db test: allow parsing of bigger numbers
Fixes: tests/misc/test.pl
2022-10-03 20:25:45 +02:00
Sylvestre Ledru
f0b8b33dc1 test: add support for -ef, -nt & -ot 2022-10-03 20:25:42 +02:00
Emil Suleymanov
a7b637b1eb
cp: assume --reflink=always on no value (#3992)
* Set reflink to auto by default
2022-10-03 20:20:55 +02:00
Sylvestre Ledru
63203a0a68 test: add -N FILE exists and has been modified since it was last read
Upstream: tests/misc/test-N.sh
2022-10-03 00:59:39 -10:00
Sylvestre Ledru
7257adb53b wc: document the long match 2022-10-03 00:57:48 -10:00
Daniel Hofstetter
8cae763321 du,stty: replace deprecated is_present() 2022-09-29 15:20:10 +02:00
Daniel Hofstetter
af51493368 df: replace deprecated values_of_lossy() 2022-09-29 09:37:13 +02:00
Terts Diepraam
4b517a361d
Merge pull request #3959 from Joining7943/tail-reactivate-presume-input-pipe
tail: Reactivate ---presume-input-pipe option
2022-09-28 00:09:18 +02:00
Jeffrey Finkelstein
1f907bfd4b fixup! cp: make copy_on_write_linux() func more readable 2022-09-26 23:59:41 -04:00
Daniel Hofstetter
9e8daf92dd Replace deprecated value_of() with get_one() 2022-09-26 16:42:42 +02:00
Jeffrey Finkelstein
e0dcc43076 cp: make copy_on_write_linux() func more readable
Improve readability of the `copy_on_write_linux()` helper function by
employing new helper functions `clone()` and `sparse_copy()`.
2022-09-25 23:14:37 -04:00
Terts Diepraam
a3ba02a791
Merge pull request #3971 from niyaznigmatullin/cp_H_option
cp: add `-H` option
2022-09-25 15:16:37 +02:00
Terts Diepraam
9ce600ffa8
Merge pull request #3904 from cakebaker/pr_use_clap_for_help_and_version
pr: use clap to handle help & version
2022-09-25 14:10:00 +02:00
Niyaz Nigmatullin
9166269aec cp: fix help for -H 2022-09-23 20:35:14 +03:00
Niyaz Nigmatullin
90babe2775 uucore: remove is_symlink function
Since Rust 1.58 there is `is_symlink` method for `Path`
2022-09-23 20:32:09 +03:00
Niyaz Nigmatullin
84a741fe91 cp: add -H option, add tests, fix test 2022-09-23 20:31:24 +03:00
Niyaz Nigmatullin
5640d56584 Fix clippy warning 2022-09-23 20:27:43 +03:00
Sylvestre Ledru
fce36c80f1
Merge pull request #3967 from uutils/dependabot/cargo/md-5-0.10.5
build(deps): bump md-5 from 0.10.4 to 0.10.5
2022-09-22 17:42:17 +02:00
jfinkels
dd0daa5e06
df: remove trailing spaces in rightmost column (#3882)
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2022-09-22 08:37:20 +02:00
dependabot[bot]
52b977de79
build(deps): bump md-5 from 0.10.4 to 0.10.5
Bumps [md-5](https://github.com/RustCrypto/hashes) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/md-5-v0.10.4...md-5-v0.10.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 06:37:09 +00:00
Jeffrey Finkelstein
60ca9a03bb mktemp: add message for directory not found
Add special handling in `mktemp` for when the directory that will
contain the temporary file is not found. This situation now produces
the message

    mktemp: failed to create file via template 'XXX': No such file or directory

to match the behavior of GNU mktemp.
2022-09-21 21:26:39 -04:00
Jeffrey Finkelstein
f2e4225bc6 mktemp: refactor make_temp_dir(), make_temp_file()
Factor code out of `exec()` into two helper functions,
`make_temp_dir()` and `make_temp_file()`.
2022-09-21 21:26:39 -04:00
Sylvestre Ledru
68ad9e4301
Merge pull request #3951 from jfinkels/mktemp-too-many-templates
mktemp: match GNU error message on too many args
2022-09-21 22:39:55 +02:00
Sylvestre Ledru
5a746a778f
Merge pull request #3938 from tertsdiepraam/dd-positional-args
`dd`: parse operands manually via positional args
2022-09-21 22:39:13 +02:00
Sylvestre Ledru
2e26e1d2bd chroot: implement --skip-chdir 2022-09-21 19:46:58 +02:00
Terts Diepraam
e377e4f046 dd: custom positional argument parsing 2022-09-21 18:41:12 +02:00
Joining7943
c32d61dcfb tests/tail: Add system tests for ---presume-input-pipe 2022-09-21 16:39:52 +02:00
Joining7943
fa8eaf3080 tail: Reactivate --presume-input-pipe option 2022-09-21 16:39:52 +02:00
Sylvestre Ledru
adc4ecd856
Merge pull request #3907 from tertsdiepraam/chroot-allow-hyphen-values
`chroot`: set trailing var arg
2022-09-21 14:09:50 +02:00
Sylvestre Ledru
7b4dcc3748
Merge pull request #3928 from niyaznigmatullin/factor_enable_union_feature_for_smallvec
factor: enable `union` feature for `smallvec`
2022-09-21 11:39:42 +02:00
Jeffrey Finkelstein
7b35749ea6 mktemp: match GNU error message on too many args
Update the usage message when too many template arguments are given on
the command line to match that of GNU mktemp:

    mktemp: too many templates
    Try 'mktemp --help' for more information.

This fixes the test case `too-many` in the GNU test suite file
`tests/misc/mktemp.pl`.
2022-09-21 10:02:56 +02:00
Joining7943
96321f958c tail: Fix random errors mainly on macos for piped input. Treat resolved paths to /dev/fd/0 as pipe.
Closes #3953
2022-09-20 01:20:49 +02:00
Sylvestre Ledru
6051c4693f
Merge pull request #3956 from uutils/dependabot/cargo/ouroboros-0.15.5
build(deps): bump ouroboros from 0.15.4 to 0.15.5
2022-09-19 18:15:43 +02:00
dependabot[bot]
efcd1a072d
build(deps): bump ouroboros from 0.15.4 to 0.15.5
Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.15.4 to 0.15.5.
- [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-09-19 06:46:19 +00:00
dependabot[bot]
39d9fa31f6
build(deps): bump selinux from 0.2.7 to 0.3.0
Bumps [selinux](https://github.com/koutheir/selinux) from 0.2.7 to 0.3.0.
- [Release notes](https://github.com/koutheir/selinux/releases)
- [Changelog](https://github.com/koutheir/selinux/blob/master/CHANGELOG.md)
- [Commits](https://github.com/koutheir/selinux/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 06:46:06 +00:00
Sylvestre Ledru
a857002def
Merge pull request #3949 from niyaznigmatullin/cp-i_gnu_test
cp: fix `cp-i` GNU test
2022-09-18 22:06:12 +02:00
jfinkels
86b012d3be
dd: handle stdout redirected to seekable file (#3880)
* dd: move argument parsing outside of Input, Output

Move the argument parsing code out of the `Input::new()` and
`Output::new()` functions and into the calling code. This allows the
calling code to make decisions about how to instantiate the `Input`
and `Output` objects if necessary.

* dd: handle stdout redirected to seekable file

Fix a bug in `dd` where null bytes would be unintentionally written if
stdout were redirected to a seekable file. For example, before this
commit, if `dd` were invoked from the command-line as

    dd if=infile bs=1 count=10 seek=5 > /dev/sda1

then five zeros would be written to `/dev/sda1` before copying ten
bytes of `infile` to `/dev/sda1`. After this commit, `dd` will
correctly seek five bytes forward in `/dev/sda1` before copying the
ten bytes of `infile`.

Fixes #3542.
2022-09-18 21:53:01 +02:00
Terts Diepraam
8c839888e1
Merge pull request #3905 from Joining7943/refactor-tail
Refactor tail
2022-09-17 20:39:53 +02:00
Terts Diepraam
513e61f434
Merge pull request #3923 from snapdgn/main
refactor:  `stat` declarative macros to functions
2022-09-17 20:36:47 +02:00
Niyaz Nigmatullin
2ce999c959 cp: fix cp-i GNU test
`cp` in interactive mode used to write to stdout asking for
overwrite. GNU version writes to stderr.

Changed: write to stderr to make compatible with GNU.
2022-09-17 19:15:52 +03:00
Niyaz Nigmatullin
edca926406 factor: enable union feature for smallvec 2022-09-17 13:20:50 +02:00
Niyaz Nigmatullin
774f498aa8 chore(deps): Bump terminal_size + cargo update 2022-09-17 01:08:41 +03:00
dependabot[bot]
05b7183112
build(deps): bump digest from 0.10.3 to 0.10.5
Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.3 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.3...digest-v0.10.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-16 06:34:05 +00:00
snapdgn
f7601c022e updated documentation 2022-09-14 10:51:03 +05:30
Jeffrey Finkelstein
61345cbdc9 mktemp: respect TMPDIR environment variable
Change `mktemp` so that it respects the value of the `TMPDIR`
environment variable if no directory is otherwise specified in its
arguments. For example, before this commit

    $ TMPDIR=. mktemp
    /tmp/tmp.WDJ66MaS1T

After this commit,

    $ TMPDIR=. mktemp
    ./tmp.h96VZBhv8P

This matches the behavior of GNU `mktemp`.
2022-09-13 19:38:25 -04:00
Joining7943
951c51e740 tail: large refactoring and cleanup of the tail code base. See also #3905 for details 2022-09-13 22:54:36 +02:00
Sylvestre Ledru
78a9f6edf8
Merge pull request #3908 from tertsdiepraam/chroot-err-codes
`chroot`: set exit codes to 125, 126 or 127 for errors from chroot itself
2022-09-12 22:43:12 +02:00
Sylvestre Ledru
1ed281fce9
Merge pull request #3921 from niyaznigmatullin/ls_exit_code_2_some_cases
ls: exit code 2 when `IOError` happened for argument
2022-09-12 22:20:08 +02:00
Niyaz Nigmatullin
4e0b238748 ls: add command_line bool to error for exit code 2 2022-09-12 19:47:16 +03:00
snapdgn
b723be4fe2 reposition functions 2022-09-12 19:56:02 +05:30
Daniel Hofstetter
ebbf8ade1e pr: use clap to handle help & version 2022-09-12 15:28:08 +02:00
snapdgn
d8226bf658 add: documentation to refactored macros->functions 2022-09-12 18:35:30 +05:30
snapdgn
243546ce96 fix: style/spelling 2022-09-12 12:19:56 +05:30
snapdgn
39e352e2af fix: failing test cases & some refactoring 2022-09-12 12:04:43 +05:30
dependabot[bot]
bf7e5a6ec0 build(deps): bump onig from 6.3.2 to 6.4.0
Bumps [onig](https://github.com/iwillspeak/rust-onig) from 6.3.2 to 6.4.0.
- [Release notes](https://github.com/iwillspeak/rust-onig/releases)
- [Changelog](https://github.com/rust-onig/rust-onig/blob/main/CHANGELOG.md)
- [Commits](https://github.com/iwillspeak/rust-onig/compare/v6.3.2...v6.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-11 20:08:28 +02:00
Sylvestre Ledru
4280c2a8a1
Merge pull request #3913 from uutils/dependabot/cargo/notify-5.0.0
build(deps): bump notify from 5.0.0-pre.16 to 5.0.0
2022-09-11 20:06:19 +02:00
snapdgn
26301d05f6 refactor: declarative macros to rust 2022-09-11 15:36:18 +05:30
Terts Diepraam
51bd8a2ba8 chroot: set exit codes to 125, 126 or 127 for errors from chroot itself 2022-09-11 12:02:54 +02:00
Terts Diepraam
975a1d170d change remaining usage codes of 2 to 1 for GNU compat 2022-09-10 20:24:24 +02:00
dependabot[bot]
d02ee4b1eb
build(deps): bump notify from 5.0.0-pre.16 to 5.0.0
Bumps [notify](https://github.com/notify-rs/notify) from 5.0.0-pre.16 to 5.0.0.
- [Release notes](https://github.com/notify-rs/notify/releases)
- [Changelog](https://github.com/notify-rs/notify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/notify-rs/notify/compare/notify-5.0.0-pre.16...notify-5.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-10 07:56:32 +00:00
Niyaz Nigmatullin
999db68042 pr: migrate from chrono crate to time
It seems that `chrono` is the reason of deadlock or UB in android
CI. Also `chrono` had some security issues and wasn't maintained for
two years until March 2022, so other unstabilities can happen. Plus
`chrono` uses old `time` dependency.
2022-09-09 21:59:08 +03:00
Joining7943
2658f8ae5b tail: improve performance of piped stdin
Rewrite handling of stdin when it is piped and read input in chunks.

Fixes https://github.com/uutils/coreutils/issues/3842
2022-09-09 13:51:37 +02:00
Terts Diepraam
1abfc4b15f chroot: set trailing var arg
Without trailing var arg set in clap, flags in the command argument are
incorrectly parsed by clap.
2022-09-09 11:42:33 +02:00
dependabot[bot]
2d59ec3453
build(deps): bump half from 1.8.2 to 2.1.0
Bumps [half](https://github.com/starkat99/half-rs) from 1.8.2 to 2.1.0.
- [Release notes](https://github.com/starkat99/half-rs/releases)
- [Changelog](https://github.com/starkat99/half-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/starkat99/half-rs/compare/v1.8.2...v2.1.0)

---
updated-dependencies:
- dependency-name: half
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-08 20:21:18 +00:00
Jan Scheer
88d3aee71c tail: fix offset for stdin redirect if multiple input files 2022-09-05 10:09:04 +02:00
Jan Scheer
74f359bd76 tail: use same-file crate to get a handle of stdin redirected file 2022-09-05 10:09:04 +02:00
Jan Scheer
942928b0ea tail: fix stdin redirect when file is not at its beginning
Previously, if stdin redirect pointed to a regular file,
tailing started at the beginning of the file. However,
tailing needs to start at the current position because this
is expected by tests/tail-2/start-middle.sh.

This fixes the issue by taking the current offset into account
while going backwards through the stdin redirected file.
2022-09-05 10:09:04 +02:00
Jan Scheer
92c3f60440 tail: fix stdin redirect (#3842)
This fixes a bug where calling `tail - < file.txt` would result
in invoking `unbounded_tail()`.
However, it is a stdin redirect to a seekable regular file and
therefore `bounded_tail` should be invoked as if `tail file.txt` had
been called.
2022-09-05 10:09:04 +02:00
Daniel Hofstetter
4fcedb4cdc rm: fix indentation within uu_app() 2022-09-04 14:42:23 +02:00
Daniel Hofstetter
8344855183 expand: fix line that's too long 2022-09-03 14:48:58 +02:00
Sylvestre Ledru
f21fda46b4
Merge pull request #3887 from cakebaker/cp_fix_indentation
cp: fix indentation within uu_app()
2022-09-02 10:21:07 +02:00
Daniel Hofstetter
da0f1a98b5 ls: fix indentation within uu_app() 2022-09-01 13:38:46 +02:00
Daniel Hofstetter
e5e6a48200 cp: fix indentation within uu_app() 2022-08-30 13:59:28 +02:00
Sylvestre Ledru
282774a3ef
Merge pull request #3853 from stefins/rm-write-protected
rm: added write-protected check for files
2022-08-29 17:03:24 +02:00
Stefin
a33bc185a5 rm: added check for write protected regular empty file
Signed-off-by: Stefin <stefin@pm.me>
2022-08-29 18:09:02 +05:30
Daniel Hofstetter
a9b5d9dccf Replace forbid_empty_values() with value_parser() 2022-08-29 10:44:52 +02:00
Owen Anderson
08d3da8f6c
Fix a TODO by making conv_block_unblock_helper consume the input. (#3787)
* Fix a TODO by making `conv_block_unblock_helper` consume the input.
2022-08-28 10:07:04 +02:00
Stefin
4c1c9ebf89 rm: change InteractiveMode::Default to InteractiveMode::PromptProtected
Signed-off-by: Stefin <stefin@pm.me>
2022-08-27 19:38:10 +05:30
Sylvestre Ledru
0dbcdde64e
Merge pull request #3873 from kilpkonn/tail_seek_outside_bounds
Fix tail panicing when seeking backwards
2022-08-26 22:35:50 +02:00
Daniel Hofstetter
2d42434911 link: move use statement after copyright 2022-08-25 16:39:34 +02:00
Daniel Hofstetter
747ed592d9 Replace allow_invalid_utf8() with value_parser() 2022-08-25 15:21:50 +02:00
Sylvestre Ledru
9afb2e7038
Merge pull request #3871 from cakebaker/clap_replace_deprecated_occurrences_of
Replace deprecated occurrences_of()
2022-08-25 08:53:42 +02:00
Tavo Annus
09cfa44560 Fix tail panicing when seeking backwards
Previously `tail -c n file.txt` caused panic if n > sizeof file.txt.
Now it prints out whole file similarly to GNU tail.
2022-08-24 21:02:47 +03:00
Jeffrey Finkelstein
8458bf1387 Clippy fixes in multiple crates 2022-08-23 18:30:43 -04:00
Daniel Hofstetter
c6e313372e Replace deprecated occurrences_of() 2022-08-23 16:31:32 +02:00
Stefin
a8326d7f3f rm: added new InteractiveMode InteractiveMode::Never
Signed-off-by: Stefin <stefin@pm.me>
2022-08-23 19:33:34 +05:30
Sylvestre Ledru
5a726e1ab3
Merge pull request #3864 from niyaznigmatullin/migrate_termsize_to_terminal_size
deps: change `termsize` dependency to `terminal_size`
2022-08-23 11:53:24 +02:00
dependabot[bot]
ed83439a20
build(deps): bump ouroboros from 0.15.2 to 0.15.3
Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.15.2 to 0.15.3.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases)
- [Commits](https://github.com/joshua-maros/ouroboros/commits/0.15.3)

---
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-23 06:26:24 +00:00
Niyaz Nigmatullin
c9a81f5a17 deps: use terminal_size instead of termsize 2022-08-22 18:53:20 +03:00
Daniel Hofstetter
6f07a3418d mv: fix indentation within uu_app() 2022-08-22 12:50:08 +02:00
Niyaz Nigmatullin
b6629ce10e bump cpp_build version 2022-08-20 21:08:43 +02:00
Sylvestre Ledru
928fe73b65
Merge pull request #3854 from niyaznigmatullin/remove_unix_socket_dependency
Remove deprecated `unix_socket` dependency
2022-08-20 21:06:57 +02:00
Niyaz Nigmatullin
503e71bb51 gnu-tests/chcon_fail: fix test 2022-08-20 19:06:19 +03:00
Niyaz Nigmatullin
306272bf60 unix_sockets is deprecated, use std::os::unix::net instead 2022-08-20 17:02:29 +03:00
Terts Diepraam
5b6cd6146b
Merge pull request #3851 from tertsdiepraam/version-0.0.15
Version 0.0.15
2022-08-20 15:17:11 +02:00
Terts Diepraam
105b0db251 rmdir, split: add fs feature to uucore dep 2022-08-20 15:13:18 +02:00
Stefin
9ffb00cd51 rm: added write-protected check for files
Signed-off-by: Stefin <stefin@pm.me>
2022-08-20 18:38:10 +05:30
Terts Diepraam
15180249fc Version 0.0.15 2022-08-20 13:13:22 +02:00
Sylvestre Ledru
2130b3ef69
Fix bad merge 2022-08-20 12:37:52 +02:00
Sylvestre Ledru
71e51d120a
Merge branch 'main' into long_help_file 2022-08-20 11:58:37 +02:00
Daniel Hofstetter
3c6400317a Replace deprecated value_of_os() with get_one() 2022-08-20 10:29:41 +02:00
Sylvestre Ledru
8786bb6541
Merge pull request #3672 from tertsdiepraam/stty
Initial implementation of `stty`
2022-08-20 09:34:08 +02:00
Daniel Hofstetter
62b1b7cfb2 Replace deprecated values_of_os() with get_many() 2022-08-20 08:19:11 +02:00
Sylvestre Ledru
aef96083d7
Merge pull request #3833 from uutils/dependabot/cargo/libc-0.2.132
build(deps): bump libc from 0.2.131 to 0.2.132
2022-08-19 19:09:26 +02:00
Sylvestre Ledru
5d148bbb9f
Merge pull request #3843 from uutils/dependabot/cargo/lscolors-0.12.0
build(deps): bump lscolors from 0.11.1 to 0.12.0
2022-08-19 19:09:03 +02:00
dependabot[bot]
6193cdbba8
build(deps): bump libc from 0.2.131 to 0.2.132
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.131 to 0.2.132.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.131...0.2.132)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-19 12:22:35 +00:00
Sylvestre Ledru
2d6c87c1ee
Merge pull request #3846 from niyaznigmatullin/exclude_winapi_dependency_on_non-windows
dependencies: make `winapi` dependency only for Windows
2022-08-19 14:19:58 +02:00
Terts Diepraam
c269a386eb stty: cargo fmt 2022-08-19 13:12:43 +02:00
Terts Diepraam
a1250ec462 stty: fix nix version 2022-08-19 12:37:56 +02:00
Terts Diepraam
0e14e1ded0 stty: add cfg guards for flags that don't exist on BSD
fix another flag
2022-08-19 12:37:52 +02:00
Sylvestre Ledru
563de8bab3
Merge pull request #3830 from niyaznigmatullin/fix_descriptor_vs_rename
tail: reuse opened file --follow=descriptor and renamed
2022-08-19 12:14:55 +02:00
Niyaz Nigmatullin
67ae68a6cf dependecies: make winapi dependency only for windows, bump platform-info
crate version dependency
2022-08-19 12:28:13 +03:00