Fix virtual method.
This commit is contained in:
parent
389fa1792d
commit
2dff2f3341
1 changed files with 9 additions and 2 deletions
|
@ -147,6 +147,7 @@ def constrain(self, other):
|
|||
|
||||
@property
|
||||
def concrete(self):
|
||||
"""A Compiler spec is concrete if its versions are concrete."""
|
||||
return self.versions.concrete
|
||||
|
||||
|
||||
|
@ -318,19 +319,25 @@ def root(self):
|
|||
|
||||
@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)
|
||||
|
|
Loading…
Reference in a new issue