Skip to content

Commit 7a331b7

Browse files
committed
Pkgtest: allow 'test.*' and 'lib.install.*' to be symbolic links.
1 parent 16e322a commit 7a331b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

com.oracle.truffle.r.test.packages/pkgtest/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ def _create_libinstall(rvm, test_installed):
5050
if not test_installed:
5151
# make sure its empty
5252
shutil.rmtree(libinstall, ignore_errors=True)
53-
os.mkdir(libinstall)
53+
if os.path.exists(libinstall):
54+
logging.warning("could not clean temporary library dir %s" % libinstall)
55+
else:
56+
os.mkdir(libinstall)
5457
install_tmp = join(get_fastr_repo_dir(), "install.tmp." + rvm)
55-
# install_tmp = join(_fastr_suite_dir(), "install.tmp")
5658
shutil.rmtree(install_tmp, ignore_errors=True)
5759
os.mkdir(install_tmp)
5860
_create_testdot(rvm)
@@ -62,7 +64,9 @@ def _create_libinstall(rvm, test_installed):
6264
def _create_testdot(rvm):
6365
testdir = join(get_fastr_repo_dir(), "test." + rvm)
6466
shutil.rmtree(testdir, ignore_errors=True)
65-
os.mkdir(testdir)
67+
# Note: The existence check still makes sense because 'shutil.rmtree' won't do anything if 'testdir' is a symlink.
68+
if not os.path.exists(testdir):
69+
os.mkdir(testdir)
6670
return testdir
6771

6872

0 commit comments

Comments
 (0)