summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2016-05-17 15:13:28 -0400
committerErik Schnetter <schnetter@gmail.com>2016-05-17 15:13:28 -0400
commitfcc4c1b2f20fd1e19f7443923f779ef4e5b9c5d0 (patch)
tree82bc9ded6a8e85f142177d0509b4967110ddeba1
parent1774c7a7b38fa60eaf30aa9d5cef5a6a18b8c55d (diff)
downloadspack-fcc4c1b2f20fd1e19f7443923f779ef4e5b9c5d0.tar.gz
spack-fcc4c1b2f20fd1e19f7443923f779ef4e5b9c5d0.tar.bz2
spack-fcc4c1b2f20fd1e19f7443923f779ef4e5b9c5d0.tar.xz
spack-fcc4c1b2f20fd1e19f7443923f779ef4e5b9c5d0.zip
Remove duplicate providers that can concretize to the same result
Patch generously provided by @becker33. Closes #928.
-rw-r--r--lib/spack/spack/spec.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 89a023a750..470353c4f6 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1071,6 +1071,11 @@ class Spec(object):
# If there is a provider for the vpkg, then use that instead of
# the virtual package.
if providers:
+ # Remove duplicate providers that can concretize to the same result.
+ for provider in providers:
+ for spec in providers:
+ if spec is not provider and provider.satisfies(spec):
+ providers.remove(spec)
# Can't have multiple providers for the same thing in one spec.
if len(providers) > 1:
raise MultipleProviderError(vdep, providers)