summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Ferrell <51765748+Paul-Ferrell@users.noreply.github.com>2021-10-07 13:18:35 -0600
committerGitHub <noreply@github.com>2021-10-07 19:18:35 +0000
commit0b9914e2f524194167373da72b9685e5e21bfca1 (patch)
treecf1092829c130b96cb24f3cda37e55e42f0a1760 /lib
parent9853fd50e2dc6253a2c80b38fc3bad8f226ce94e (diff)
downloadspack-0b9914e2f524194167373da72b9685e5e21bfca1.tar.gz
spack-0b9914e2f524194167373da72b9685e5e21bfca1.tar.bz2
spack-0b9914e2f524194167373da72b9685e5e21bfca1.tar.xz
spack-0b9914e2f524194167373da72b9685e5e21bfca1.zip
Fix for license symlinking issue. (#26576)
When a symlink to a license file exists but is broken, the license symlink post-install hook fails because os.path.exists() checks the existence of the target not the symlink itself. os.path.lexists() is the proper function to use.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/hooks/licensing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/hooks/licensing.py b/lib/spack/spack/hooks/licensing.py
index 8e789d9635..739da8bde6 100644
--- a/lib/spack/spack/hooks/licensing.py
+++ b/lib/spack/spack/hooks/licensing.py
@@ -175,7 +175,7 @@ def symlink_license(pkg):
mkdirp(license_dir)
# If example file already exists, overwrite it with a symlink
- if os.path.exists(link_name):
+ if os.path.lexists(link_name):
os.remove(link_name)
if os.path.exists(target):