summaryrefslogtreecommitdiff
path: root/lib/spack/spack/spec.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/spec.py')
-rw-r--r--lib/spack/spack/spec.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 33ca196ad9..cd12a46b60 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -3198,7 +3198,7 @@ class Spec(object):
fmt = kwargs.pop('format', '$_$@$%@+$+$=')
prefix = kwargs.pop('prefix', None)
show_types = kwargs.pop('show_types', False)
- deptypes = kwargs.pop('deptypes', ('build', 'link'))
+ deptypes = kwargs.pop('deptypes', 'all')
check_kwargs(kwargs, self.tree)
out = ""
@@ -3226,12 +3226,21 @@ class Spec(object):
out += colorize('@K{%s} ', color=color) % node.dag_hash(hlen)
if show_types:
+ types = set()
+ if cover == 'nodes':
+ # when only covering nodes, we merge dependency types
+ # from all dependents before showing them.
+ for name, ds in node.dependents_dict().items():
+ if ds.deptypes:
+ types.update(set(ds.deptypes))
+ elif dep_spec.deptypes:
+ # when covering edges or paths, we show dependency
+ # types only for the edge through which we visited
+ types = set(dep_spec.deptypes)
+
out += '['
- if dep_spec.deptypes:
- for t in all_deptypes:
- out += ''.join(t[0] if t in dep_spec.deptypes else ' ')
- else:
- out += ' ' * len(all_deptypes)
+ for t in all_deptypes:
+ out += ''.join(t[0] if t in types else ' ')
out += '] '
out += (" " * d)