Commit graph

9293 commits

Author SHA1 Message Date
Joining7943
c94a039358 clippy and doc: Fix warnings, mostly needless conversions. Fix documentation warning. 2022-12-16 18:36:27 +01:00
TechHara
bae78e62e0
Merge branch 'main' into whitespace 2022-12-15 22:23:03 -05:00
Sylvestre Ledru
d7e690496b
Merge pull request #4234 from ctsk/mv-progress-extension-doc
docs: document progress flag for mv extension
2022-12-14 18:12:13 +01:00
ctsk
a1fc7432b8 docs: document progress flag for mv extension 2022-12-14 17:57:41 +01:00
Sylvestre Ledru
c5728a61b4
fix some clippy warnings (#4229)
* fix some clippy warnings

* Fix the last two
2022-12-14 15:42:07 +01:00
Terts Diepraam
e4bed1c087
Merge pull request #4135 from Joining7943/refactor-tail-check-warnings
`tail`: Refactor handling of warnings and early exits
2022-12-14 13:21:54 +01:00
TechHara
4e2cfdb8ce add more comments 2022-12-14 04:07:12 -05:00
TechHara
76f818da05 fix whitespace 2022-12-13 21:02:16 -05:00
TechHara
27dfe63f4c add comments on the function logic 2022-12-13 20:57:46 -05:00
TechHara
9798ae7987 fix clippy complaint 2022-12-13 20:34:01 -05:00
TechHara
db829321fc remove clippy complex 2022-12-13 11:51:05 -05:00
TechHara
5867a47f21 fix clippy complaint 2022-12-13 11:49:26 -05:00
TechHara
11e64958d6 add test cases to cover cut -w failing options 2022-12-13 11:43:20 -05:00
TechHara
17c48e13f4 specify that cut -w is freebsd extension 2022-12-13 11:30:58 -05:00
TechHara
866a6d25c8 fix clippy complaint 2022-12-13 11:20:34 -05:00
Joining7943
b339f6d80c tests/tail: Add all additional tests written during refactoring tail from tip of refactoring branch
Other changes summmary:
* Use module level imports instead of fully qualified imports where appropriate
* Fix intermittent failing test_positive_zero_bytes because of broken pipe
* Cleanup old disabled test for warning of following indefinitely
2022-12-13 16:16:14 +01:00
Joining7943
93654d4504 tail: Add documentation for Settings::check_warnings and Settings::verify 2022-12-13 16:16:14 +01:00
Joining7943
2dc8a1b55e tail: Add gnu's warning when following stdin is ineffective. If no pid support set to 0 in Observer. 2022-12-13 16:16:14 +01:00
Joining7943
d57545d09c tail: Refactor: Handle warnings and early exits in one place. Remove InputService ...
Other changes summary:
* Cleanup imports
* Remove stdin_is_pipe_of_fifo function
* Rename WatcherService to Observer
2022-12-13 16:16:08 +01:00
Sylvestre Ledru
ce8c53dbad
Merge pull request #4235 from cakebaker/build_rs_remove_println
build.rs: remove two comments
2022-12-13 15:32:08 +01:00
Daniel Hofstetter
3d498432fa build.rs: remove two comments 2022-12-13 15:05:05 +01:00
Terts Diepraam
69caa45b01
Merge pull request #4219 from cakebaker/match_wildcard_for_single_variant
chore: fix wildcards that match single variant
2022-12-13 11:57:52 +01:00
Christian
00bbe24639
mv: add progress bar (#4220)
* mv: add progress bar

Similarly to `cp`, adds `-g` and `--progress` flags to enable a progress
bar via indicatif.
2022-12-13 11:46:54 +01:00
Terts Diepraam
7555527d07
Merge pull request #4225 from Joining7943/4223-fix-intermittent-test-failures
tests/util: Fix #4223: intermittent failing uchild tests
2022-12-13 11:40:11 +01:00
TechHara
188d84b154 minimize unnecessary code change 2022-12-13 01:14:14 -05:00
TechHara
f334ae3149 use match guard to minimize 2022-12-13 01:10:48 -05:00
TechHara
50c8bd4c6b fix 2022-12-13 00:48:17 -05:00
TechHara
21cf0b41ab add clippy 2022-12-13 00:11:01 -05:00
TechHara
1cc3f331e7 format 2022-12-12 22:29:31 -05:00
TechHara
6516519af3 Merge branch 'main' into whitespace 2022-12-12 22:07:05 -05:00
Sylvestre Ledru
f9c0ca4383
Merge pull request #4184 from jfinkels/cp-verbose
cp: correct --verbose --parents output for both files and directories
2022-12-12 21:31:15 +01:00
Sylvestre Ledru
c78e077ff2
Merge pull request #4194 from jfinkels/dd-single-byte-written
dd: correct progress line if 1 byte written
2022-12-12 21:30:10 +01:00
TechHara
f6a0abaee3 add whitespace delimiter option 2022-12-12 12:00:57 -05:00
Joining7943
7ef9504952 tests/util: Fix intermittent failing uchild tests on macos. The ci can be slow, so increase delay.
Closes #4223
2022-12-12 12:52:10 +01:00
Terts Diepraam
01153a701f
Merge pull request #4222 from sylvestre/toybox
Run the toybox testsuite
2022-12-10 11:04:35 +01:00
Terts Diepraam
ae044d4800
Merge pull request #4221 from ctsk/cp-init-progress-bar
Tick after creating progress bar to draw it
2022-12-07 19:56:57 +01:00
Terts Diepraam
39bbcdd180
Merge pull request #4217 from sylvestre/busybox4
busybox: replicate the same output as GNU
2022-12-07 19:53:38 +01:00
Sylvestre Ledru
d453f909e8 Run toybox in the CI 2022-12-07 15:41:21 +01:00
Sylvestre Ledru
9ff6b80381 makefile: add support for toybox 2022-12-07 14:28:04 +01:00
Daniel Hofstetter
81243db948 chore: fix wildcards that match single variant 2022-12-06 10:50:34 +01:00
Sylvestre Ledru
20f6b6d0c5
Fix the # of SKIP 2022-12-06 10:45:28 +01:00
ctsk
8a837dae21 Tick after creating progress bar to draw it 2022-12-06 10:36:52 +01:00
Kai M
42b9b7b62c
install: fix issue #3814 (#3950)
* install: fix installing one file when using -Dt options

* install: fix installing multiple files with -Dt

Code was missing the logic to create the target dir when multiple files
should be copied and target dir is given by -t option.
This simplifies the copy logic also when only one file should be copied
to the target dir.

* install: fix verbose output when using -D

Also adds a unit test to verify the same behaviour as the gnu tools.

* install: add more testcases for create leading dir

Tests various combinations of "-D" with and w/o "-t" when installing
either a single file or multiple files into a non existing directory.

  install -D file1 file2 (-t) not_existing_dir
  install -D file1 (-t) not_existing_dir/

Also fixes file formatting, spelling and adds some more test asserts.

* install: fix error for nonex. dir path ending on /

The install command failed with a different error message than the
original GNU install tool. Checking for a trailing slash fixes this.
Only works on unix though.

* install: add windows support when checking for '/'

* install.rs: fix spelling

* install.rs: add more tests regarding omitting dir

This increases the CI test coverage and also checks for more corner
cases to ensure uu_install is compliant with GNU's original.

    export C=coreutils/target/debug/

    rm -rf dir1 no-dir2 dir3 file
    mkdir -p dir1 dir3
    touch file

    ${C}install dir1/file1 dir1/.. no-dir2
    ${C}install dir1/file1 dir1/.. dir3
    ${C}install dir1/.. dir3

* install: improve test_install_missing_arguments

Also check that install returns the correct error messages, when only a
target directory is given via -t and that is is not created (-D option).

* install: rework the checks for missing file args

This ensures correct (GNU install like) behavior. Tests from the last
commit will pass now.
2022-12-06 09:11:23 +01:00
Sylvestre Ledru
c132535cf5 busybox: replicate the same output as GNU 2022-12-06 08:52:05 +01:00
Sylvestre Ledru
24340665ee
Merge pull request #4216 from jfinkels/cp-preserve-hardlinks-readability
cp: improve readability of preserve_hardlinks()
2022-12-06 08:44:44 +01:00
Sylvestre Ledru
321866aae9
Merge pull request #4215 from sylvestre/busybox3
factor: trim the input to fix some busybox results
2022-12-06 07:53:15 +01:00
Jeffrey Finkelstein
54a36df9ab dd: correct progress line if 1 byte written
Correct the progress report written by `dd` if exactly one byte is
written so that it says "1 byte" instead of "1 bytes".
2022-12-05 21:41:26 -05:00
Jeffrey Finkelstein
1a839fb2c4 cp: correct --verbose --parents output for dirs
This commit corrects the behavior of `cp -r --parents --verbose` when
the source path is a directory, so that it prints the copied ancestor
directories. For example,

    $ mkdir -p a/b/c d
    $ cp -r --verbose --parents a/b/c d
    a -> d/a
    a/b -> d/a/b
    'a/b/c' -> 'd/a/b/c'
2022-12-05 21:37:13 -05:00
Jeffrey Finkelstein
bd665ea44a cp: correct --verbose --parents output for files
This commit corrects the behavior of `cp --parents --verbose` when the
source path is a file so that it prints the copied ancestor
directories. For example,

    $ mkdir -p a/b d
    $ touch a/b/c
    $ cp --verbose --parents a/b/c d
    a -> d/a
    a/b -> d/a/b
    'a/b/c' -> 'd/a/b/c'

Fixes #3332.
2022-12-05 21:36:56 -05:00
Jeffrey Finkelstein
92e1bb98fe cp: improve readability of preserve_hardlinks()
Improve readability of the `preserve_hardlinks()` helper function by
reducing levels of nesting in the body of the function and making it
return a Boolean rather than mutating a Boolean argument.
2022-12-05 21:28:22 -05:00