addressed PR#946 comments from @adamjstewart

This commit is contained in:
Gregory L. Lee
2016-05-13 15:16:07 -07:00
parent b8a91db089
commit e9b71872a8
5 changed files with 24 additions and 39 deletions

View File

@@ -154,7 +154,7 @@ def symlink_license(pkg):
target = pkg.global_license_file
for filename in pkg.license_files:
link_name = join_path(pkg.prefix, filename)
license_dir = os.path.split(link_name)[0]
license_dir = os.path.dirname(link_name)
if not os.path.exists(license_dir):
mkdirp(license_dir)
if os.path.exists(target):

View File

@@ -399,13 +399,15 @@ def __init__(self, spec):
@property
def global_license_dir(self):
"""Returns the path where a global license file should be stored."""
"""Returns the directory where global license files for all
packages are stored."""
spack_root = ancestor(__file__, 4)
return join_path(spack_root, 'etc', 'spack', 'licenses')
@property
def global_license_file(self):
"""Returns the path where a global license file should be stored."""
"""Returns the path where a global license file for this
particular package should be stored."""
if not self.license_files:
return
return join_path(self.global_license_dir, self.name,