Commit graph

2867 commits

Author SHA1 Message Date
Jeffrey Finkelstein
f56903493c WIP Trying to diagnose 'invalid group: 1001:121' error in CI environment 2022-05-12 08:41:17 +02:00
Jeffrey Finkelstein
163df8abc1 fixup! chown: allow setting arbitrary numeric user ID 2022-05-12 08:41:17 +02:00
Jeffrey Finkelstein
55550e1a6e chown: allow setting arbitrary numeric user ID
Update `chown` to allow setting the owner of a file to a numeric user
ID regardless of whether a corresponding username exists on the
system.

For example,

    $ touch f && sudo chown 12345 f

succeeds even though there is no named user with ID 12345.

Fixes #3380.
2022-05-12 08:41:17 +02:00
Sylvestre Ledru
6a9a7d76fc
Merge pull request #3498 from jhscheer/fix_stat_redirect
stat: improve handling of stdin/fifo (fix #3485)
2022-05-12 08:35:43 +02:00
Sylvestre Ledru
1ca4cf5ea7
Merge pull request #3512 from jfinkels/mktemp-invalid-template-path-sep
mktemp: error on path separator in template prefix
2022-05-12 08:34:50 +02:00
Sylvestre Ledru
c212f4a556
Merge pull request #3513 from cakebaker/portability_headers
df: implement POSIX conform header line
2022-05-12 08:33:50 +02:00
Daniel Hofstetter
a6b100a5ca df: show error if provided block size is zero 2022-05-11 12:59:51 +02:00
Daniel Hofstetter
e26fed61b3 df: implement POSIX conform header line
It also fixes #3195
2022-05-11 12:59:47 +02:00
Jeffrey Finkelstein
2874f18950 mktemp: error on path separator in template prefix
Correct the error that arises from a path separator in the prefix
portion of a template argument provided to `mktemp`. Before this
commit, the error message was incorrect:

    $ mktemp -t a/bXXX
    mktemp: failed to create file via template 'a/bXXX': No such file or directory (os error 2) at path "/tmp/a/bege"

After this commit, the error message is correct:

    $ mktemp -t a/bXXX
    mktemp: invalid template, 'a/bXXX', contains directory separator

The code was failing to check for a path separator in the prefix
portion of the template.
2022-05-11 12:59:44 +02:00
Terts Diepraam
53c3efecd8 kill: remove table_old arg in favor of a short alias 2022-05-11 12:59:29 +02:00
Terts Diepraam
a7cf757127 kill: kill process group with negative id 2022-05-11 12:59:29 +02:00
Terts Diepraam
e1d50dae87 kill: fix typo 2022-05-11 12:59:29 +02:00
Jan Scheer
d906f09e6e stat: improve handling of stdin/fifo (fix #3485)
* fix https://github.com/uutils/coreutils/issues/3485
* improve the workaround from #3280
* add tests
2022-05-11 12:59:25 +02:00
Sylvestre Ledru
25ecb81c7f
Merge branch 'main' into mktemp-set-dir-mode 2022-05-11 12:59:05 +02:00
jfinkels
ae580cd54a
Merge pull request #3482 from cakebaker/handle_posixly_correct
df: use blocksize of 512 if POSIXLY_CORRECT is set
2022-05-09 19:43:58 -04:00
Sylvestre Ledru
f65d72e334 also support for tests/touch/relative.sh 2022-05-08 21:52:12 +02:00
Sylvestre Ledru
d5569847bd also support for tests/touch/no-rights.sh format 2022-05-08 21:50:12 +02:00
Daniel Hofstetter
f668b69a2c df: use blocksize of 512 if POSIXLY_CORRECT is set 2022-05-08 14:46:31 +02:00
Sylvestre Ledru
56264ebece
Merge branch 'main' into 2884-time-0.3 2022-05-07 20:57:14 +02:00
Daniel Hofstetter
5a3933a882 df: fix "Size" header for multiples of 1000 & 1024 2022-05-06 15:37:52 +02:00
Terts Diepraam
122c7d6d5b
Merge pull request #3490 from cakebaker/fix_help_output
df: set names for arg values & add missing space
2022-05-06 11:38:34 +02:00
Sylvestre Ledru
06ef89b3d8 touch: improve the -d option support of other dates 2022-05-06 09:23:46 +02:00
Sylvestre Ledru
a60f6dc67e Update num-traits for real 2022-05-06 08:38:10 +02:00
dependabot[bot]
97c59d7857 build(deps): bump num-traits from 0.2.14 to 0.2.15
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.14...num-traits-0.2.15)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 08:38:10 +02:00
Sylvestre Ledru
8e8203ebdb
Merge pull request #3487 from jfinkels/mktemp-simpler-error
mktemp: return MkTempError from parse_template()
2022-05-06 08:35:54 +02:00
Daniel Hofstetter
be1f41e24c df: set names for arg values & add missing space 2022-05-06 08:02:22 +02:00
Terts Diepraam
a711597619
Merge pull request #3481 from cakebaker/refactor_tests_in_table_rs
df: implement Default for Row for unit tests
2022-05-06 00:15:33 +02:00
Jeffrey Finkelstein
e691330f02 mktemp: return MkTempError from parse_template()
Change the return type of the `parse_template()` helper function in
the `mktemp` program so that it returns `Result<..., MkTempError>`
instead of `UResult<...>`. This separates the lower level helper
function from the higher level `UResult` abstraction and will make it
easier to refactor this code in future commits.
2022-05-05 17:58:37 -04:00
Sylvestre Ledru
65d0f5ba9f to_local: manage the error 2022-05-05 22:56:11 +02:00
Sylvestre Ledru
e70b99dad0 touch: add support of -d '1970-01-01 18:43:33.023456789' 2022-05-05 22:56:10 +02:00
Sylvestre Ledru
309347e218
Merge pull request #3478 from uutils/dependabot/cargo/xattr-0.2.3
build(deps): bump xattr from 0.2.2 to 0.2.3
2022-05-05 22:37:05 +02:00
Terts Diepraam
6e7abb3320
Merge pull request #3430 from cakebaker/human_readable
df: extract HumanReadable from BlockSize
2022-05-05 12:43:59 +02:00
Sylvestre Ledru
75ea1f1fc3
Merge pull request #3457 from tertsdiepraam/clap-exit-code
`clap` exit code
2022-05-05 11:44:24 +02:00
Daniel Hofstetter
00a3ec2d1f df: implement Default for Row for unit tests 2022-05-05 09:37:40 +02:00
Daniel Hofstetter
46e029f34c df: refactor HumanReadable handling
The refactoring consists of three parts:
1) Introduction of SizeFormat & HumanReadable enums
2) Addition of a size_format field to the options struct
3) Movement of header logic from BlockSize to Header
2022-05-05 09:37:17 +02:00
Sylvestre Ledru
e06fe3c8f8
Merge pull request #3480 from cakebaker/set_min_width_for_used_column
df: set min width of "Used" column to 5
2022-05-05 07:59:45 +02:00
Sylvestre Ledru
84f24aed8f
Merge pull request #3476 from ackerleytng/main
du: use USimpleError instead of set_exit_code
2022-05-05 07:59:20 +02:00
Sylvestre Ledru
cbe39b4154
Merge pull request #3456 from cakebaker/ticket_3193
df: fix "Size" column header
2022-05-05 07:58:48 +02:00
Terts Diepraam
c7b7f19559 cp: use new clap error mechanism 2022-05-04 21:32:14 +02:00
Terts Diepraam
2409726258 base: set exit code to 1 for clap errors 2022-05-04 21:32:14 +02:00
Terts Diepraam
1bb85acc71 nice: set exit code for clap errors to 125 2022-05-04 21:32:14 +02:00
Terts Diepraam
8df253da69 cat: set exit code for invalid arguments to 1 instead of 2 2022-05-04 21:32:14 +02:00
Ackerley Tng
88a62c4922 du: use common error methods with show! instead of set_exit_code 2022-05-04 07:33:19 -07:00
Daniel Hofstetter
9bd883169d df: set min width of "Used" column to 5 2022-05-04 09:37:09 +02:00
dependabot[bot]
3e30569c2f
build(deps): bump xattr from 0.2.2 to 0.2.3
Bumps [xattr](https://github.com/Stebalien/xattr) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/Stebalien/xattr/releases)
- [Commits](https://github.com/Stebalien/xattr/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 06:13:02 +00:00
anastygnome
badf947f8a
Do not dereference symlink even when dangling (fix #3364)
Fixes an issue with cp not copying symlinks in spite of the -P  (no dereference option)
Fix issue #3364

Performance improvements

Avoid useless read from metadata and reuse previous dest information

Signed-off-by: anastygnome <noreplygit@protonmail.com>
2022-05-03 19:53:23 +02:00
Daniel Hofstetter
15412f100a df: show "block-size argument too large" error 2022-05-03 09:26:57 +02:00
Sylvestre Ledru
0b9d703da8
Merge branch 'main' into 2884-time-0.3 2022-05-02 21:21:45 +02:00
Sylvestre Ledru
8353b06526
Merge pull request #3472 from uutils/dependabot/cargo/memchr-2.5.0
build(deps): bump memchr from 2.4.1 to 2.5.0
2022-05-02 21:03:13 +02:00
Sylvestre Ledru
9b69e6fd47
Merge branch 'main' into 2884-time-0.3 2022-05-02 18:14:14 +02:00
dependabot[bot]
a1e5f8e53f
build(deps): bump memchr from 2.4.1 to 2.5.0
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/BurntSushi/memchr/releases)
- [Commits](https://github.com/BurntSushi/memchr/compare/2.4.1...2.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 13:03:18 +00:00
Sylvestre Ledru
1c124fa6ed
Merge pull request #3468 from uutils/dependabot/cargo/libc-0.2.125
build(deps): bump libc from 0.2.124 to 0.2.125
2022-05-02 15:01:17 +02:00
353fc443 aka Seagull
3f942cddf5
Merge branch 'main' into mktemp-set-dir-mode 2022-05-02 10:24:03 +03:00
353fc443
87c2122e76
mktemp: change directory permission after creation 2022-05-02 07:20:29 +00:00
Sylvestre Ledru
fe7829d2f9
Merge pull request #3455 from mike-kfed/ptx_breakfile
ptx: implement breakfile option
2022-05-02 08:39:14 +02:00
dependabot[bot]
de6aa6de9b
build(deps): bump libc from 0.2.124 to 0.2.125
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.124 to 0.2.125.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.124...0.2.125)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 06:36:41 +00:00
Sylvestre Ledru
3078ca8346
Add CHARCLASS to the spell ignore 2022-05-01 20:18:33 +02:00
Jeffrey Finkelstein
aa6aefbd64 mktemp: respect path given in template argument
Fix a bug in `mktemp` where it was not respecting the path given by
the positional argument. Previously, it would place the temporary file
whose name is induced by a given template in the `/tmp` directory,
like this:

    $ mktemp XXX
    /tmp/LJr

    $ mktemp d/XXX
    /tmp/d/IhS

After this commit, it respects the directory given in the template
argument:

    $ mktemp XXX
    LJr

    $ mktemp d/XXX
    d/IhS

Fixes #3440.
2022-05-01 13:03:18 -04:00
Sylvestre Ledru
9d81d6fef2 touch: add support of -d '1970-01-01 18:43:33.023456789' 2022-05-01 17:01:22 +02:00
Sylvestre Ledru
31c28eeaa9 fix gnu/tests/touch/60-seconds 2022-05-01 17:01:22 +02:00
Sylvestre Ledru
2b11d77395 time: Improve the l&f 2022-05-01 17:01:13 +02:00
Sylvestre Ledru
c009e1bed8 workaround the tests/touch/60-seconds test to skip leap second 2022-05-01 17:00:41 +02:00
Sylvestre Ledru
3a576f2441 time: Various fixes 2022-05-01 17:00:35 +02:00
Sylvestre Ledru
ca670148f2 build(deps): bump time from 0.1.43 to 0.3.9
Bumps [time](https://github.com/time-rs/time) from 0.1.43 to 0.3.9.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.1.43...v0.3.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 16:58:47 +02:00
Michael Kefeder
83a64f4afe ptx: escape regular expression character class special chars 2022-04-30 10:01:11 +02:00
Daniel Hofstetter
023fc96aab df: fix "Size" column header
Fixes #3193
2022-04-30 07:33:00 +02:00
Michael Kefeder
4889128ede ptx: add documentation to read_char_filter_file function 2022-04-29 10:57:36 +02:00
Sylvestre Ledru
f03c069289
Merge pull request #3450 from uutils/dependabot/cargo/retain_mut-0.1.7
build(deps): bump retain_mut from 0.1.2 to 0.1.7
2022-04-29 10:50:45 +02:00
Michael Kefeder
b0567670d1 ptx: implement breakfile option 2022-04-28 16:51:06 +02:00
Sylvestre Ledru
bf3a86f654
Merge pull request #3451 from ndd7xv/help-discrepancies
fix -h and --help discrepancies
2022-04-28 08:19:41 +02:00
ndd7xv
88752ecc3e fix -h and --help discrepancies
addresses https://github.com/uutils/coreutils/issues/3370
2022-04-27 23:16:36 -04:00
dependabot[bot]
38a8fa6a77
build(deps): bump retain_mut from 0.1.2 to 0.1.7
Bumps [retain_mut](https://github.com/upsuper/retain_mut) from 0.1.2 to 0.1.7.
- [Release notes](https://github.com/upsuper/retain_mut/releases)
- [Commits](https://github.com/upsuper/retain_mut/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 06:44:04 +00:00
dependabot[bot]
3cee681e82 build(deps): bump libc from 0.2.121 to 0.2.124
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.121 to 0.2.124.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.121...0.2.124)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 11:23:42 +02:00
Sylvestre Ledru
641435d1dc
Merge pull request #3433 from uutils/dependabot/cargo/strum_macros-0.24.0
build(deps): bump strum_macros from 0.23.1 to 0.24.0
2022-04-25 23:08:35 +02:00
dependabot[bot]
681f5c88e2 build(deps): bump strum_macros from 0.23.1 to 0.24.0
Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.23.1 to 0.24.0.
- [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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 08:13:59 +02:00
Ryan Zoeller
363a2a5611 Upgrade nix to 0.24.1, ctrlc to 3.2.2
Limit nix features, which should help compile times slightly.

Replace usage of deprecated nix functionality with std equivalent.
2022-04-25 08:13:20 +02:00
Sylvestre Ledru
181ebd3996
Revert "df: remove trailing spaces in rightmost column" 2022-04-24 20:39:39 +02:00
Daniel Hofstetter
0f13de4e1a df: allow sizes with a suffix for --block-size
Fixes #3416
2022-04-24 15:37:23 +02:00
Sylvestre Ledru
5088ddc377
Merge pull request #3408 from cakebaker/ticket_3325
df: respect -t arg when specific file is provided
2022-04-23 09:24:08 +02:00
Terts Diepraam
a03e9c7d8b
Merge pull request #3432 from cakebaker/remove_unreachable_code
df: remove unreachable code
2022-04-23 01:03:06 +02:00
Sylvestre Ledru
48a521224e
Merge pull request #3396 from jtracey/android2
fix Android support
2022-04-22 16:06:12 +02:00
Daniel Hofstetter
2d4552cce4 df: respect -t arg when specific file is provided
Fixes #3325
2022-04-22 10:27:25 +02:00
Sylvestre Ledru
f684162e21
Merge pull request #3403 from uutils/dependabot/cargo/remove_dir_all-0.7.0
build(deps): bump remove_dir_all from 0.5.3 to 0.7.0
2022-04-21 21:32:23 +02:00
Daniel Hofstetter
8d1e340d80 df: remove unreachable code 2022-04-21 15:24:52 +02:00
Terts Diepraam
e8574ca184
Merge pull request #3418 from cakebaker/ticket_3409
df: show error if all types are excluded
2022-04-20 23:51:36 +02:00
Sylvestre Ledru
4ed3bbe705
Merge pull request #3423 from cakebaker/remove_trailing_spaces_in_rightmost_column
df: remove trailing spaces in rightmost column
2022-04-20 11:42:27 +02:00
Sylvestre Ledru
f6dafbc950
Merge pull request #3429 from cakebaker/ticket_3425
df: fix "File" column width for unicode filenames
2022-04-20 10:50:07 +02:00
Justin Tracey
1f025c19af address libc weirdness on 32 bit android 2022-04-20 08:44:49 +02:00
Justin Tracey
2a0d58d060 get android builds to compile and pass tests 2022-04-20 08:44:49 +02:00
Justin Tracey
5e7d58650d fix null pointer derefs
The code for creating a Passwd from the fields of the raw syscall result
assumed that the syscall would return valid C strings in all non-error
cases. This is not true, and at least one platform (Android) will
populate the fields with null pointers where they are not supported.

To fix this and prevent the error from happening again, this commit
changes `cstr2string(ptr)` to check for a null pointer, and return an
`Option<String>`, with `None` being the null pointer case. While
arguably it should be the caller's job to check for a null pointer
before calling (since the safety precondition is that the pointer is to
a valid C string), relying on the type checker to force remembering this
edge case is safer in the long run.
2022-04-20 08:44:49 +02:00
Terts Diepraam
cce2eebf98
Merge pull request #3420 from sylvestre/install-verbose
install: verbose - list all created directories
2022-04-19 18:56:57 +02:00
Daniel Hofstetter
9de407b1f0 df: fix "File" column width for unicode filenames
Fixes #3425
2022-04-19 11:09:46 +02:00
Daniel Hofstetter
cc4b28780b df: show error if all types are excluded
Fixes #3409
2022-04-19 09:10:37 +02:00
Daniel Hofstetter
576ec49fa5 df: remove trailing spaces in rightmost column 2022-04-19 08:13:35 +02:00
Sylvestre Ledru
d7cf3e7483
Merge pull request #3414 from gmnsii/main
df: -h -H shouldn't cause an error #3366
2022-04-18 22:24:36 +02:00
Sylvestre Ledru
7910eca71b install: verbose - list all created directories
$ install -Dv source_file1 sub3/a/b/c/file
install: creating directory 'sub3'
install: creating directory 'sub3/a'
install: creating directory 'sub3/a/b'
install: creating directory 'sub3/a/b/c'
'source_file1' -> 'sub3/a/b/c/file'
2022-04-18 22:06:02 +02:00
Sylvestre Ledru
ee50f408bd
Merge pull request #3419 from sylvestre/install-strip
install: When install --strip-program=foor fails, remove the target file
2022-04-18 19:29:26 +02:00
Terts Diepraam
ae24ca45f1
Merge pull request #3386 from cakebaker/ticket_3194
df: fix incorrect whitespace between columns
2022-04-18 11:13:33 +02:00
Sylvestre Ledru
6da73e6a6d install: When install --strip-program=foor fails, remove the target file
Should fix:
tests/install/strip-program.sh
2022-04-17 22:24:44 +02:00
Terts Diepraam
487c874204 uniq: print warning when both -D and -c are passed 2022-04-17 16:32:01 +02:00