summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-06-24 12:33:53 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-06-24 12:33:53 -0700
commit055f7f4ab61603dfd8634319a919b5a0daba06bc (patch)
tree72e5abb24b875fc9f338463ecd7cfb651c4b6d47 /lib
parent65e3ac41324adfaf5f761d4d543f29588d108adf (diff)
downloadspack-055f7f4ab61603dfd8634319a919b5a0daba06bc.tar.gz
spack-055f7f4ab61603dfd8634319a919b5a0daba06bc.tar.bz2
spack-055f7f4ab61603dfd8634319a919b5a0daba06bc.tar.xz
spack-055f7f4ab61603dfd8634319a919b5a0daba06bc.zip
Add package_dir method to `package.py`.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 98fd51b262..6a61b3d52b 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -398,6 +398,12 @@ class Package(object):
spack.repo.get(self.extendee_spec)._check_extendable()
@property
+ def package_dir(self):
+ """Return the directory where the package.py file lives."""
+ return os.path.dirname(self.module.__file__)
+
+
+ @property
def global_license_dir(self):
"""Returns the directory where global license files for all
packages are stored."""
@@ -687,7 +693,7 @@ class Package(object):
"""Get the spack.compiler.Compiler object used to build this package"""
if not self.spec.concrete:
raise ValueError("Can only get a compiler for a concrete package.")
- return spack.compilers.compiler_for_spec(self.spec.compiler,
+ return spack.compilers.compiler_for_spec(self.spec.compiler,
self.spec.architecture)
def url_version(self, version):