summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/database.py4
-rw-r--r--lib/spack/spack/directory_layout.py4
-rw-r--r--lib/spack/spack/spec.py13
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):