summaryrefslogtreecommitdiff
path: root/lib/spack/spack/spec.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/spec.py')
-rw-r--r--lib/spack/spack/spec.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 127091d8da..8a4fc12861 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -2372,11 +2372,10 @@ class Spec(object):
patches = []
for cond, dependency in pkg_deps[dspec.spec.name].items():
- if dspec.parent.satisfies(cond, strict=True):
- for pcond, patch_list in dependency.patches.items():
- if dspec.spec.satisfies(pcond):
- for patch in patch_list:
- patches.append(patch)
+ for pcond, patch_list in dependency.patches.items():
+ if (dspec.parent.satisfies(cond, strict=True)
+ and dspec.spec.satisfies(pcond)):
+ patches.extend(patch_list)
if patches:
all_patches = spec_to_patches.setdefault(id(dspec.spec), [])
all_patches.extend(patches)