concretizer: use repository names, not specs with is_virtual

This commit is contained in:
Todd Gamblin 2020-06-07 10:18:52 -07:00
parent ac9405a80e
commit 2dd06f14f9
2 changed files with 4 additions and 1 deletions

View file

@ -681,6 +681,9 @@ def exists(self, pkg_name):
def is_virtual(self, pkg_name):
"""True if the package with this name is virtual, False otherwise."""
if not isinstance(pkg_name, str):
raise ValueError(
"is_virtual(): expected package name, got %s" % type(pkg_name))
return pkg_name in self.provider_index
def __contains__(self, pkg_name):

View file

@ -189,7 +189,7 @@ def check_packages_exist(specs):
repo = spack.repo.path
for spec in specs:
for s in spec.traverse():
if not (repo.exists(s.name) or repo.is_virtual(s)):
if not (repo.exists(s.name) or repo.is_virtual(s.name)):
raise spack.repo.UnknownPackageError(s.name)