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
* 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.
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'
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.
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.