More flexible reading of specs from DB, formatting.

This commit is contained in:
Todd Gamblin 2016-05-30 22:02:22 -07:00
parent f3f0122f11
commit 24ee32d7b0

View File

@ -214,6 +214,7 @@ def _read_spec_from_yaml(self, hash_key, installs, parent_key=None):
# Add dependencies from other records in the install DB to # Add dependencies from other records in the install DB to
# form a full spec. # form a full spec.
if 'dependencies' in spec_dict[spec.name]:
for dep_hash in spec_dict[spec.name]['dependencies'].values(): for dep_hash in spec_dict[spec.name]['dependencies'].values():
child = self._read_spec_from_yaml(dep_hash, installs, hash_key) child = self._read_spec_from_yaml(dep_hash, installs, hash_key)
spec._add_dependency(child) spec._add_dependency(child)
@ -289,7 +290,8 @@ def check(cond, msg):
except Exception as e: except Exception as e:
tty.warn("Invalid database reecord:", tty.warn("Invalid database reecord:",
"file: %s" % self._index_path, "file: %s" % self._index_path,
"hash: %s" % hash_key, "cause: %s" % str(e)) "hash: %s" % hash_key,
"cause: %s: %s" % (type(e).__name__, str(e)))
raise raise
self._data = data self._data = data