summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-06-07 10:18:52 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit2dd06f14f977fdceb891f0989d0eb64ec5624998 (patch)
tree3a56541382dd652eb856ff15093441609f567cca
parentac9405a80ebc60101ca099ffb3041f5ce9cf6720 (diff)
downloadspack-2dd06f14f977fdceb891f0989d0eb64ec5624998.tar.gz
spack-2dd06f14f977fdceb891f0989d0eb64ec5624998.tar.bz2
spack-2dd06f14f977fdceb891f0989d0eb64ec5624998.tar.xz
spack-2dd06f14f977fdceb891f0989d0eb64ec5624998.zip
concretizer: use repository names, not specs with is_virtual
-rw-r--r--lib/spack/spack/repo.py3
-rw-r--r--lib/spack/spack/solver/asp.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py
index 484034bb06..5e1457c165 100644
--- a/lib/spack/spack/repo.py
+++ b/lib/spack/spack/repo.py
@@ -681,6 +681,9 @@ class RepoPath(object):
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):
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 6952126921..f1d2b40b60 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -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)