summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-05-30 22:02:22 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-05-30 22:02:22 -0700
commit24ee32d7b0cb209f8a17f6df7e8715fa508d0f5d (patch)
tree1d3734a24ef69183d536b2e0216a9bc8934bd981
parentf3f0122f116636ee16ba3cdf4301b1b881a2985f (diff)
downloadspack-24ee32d7b0cb209f8a17f6df7e8715fa508d0f5d.tar.gz
spack-24ee32d7b0cb209f8a17f6df7e8715fa508d0f5d.tar.bz2
spack-24ee32d7b0cb209f8a17f6df7e8715fa508d0f5d.tar.xz
spack-24ee32d7b0cb209f8a17f6df7e8715fa508d0f5d.zip
More flexible reading of specs from DB, formatting.
-rw-r--r--lib/spack/spack/database.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index e768ddf5fe..38bb7541e0 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -214,9 +214,10 @@ class Database(object):
# Add dependencies from other records in the install DB to
# form a full spec.
- for dep_hash in spec_dict[spec.name]['dependencies'].values():
- child = self._read_spec_from_yaml(dep_hash, installs, hash_key)
- spec._add_dependency(child)
+ if 'dependencies' in spec_dict[spec.name]:
+ for dep_hash in spec_dict[spec.name]['dependencies'].values():
+ child = self._read_spec_from_yaml(dep_hash, installs, hash_key)
+ spec._add_dependency(child)
# Specs from the database need to be marked concrete because
# they represent actual installations.
@@ -289,7 +290,8 @@ class Database(object):
except Exception as e:
tty.warn("Invalid database reecord:",
"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
self._data = data