summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2013-11-23 13:43:59 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2013-11-23 13:43:59 -0800
commit2dff2f3341b8342906497ba2855e744d5f8a37f5 (patch)
tree8b5eca1a70e0650ea270eb2e7a6b3b81dff07124 /lib
parent389fa1792d8f0ac7945b80620c386f2d614a7921 (diff)
downloadspack-2dff2f3341b8342906497ba2855e744d5f8a37f5.tar.gz
spack-2dff2f3341b8342906497ba2855e744d5f8a37f5.tar.bz2
spack-2dff2f3341b8342906497ba2855e744d5f8a37f5.tar.xz
spack-2dff2f3341b8342906497ba2855e744d5f8a37f5.zip
Fix virtual method.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 31c504d4ca..6d8742c73a 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -147,6 +147,7 @@ class Compiler(object):
@property
def concrete(self):
+ """A Compiler spec is concrete if its versions are concrete."""
return self.versions.concrete
@@ -318,19 +319,25 @@ class Spec(object):
@property
def package(self):
+ if self.virtual:
+ raise TypeError("Cannot get package for virtual spec '" +
+ self.name + "'")
return packages.get(self.name)
@property
def virtual(self):
- return packages.exists(self.name)
+ """Right now, a spec is virtual if no package exists with its name.
+ TODO: revisit this -- might need to use a separate namespace and
+ be more explicit about this.
+ """
+ return not packages.exists(self.name)
@property
def concrete(self):
return bool(not self.virtual
and self.versions.concrete
- # TODO: support variants
and self.architecture
and self.compiler and self.compiler.concrete
and self.dependencies.concrete)