Merge pull request #946 from LLNL/features/intel2
Intel software packages and license enhancements
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
import spack
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import join_path
|
||||
from llnl.util.filesystem import join_path, mkdirp
|
||||
|
||||
|
||||
def pre_install(pkg):
|
||||
@@ -154,6 +154,9 @@ 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.dirname(link_name)
|
||||
if not os.path.exists(license_dir):
|
||||
mkdirp(license_dir)
|
||||
if os.path.exists(target):
|
||||
os.symlink(target, link_name)
|
||||
tty.msg("Added local symlink %s to global license file" %
|
||||
|
@@ -397,14 +397,20 @@ def __init__(self, spec):
|
||||
if self.is_extension:
|
||||
spack.repo.get(self.extendee_spec)._check_extendable()
|
||||
|
||||
@property
|
||||
def global_license_dir(self):
|
||||
"""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
|
||||
spack_root = ancestor(__file__, 4)
|
||||
global_license_dir = join_path(spack_root, 'etc', 'spack', 'licenses')
|
||||
return join_path(global_license_dir, self.name,
|
||||
return join_path(self.global_license_dir, self.name,
|
||||
os.path.basename(self.license_files[0]))
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user