Commit graph

1423 commits

Author SHA1 Message Date
Jan Scheer
18bfc03008
test_dircolors: add test_extra_operand 2022-06-06 00:22:21 +02:00
Jan Scheer
f1b38e94cd
dircolors: add support for stdin "-" (fix: #3589) 2022-06-03 02:08:09 +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
Sylvestre Ledru
36e5b60617
Merge pull request #3566 from cakebaker/print_ls_colors
dircolors: implement --print-ls-colors
2022-06-01 23:11:57 +02:00
Sylvestre Ledru
06c2aea1b4 ln: Implement -L -P to make tests/ln/hard-to-sym.sh work 2022-06-01 23:03:50 +02:00
Daniel Hofstetter
864c666467 expand: allow multiple "tabs" args 2022-06-01 16:18:57 +02:00
Sylvestre Ledru
2ed64fc9a1
Merge pull request #3573 from jfinkels/mktemp-simpler-prefix-suffix
mktemp: simplify file path parameter logic
2022-06-01 08:38:31 +01:00
Jeffrey Finkelstein
43e9fb73b1 mktemp: simplify file path parameter logic
Simplify the logic of computing the file path parameters (the
directory, prefix, suffix, and number of random characters) for the
temporary file created by `mktemp`. This commits adds an `Options`
struct as a layer of indirection between the application logic and
`clap`, and a `Params` struct whose associated function is responsible
for determining the file path parameters from the `Options`. This is
an improvement because the previous code had some logic for
determining file path parameters in one place and some in another
place.
2022-05-31 19:35:01 -04:00
Daniel Hofstetter
113c1855fd df: trim size header in tests
Fixes #3580
2022-05-31 10:34:20 +02:00
Sylvestre Ledru
e276e652dc
Merge pull request #3579 from jfinkels/df-total-label-target-column
df: show "total" label in correct column
2022-05-31 07:42:06 +01:00
Jeffrey Finkelstein
d7b528f60b df: show "total" label in correct column
Show the "total" label in the "source" column or in the "target"
column if the "source" column is not visible.

Before this commit,

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

After this commit,

    $ df --total --output=target .
    Mounted on
    /
    total
2022-05-30 11:22:07 -04:00
Jeffrey Finkelstein
dfc1c8a2dd mktemp: exit with status 1 on usage errors 2022-05-30 09:30:47 -04:00
Daniel Hofstetter
6d82523a99 dircolors: implement --print-ls-colors 2022-05-30 09:11:27 +02:00
Daniel Hofstetter
598fdc4430 dircolors: make -b & -c args overridable 2022-05-27 10:36:49 +02:00
Sylvestre Ledru
172f5c4182
Merge pull request #3504 from cakebaker/read_blocksize_from_env_vars
df: read block size from env vars
2022-05-25 16:41:41 +02:00
Sylvestre Ledru
fa577603c2
Merge pull request #3471 from 353fc443/mktemp-set-dir-mode
mktemp: change directory permission after creation
2022-05-25 14:56:45 +02:00
Daniel Hofstetter
74a5938acf dircolors: test for correct error for -bp and -cp 2022-05-24 15:32:01 +02:00
Daniel Hofstetter
ea284ce55e df: read block size from env vars 2022-05-23 09:24:07 +02:00
Sylvestre Ledru
c818ca0039
Merge pull request #3551 from jfinkels/mktemp-too-few-xs-suffix
mktemp: include suffix in error message
2022-05-23 08:38:15 +02:00
Sylvestre Ledru
887f49ce2d
Merge pull request #3550 from thomasqueirozb/ls_gds
ls: implement --group-directories-first
2022-05-22 09:50:04 +02:00
Jeffrey Finkelstein
35fb4e6ea1 mktemp: include suffix in error message
Include the suffix in the error message produced by `mktemp` when
there are too few Xs in the template. Before this commit,

    $ mktemp --suffix=X aXX
    mktemp: too few X's in template 'aXX'

After this commit,

    $ mktemp --suffix=X aXX
    mktemp: too few X's in template 'aXXX'

This matches the behavior of GNU `mktemp`.
2022-05-21 21:59:06 -04:00
Thomas Queiroz
0b24839a1e
tests/ls: add --group-directories-first test 2022-05-21 18:57:53 -03:00
Thomas Queiroz
c4606266e4
tests/ls: update version sort test 2022-05-21 18:50:26 -03:00
Sylvestre Ledru
d92107362b
Merge pull request #3521 from jfinkels/mktemp-tmpdir-absolute-path
mktemp: correct error message on absolute path
2022-05-21 09:40:33 +02:00
Sylvestre Ledru
bda9f9f889
Merge pull request #3529 from ilkecan/mv-target-dir
mv: allow a single source with --target-directory
2022-05-21 09:40:16 +02:00
Jeffrey Finkelstein
6260333415 mktemp: fix error msg when suffix has path sep.
Correct the error message when the template argument contains a path
separator in its suffix. Before this commit:

    $ mktemp aXXX/b
    mktemp: too few X's in template 'b'

After this commit:

    $ mktemp aXXX/b
    mktemp: invalid suffix '/b', contains directory separator

This error message is more appropriate and matches the behavior of GNU
mktemp.
2022-05-19 15:46:04 +02:00
Jeffrey Finkelstein
8a941db20a mktemp: correct error message on absolute path
Correct the error message produced by `mktemp` when `--tmpdir` is
given and the template is an absolute path:

    $ mktemp --tmpdir=a /XXX
    mktemp: invalid template, '/XXX'; with --tmpdir, it may not be absolute
2022-05-17 20:16:47 -04:00
Daniel Hofstetter
27dd59635a uucore: add InvalidSuffix to ParseSizeError 2022-05-17 15:37:49 +02:00
353fc443 aka Seagull
124312702f
Merge branch 'main' into mktemp-set-dir-mode 2022-05-17 12:51:04 +01:00
Terts Diepraam
eac0760905
Merge pull request #3528 from jfinkels/clippy-fixes
all: clippy fixes
2022-05-17 11:57:47 +02:00
353fc443 aka Seagull
2086d04996
Merge branch 'main' into mktemp-set-dir-mode 2022-05-17 04:58:03 +00:00
353fc443
2383950403
mktemp: Added tests for checking directory permissions 2022-05-16 18:05:59 +00:00
Sylvestre Ledru
40095e1b50
Merge pull request #3438 from jfinkels/chown-nonexistent-user-id
chown: allow setting arbitrary numeric user ID
2022-05-14 09:20:01 +02:00
Sylvestre Ledru
9044d96123
Merge pull request #3523 from jhscheer/fix_stat_redirect
test_stat: expand scope for stdin tests
2022-05-14 09:18:40 +02:00
ilkecan
530d5f6dbf mv: allow a single source with --target-directory 2022-05-14 03:00:29 +00:00
Jeffrey Finkelstein
896bbec760 all: clippy fixes 2022-05-13 22:47:56 -04:00
Jan Scheer
fa94591b72
test_stat: expand scope for stdin tests
On Android and macOS all/some tests for stdin fail with:
`cannot stat '-': No such file or directory`
Apparently the `/dev/stdin` redirect workaround doesn't work for
these targets.
2022-05-12 22:49:34 +02:00
Daniel Hofstetter
598dc79b69 df: test default blocksize in POSIX mode 2022-05-12 10:11:24 +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
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
7d8b1de213 uniq: Disable one of the gnu test for failing too often
See: https://github.com/uutils/coreutils/issues/3509
2022-05-10 13:54:33 +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