aboutsummaryrefslogtreecommitdiff
path: root/tests/cp.test
diff options
context:
space:
mode:
authormakepost <makepost@firemail.cc>2019-06-10 16:29:10 +0000
committerRob Landley <rob@landley.net>2019-06-21 01:52:55 -0500
commit47a8842e78e790912ec0493a594b0eb1e972ab25 (patch)
treeaf038711fb12b449f711a6ad80e439ae7590eb8f /tests/cp.test
parent66050d1a023b4fde1ff0e30a31f2b09437605f3d (diff)
downloadtoybox-47a8842e78e790912ec0493a594b0eb1e972ab25.tar.gz
Fix cp -r dir/. symlink child.
Remove the existing link before trying to re-create, passing the test. Add -p to the -r test as a regression guard, portage calls cp with both.
Diffstat (limited to 'tests/cp.test')
-rwxr-xr-xtests/cp.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/cp.test b/tests/cp.test
index c7d445c0..9ee6cd0e 100755
--- a/tests/cp.test
+++ b/tests/cp.test
@@ -90,12 +90,12 @@ testing "-r dir1/* dir2" \
rm -rf one dir dir2
mkdir one; touch one/two; cp one/two one/three
-cp -r one/ one_ # Succeeds twice in a row
-testing "-r dir/." "cp -r one/. one_ && echo yes" "yes\n" "" ""
+cp -pr one/ one_ # Succeeds twice in a row
+testing "-pr dir/." "cp -pr one/. one_ && echo yes" "yes\n" "" ""
rm -rf one one_
mkdir one; touch one/two; ln -s two one/three
-cp -r one/ one_ # First time ok, but second will fail with "File exists"
-testing "-r dir/. symlink child" "cp -r one/. one_ && echo yes" "yes\n" "" ""
+cp -pr one/ one_ # First time ok, second mustn't fail with "File exists"
+testing "-pr dir/. symlink child" "cp -pr one/. one_ && echo yes" "yes\n" "" ""
rm -rf one one_
touch walrus