summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2020-12-07 14:45:42 -0800
committerTamara Dahlgren <dahlgren1@llnl.gov>2021-02-17 17:07:24 -0800
commit30a9e6462f73aa0a50a9f1455dca3f3657cd9d8e (patch)
tree87023b5d4a5b053317f4bf613f8076be5be9d846 /lib
parent0e725f0ab18d1bc064d42111e3be3e8e27a5850e (diff)
downloadspack-30a9e6462f73aa0a50a9f1455dca3f3657cd9d8e.tar.gz
spack-30a9e6462f73aa0a50a9f1455dca3f3657cd9d8e.tar.bz2
spack-30a9e6462f73aa0a50a9f1455dca3f3657cd9d8e.tar.xz
spack-30a9e6462f73aa0a50a9f1455dca3f3657cd9d8e.zip
bugfix: work around issue handling packages not in any repo
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/asp.py4
-rw-r--r--lib/spack/spack/util/mock_package.py3
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index bf64efa3ec..13bcfd2e91 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1028,6 +1028,10 @@ class SpackSolverSetup(object):
if pkg_name == 'all':
continue
+ # This package does not appear in any repository
+ if pkg_name not in spack.repo.path:
+ continue
+
if 'externals' not in data:
self.gen.fact(fn.external(pkg_name).symbol(positive=False))
diff --git a/lib/spack/spack/util/mock_package.py b/lib/spack/spack/util/mock_package.py
index 4751f5af7e..5286b50464 100644
--- a/lib/spack/spack/util/mock_package.py
+++ b/lib/spack/spack/util/mock_package.py
@@ -102,6 +102,9 @@ class MockPackageMultiRepo(object):
Repo = collections.namedtuple('Repo', ['namespace'])
return Repo('mockrepo')
+ def __contains__(self, item):
+ return item in self.spec_to_pkg
+
def add_package(self, name, dependencies=None, dependency_types=None,
conditions=None):
"""Factory method for creating mock packages.