bugfix: work around issue handling packages not in any repo

This commit is contained in:
Massimiliano Culpo 2020-12-07 14:45:42 -08:00 committed by Todd Gamblin
parent 1343a815c0
commit 98c2627132
2 changed files with 7 additions and 0 deletions

View file

@ -1028,6 +1028,10 @@ def external_packages(self):
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))

View file

@ -102,6 +102,9 @@ def repo_for_pkg(self, name):
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.