From 2dd06f14f977fdceb891f0989d0eb64ec5624998 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 7 Jun 2020 10:18:52 -0700 Subject: concretizer: use repository names, not specs with is_virtual --- lib/spack/spack/repo.py | 3 +++ lib/spack/spack/solver/asp.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-60-g2f50