summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Becker <becker33@llnl.gov>2016-05-06 12:28:46 -0700
committerGregory Becker <becker33@llnl.gov>2016-05-06 12:28:46 -0700
commitbc087cfefbfa4d11e726d61fea1b85e6bace9f77 (patch)
tree76328d2ecd84ad23d46d28a84e90ea7fe7c9d316 /lib
parent9f37e4c907782ae44121a8d1c988a463df80f621 (diff)
downloadspack-bc087cfefbfa4d11e726d61fea1b85e6bace9f77.tar.gz
spack-bc087cfefbfa4d11e726d61fea1b85e6bace9f77.tar.bz2
spack-bc087cfefbfa4d11e726d61fea1b85e6bace9f77.tar.xz
spack-bc087cfefbfa4d11e726d61fea1b85e6bace9f77.zip
Fixed database to account for hashes when reading install records
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/database.py4
-rw-r--r--lib/spack/spack/spec.py9
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index 25f4f69a89..9b7c944bc9 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -203,6 +203,10 @@ class Database(object):
spec_dict = installs[hash_key]['spec']
+ # Install records don't include hash with spec, so we add it in here
+ # to ensure it is read properly.
+ spec_dict['hash'] = hash_key
+
# Build spec from dict first.
spec = Spec.from_node_dict(spec_dict)
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index b604420140..93befbec33 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -755,7 +755,8 @@ class Spec(object):
"""
Return a hash of the entire spec DAG, including connectivity.
"""
- if self.hash:
+ print self, "++"
+ if getattr(self, 'hash', None):
return self.hash
else:
yaml_text = yaml.dump(
@@ -787,6 +788,7 @@ class Spec(object):
else:
d['compiler'] = None
d.update(self.versions.to_dict())
+
return { self.name : d }
@@ -810,6 +812,9 @@ class Spec(object):
spec.versions = VersionList.from_dict(node)
spec.architecture = node['arch']
+ if 'hash' in node:
+ spec.hash = node['hash']
+
if node['compiler'] is None:
spec.compiler = None
else:
@@ -2121,6 +2126,8 @@ class SpecParser(spack.parse.Parser):
if spec_name != '':
self.check_identifier(spec_name)
+ print spec_name, "++"
+
# This will init the spec without calling __init__.
spec = Spec.__new__(Spec)
spec.name = spec_name