Bugfix: allow deactivating installs that don't have packages anymore. (#3572)

- deactivate -a wouldn't work if the installation's package was no longer
  available.

- Fix installed_extensions_for so that it doesn't need to look at the
  package.py file.
This commit is contained in:
Todd Gamblin 2017-03-28 08:43:15 -07:00 committed by GitHub
parent d9ddf2070c
commit e549daa8ce

View file

@ -619,13 +619,12 @@ def installed_extensions_for(self, extendee_spec):
Return the specs of all packages that extend
the given spec
"""
for s in self.query():
for spec in self.query():
try:
if s.package.extends(extendee_spec):
yield s.package
except spack.repository.UnknownPackageError:
spack.store.layout.check_activated(extendee_spec, spec)
yield spec.package
except spack.directory_layout.NoSuchExtensionError:
continue
# skips unknown packages
# TODO: conditional way to do this instead of catching exceptions
def query(self, query_spec=any, known=any, installed=True, explicit=any):