summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/environment.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py
index dbe7318517..23644dabd9 100644
--- a/lib/spack/spack/environment.py
+++ b/lib/spack/spack/environment.py
@@ -1602,7 +1602,22 @@ class Environment(object):
# Dependency-only specs will have value None
matches = {}
+ if not isinstance(spec, spack.spec.Spec):
+ spec = spack.spec.Spec(spec)
+
for user_spec, concretized_user_spec in self.concretized_specs():
+ # Deal with concrete specs differently
+ if spec.concrete:
+ # Matching a concrete spec is more restrictive
+ # than just matching the dag hash
+ is_match = (
+ spec in concretized_user_spec and
+ concretized_user_spec[spec.name].build_hash() == spec.build_hash()
+ )
+ if is_match:
+ matches[spec] = spec
+ continue
+
if concretized_user_spec.satisfies(spec):
matches[concretized_user_spec] = user_spec
for dep_spec in concretized_user_spec.traverse(root=False):