install: add missing directory chown
- Re-factor the copy function
chowninto a function that can be re-used. - Fix bug where the group overwrote the user.
- Add
chowncompatibility to follow GNU coreutils. - Reduce two
chowncalls to a single syscall only when needed. - Fixes #4361
Not sure how to test this though. Can the CI/CD server change owners? I assume this will break most test setups.
Manually tested for now.
GNU testsuite comparison:
Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
GNU testsuite comparison:
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
GNU testsuite comparison:
Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
Not sure how to test this though. Can the CI/CD server change owners? I assume this will break most test setups.
Passing thought: it's probably possible to chown/chrgp by running fakeroot cargo ... for the tests. This probably requires re-organizing tests that must run in fakeroot to another test suite or something to that we don't require users running unit-tests to have fakeroot installed.
Thanks!