coreutils
coreutils copied to clipboard
cp: modify archive flag to copy dir contents rather than dir
Hello, This PR fixes #3886 to handle copying source's directory contents rather than the directory itself.
Its my first ever Rust PR. Thanks for the helpful responses, and in case something else needs to be added, i can do so np.
Thanks:)
I guess you saw that it failed on some other archs:
---- test_cp::test_cp_archive_on_directory_ending_dot stdout ----
current_directory_resolved:
mkdir: C:\Users\RUNNER~1\AppData\Local\Temp\.tmphZwpwf\dir1
mkdir: C:\Users\RUNNER~1\AppData\Local\Temp\.tmphZwpwf\dir2
touch: C:\Users\RUNNER~1\AppData\Local\Temp\.tmphZwpwf\dir1/file
run: D:\a\coreutils\coreutils\target\debug\coreutils.exe cp -a dir1/. dir2
thread 'test_cp::test_cp_archive_on_directory_ending_dot' panicked at 'Command was expected to succeed.
stdout =
stderr = cp: XAttrs are only supported on unix.
', tests\common\util.rs:176:9
failures:
test_cp::test_cp_archive_on_directory_ending_dot
Thanks for the quick feedback. I just noticed, however I also ran the same command cp -a dir1/. dir2(on windows) on the main branch and I get the same failure. Thus, I think this behavior was present from before, but it was exposed via the test. Unless by adding that test myself, I added a non-supported feature on Windows, but I am not clear whether that is related or not.
That being said, I dont have the knowledge so far to know how to make it work for windows(given the lack of Xattrs). So if maybe you can give me some pointers, I can perhaps read up on my own, and propose a fix on different PR(or this one as well)
Thanks again
maybe it could be a unix test only ?
Yeah, nice solution. Done :)
Is there anything I shall do to get that final test passing? It looks like its unrelated to this PR. I am just making sure I have addressed the issues. Let me know :) and thanks again for your time and guidance!
No need to worry about that test. The android build is failing on all PRs at the moment. There are some conflicts that need to be resolved though.
That failed test is actually not because of the spurious failures from before, it's because we still need to decide how to fix #3477.
@dmatos2012 sorry but it needs to be rebased
uff I had completely forgotten about this PR :P @sylvestre , but managed to rebase :)
GNU testsuite comparison:
GNU test failed: tests/misc/tee. tests/misc/tee is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?