diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2016-04-19 12:28:50 -0500 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2016-05-11 11:32:08 -0500 |
commit | 8bcb812529eb62f1afad089dda02ea6cf6eb01cf (patch) | |
tree | 179840eba5b180f9937136d3c9dfc44870993c08 /lib | |
parent | 2a11cb8b7606721d0cbe2763eca680dcef328acd (diff) | |
download | spack-8bcb812529eb62f1afad089dda02ea6cf6eb01cf.tar.gz spack-8bcb812529eb62f1afad089dda02ea6cf6eb01cf.tar.bz2 spack-8bcb812529eb62f1afad089dda02ea6cf6eb01cf.tar.xz spack-8bcb812529eb62f1afad089dda02ea6cf6eb01cf.zip |
Allow multiple license symlinks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/package.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 3feec90ddb..504e1fc3bb 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1029,13 +1029,6 @@ class Package(object): os.path.basename(self.license_files[0])) - def local_license_symlink(self): - """Returns the path where a local license file is searched for.""" - if not self.license_files: - return - return join_path(self.prefix, self.license_files[0]) - - def set_up_license(self): """Prompt the user, letting them know that a license is required.""" @@ -1086,9 +1079,9 @@ class Package(object): license.write("""\ {0} A license is required to use {1}. {0} -{0} The recommended solution is to store your license key in this file. -{0} By default, {1} searches the following file(s) for a license key -{0} (relative to the installation prefix): +{0} The recommended solution is to store your license key in this global +{0} license file. After installation, the following symlink(s) will be +{0} added to point to this file (relative to the installation prefix): {0} """.format(comment, self.name)) @@ -1135,12 +1128,13 @@ class Package(object): def symlink_license(self): - """Create a local symlink that points to the global license file.""" - target = self.global_license_file() - link_name = self.local_license_symlink() - if os.path.exists(target): - os.symlink(target, link_name) - tty.msg("Added local symlink %s to global license file" % link_name) + """Create local symlinks that point to the global license file.""" + target = self.global_license_file() + for filename in self.license_files: + link_name = join_path(self.prefix, filename) + if os.path.exists(target): + os.symlink(target, link_name) + tty.msg("Added local symlink %s to global license file" % link_name) def do_install_dependencies(self, **kwargs): |