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.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 1579c5c011..8336a6f8a0 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1431,7 +1431,7 @@ class Spec(object):
return self._full_hash[:length]
- def to_node_dict(self, hash_function=None):
+ def to_node_dict(self, hash_function=None, all_deps=False):
d = syaml_dict()
if self.versions:
@@ -1464,7 +1464,11 @@ class Spec(object):
# TODO: restore build dependencies here once we have less picky
# TODO: concretization.
- deps = self.dependencies_dict(deptype=('link', 'run'))
+ if all_deps:
+ deptypes = ('link', 'run', 'build')
+ else:
+ deptypes = ('link', 'run')
+ deps = self.dependencies_dict(deptype=deptypes)
if deps:
if hash_function is None:
hash_function = lambda s: s.dag_hash()
@@ -1478,10 +1482,14 @@ class Spec(object):
return syaml_dict([(self.name, d)])
- def to_dict(self):
+ def to_dict(self, all_deps=False):
+ if all_deps:
+ deptypes = ('link', 'run', 'build')
+ else:
+ deptypes = ('link', 'run')
node_list = []
- for s in self.traverse(order='pre', deptype=('link', 'run')):
- node = s.to_node_dict()
+ for s in self.traverse(order='pre', deptype=deptypes):
+ node = s.to_node_dict(all_deps=all_deps)
node[s.name]['hash'] = s.dag_hash()
node_list.append(node)