Fixed database to account for hashes when reading install records
This commit is contained in:
parent
9f37e4c907
commit
bc087cfefb
@ -203,6 +203,10 @@ def _read_spec_from_yaml(self, hash_key, installs, parent_key=None):
|
|||||||
|
|
||||||
spec_dict = installs[hash_key]['spec']
|
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.
|
# Build spec from dict first.
|
||||||
spec = Spec.from_node_dict(spec_dict)
|
spec = Spec.from_node_dict(spec_dict)
|
||||||
|
|
||||||
|
@ -755,7 +755,8 @@ def dag_hash(self, length=None):
|
|||||||
"""
|
"""
|
||||||
Return a hash of the entire spec DAG, including connectivity.
|
Return a hash of the entire spec DAG, including connectivity.
|
||||||
"""
|
"""
|
||||||
if self.hash:
|
print self, "++"
|
||||||
|
if getattr(self, 'hash', None):
|
||||||
return self.hash
|
return self.hash
|
||||||
else:
|
else:
|
||||||
yaml_text = yaml.dump(
|
yaml_text = yaml.dump(
|
||||||
@ -787,6 +788,7 @@ def to_node_dict(self):
|
|||||||
else:
|
else:
|
||||||
d['compiler'] = None
|
d['compiler'] = None
|
||||||
d.update(self.versions.to_dict())
|
d.update(self.versions.to_dict())
|
||||||
|
|
||||||
return { self.name : d }
|
return { self.name : d }
|
||||||
|
|
||||||
|
|
||||||
@ -810,6 +812,9 @@ def from_node_dict(node):
|
|||||||
spec.versions = VersionList.from_dict(node)
|
spec.versions = VersionList.from_dict(node)
|
||||||
spec.architecture = node['arch']
|
spec.architecture = node['arch']
|
||||||
|
|
||||||
|
if 'hash' in node:
|
||||||
|
spec.hash = node['hash']
|
||||||
|
|
||||||
if node['compiler'] is None:
|
if node['compiler'] is None:
|
||||||
spec.compiler = None
|
spec.compiler = None
|
||||||
else:
|
else:
|
||||||
@ -2121,6 +2126,8 @@ def spec(self, name, check_valid_token = False):
|
|||||||
if spec_name != '':
|
if spec_name != '':
|
||||||
self.check_identifier(spec_name)
|
self.check_identifier(spec_name)
|
||||||
|
|
||||||
|
print spec_name, "++"
|
||||||
|
|
||||||
# This will init the spec without calling __init__.
|
# This will init the spec without calling __init__.
|
||||||
spec = Spec.__new__(Spec)
|
spec = Spec.__new__(Spec)
|
||||||
spec.name = spec_name
|
spec.name = spec_name
|
||||||
|
Loading…
Reference in New Issue
Block a user