summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-03-17 15:18:28 +0100
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-04-14 11:08:17 +0200
commit3427e2c8cf36d7ba109da938fb872aad6e3759af (patch)
tree8cbb2527c63021478fee8eae7418a7d2e524faf1
parente8bb341536e41ded899f8984c45bec555492d1c8 (diff)
downloadspack-3427e2c8cf36d7ba109da938fb872aad6e3759af.tar.gz
spack-3427e2c8cf36d7ba109da938fb872aad6e3759af.tar.bz2
spack-3427e2c8cf36d7ba109da938fb872aad6e3759af.tar.xz
spack-3427e2c8cf36d7ba109da938fb872aad6e3759af.zip
PackageViewMixin: fix symlinks conflict issue (#29515)
`stat`'ing a file in the dst dir is the wrong thing to do, you should `lstat` to capture broken symlinks.
-rw-r--r--lib/spack/spack/package.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index a972350f98..453623d97a 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -450,7 +450,7 @@ class PackageViewMixin(object):
Alternative implementations may allow some of the files to exist in
the view (in this case they would be omitted from the results).
"""
- return set(dst for dst in merge_map.values() if os.path.exists(dst))
+ return set(dst for dst in merge_map.values() if os.path.lexists(dst))
def add_files_to_view(self, view, merge_map):
"""Given a map of package files to destination paths in the view, add
@@ -459,7 +459,7 @@ class PackageViewMixin(object):
linked into the view already include the file.
"""
for src, dst in merge_map.items():
- if not os.path.exists(dst):
+ if not os.path.lexists(dst):
view.link(src, dst, spec=self.spec)
def remove_files_from_view(self, view, merge_map):