diff options
author | Gregory Lee <lee218@llnl.gov> | 2015-12-16 11:37:51 -0800 |
---|---|---|
committer | Gregory Lee <lee218@llnl.gov> | 2015-12-16 11:37:51 -0800 |
commit | 9cab88071bd0de9703ace476c13ab926c16d338b (patch) | |
tree | 0f4cf8877ff2baae09081409cd2ac21c3f85383c | |
parent | 9ac4c730fb1f21db17fda22bd2bb575738ed46db (diff) | |
parent | 2f9ee884087005d90a9d63d29667cca1634fafca (diff) | |
download | spack-9cab88071bd0de9703ace476c13ab926c16d338b.tar.gz spack-9cab88071bd0de9703ace476c13ab926c16d338b.tar.bz2 spack-9cab88071bd0de9703ace476c13ab926c16d338b.tar.xz spack-9cab88071bd0de9703ace476c13ab926c16d338b.zip |
Merge pull request #239 from LLNL/bugfix/238-db-specs-not-concrete
Fix #238: Database specs need to be concrete when read in as well.
-rw-r--r-- | lib/spack/spack/database.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/directory_layout.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/spec.py | 13 |
3 files changed, 17 insertions, 4 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index d62a47547d..bf54055a24 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -211,6 +211,10 @@ class Database(object): 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. + spec._mark_concrete() + return spec diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index a434dad5c4..d91fbe9f4e 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -212,9 +212,7 @@ class YamlDirectoryLayout(DirectoryLayout): spec = Spec.from_yaml(f) # Specs read from actual installations are always concrete - for s in spec.traverse(): - s._normal = True - s._concrete = True + spec._mark_concrete() return spec diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index fb5ea5d02b..037ec97a5e 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -833,7 +833,18 @@ class Spec(object): changed = any(changes) force=True - self._concrete = True + self._mark_concrete() + + + def _mark_concrete(self): + """Mark this spec and its dependencies as concrete. + + Only for internal use -- client code should use "concretize" + unless there is a need to force a spec to be concrete. + """ + for s in self.traverse(): + s._normal = True + s._concrete = True def concretized(self): |