From 85af4c287c69394c7ec5423dcd661797cf501c9c Mon Sep 17 00:00:00 2001 From: makepost Date: Mon, 10 Jun 2019 04:53:28 +0300 Subject: Add failing test for cp -r dir/. symlink child. Gentoo packages that build multiple variants, like once for every version of a slotted dependency, currently fail to install if their source dir includes a relative symlink to own child. Affects lots of Python infrastructure, for example meson and setuptools. You've already run into this issue, since cp.test has a todo. It's from 2008 though, so I guess I'll bump with an expanded test case. Libc is musl-1.1.22. --- tests/cp.test | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/cp.test') diff --git a/tests/cp.test b/tests/cp.test index a720d1f5..c7d445c0 100755 --- a/tests/cp.test +++ b/tests/cp.test @@ -89,6 +89,15 @@ testing "-r dir1/* dir2" \ "cp -r one/* dir2 && diff -r one dir2 && echo yes" "yes\n" "" "" 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" "" "" +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" "" "" +rm -rf one one_ + touch walrus chmod 644 walrus ln -s walrus woot @@ -99,7 +108,6 @@ testing "symlink dest permissions" "cp woot carpenter && stat -c %A carpenter" \ # cp -r ../source destdir # cp -r one/two/three missing # cp -r one/two/three two -# mkdir one; touch one/two; ln -s two one/three # cp file1 file2 dir # cp file1 missing file2 -> dir -- cgit v1.2.3