Fix broken spack info command after build dep merge.

- Added a method to get dependencies of particular types from Package
- Fixed info command.
This commit is contained in:
Todd Gamblin 2016-07-15 16:01:01 -07:00
parent cdc2ebee90
commit 73f10c9363
2 changed files with 8 additions and 1 deletions

View file

@ -84,7 +84,7 @@ def print_text_info(pkg):
for deptype in ('build', 'link', 'run'): for deptype in ('build', 'link', 'run'):
print print
print "%s Dependencies:" % deptype.capitalize() print "%s Dependencies:" % deptype.capitalize()
deps = pkg.dependencies(deptype) deps = pkg.dependencies_of_type(deptype)
if deps: if deps:
colify(deps, indent=4) colify(deps, indent=4)
else: else:

View file

@ -565,6 +565,13 @@ def fetcher(self):
def fetcher(self, f): def fetcher(self, f):
self._fetcher = f self._fetcher = f
def dependencies_of_type(self, *deptypes):
"""Get subset of the dependencies with certain types."""
return dict((name, conds) for name, conds in self.dependencies.items()
if any(d in self._deptypes[name] for d in deptypes))
@property @property
def extendee_spec(self): def extendee_spec(self):
""" """