* Display a message when the owner is not changed.
* Display a message when the current user/group doesn't match those specified in the `--from` args.
* print messages to stdout
* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`
* fix chown tests: test stdout and not stderr
* factorize duplicate code in a function
* Display a message when the owner is not changed.
* Display a message when the current user/group doesn't match those specified in the `--from` args.
* print messages to stdout
* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`
* fix chown tests: test stdout and not stderr
* factorize duplicate code in a function
* display the retained ownership details according to the destination ownership.
* print the message "failed to change ownership of" when we try to change a non existing file.
* replace the 4-tuple returned by parse_gid_uid_and_filter by GidUidOwnerFilter struct.
* chain the test in one expression.
* chown: remove unused var "result" in test
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Summary of changes in UCommand:
* Extend UCommand by builder methods and simplify methods in TestScenario
* Simplify code structures where possible. Add documentation.
* Store bin_path as PathBuf and util_name as String in all structs
* Remove UCommand::util and make bin_path, temp_dir private
* Rename UCommand::with_limit -> UCommand::limit
Summary of changes in TestScenario:
* Rename some parameters in TestScenario methods to be more descriptive
* Remove ucmd_keepenv, cmd_keepenv from TestScenario. Use UCommand::keep_env instead.
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
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.
* chown: support '.' as 'user.group' separator (like ':')
It also manages the case:
user.name:group (valid too)
Should fix:
gnu/tests/chown/separator.sh
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.
e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user
$ LC_ALL=C id foobar
id: 'foobar': no such user
```
* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`