summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew LeGendre <legendre1@llnl.gov>2016-10-21 11:59:41 -0700
committerMatthew LeGendre <legendre1@llnl.gov>2016-10-21 11:59:41 -0700
commit73b46a92bcf0a415d5b4a3b29ca47df0d0544076 (patch)
treead0080dc3b96caef2bf53781d70c9e21e89edec0
parent9f36ae4e2072f94d7a3bdec5baa6ebebac15375f (diff)
downloadspack-73b46a92bcf0a415d5b4a3b29ca47df0d0544076.tar.gz
spack-73b46a92bcf0a415d5b4a3b29ca47df0d0544076.tar.bz2
spack-73b46a92bcf0a415d5b4a3b29ca47df0d0544076.tar.xz
spack-73b46a92bcf0a415d5b4a3b29ca47df0d0544076.zip
Fix concretize bug where provider sort couldn't handle version ranges
-rw-r--r--lib/spack/spack/concretize.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 9c9e9e10ff..3da5efc9fa 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -95,7 +95,11 @@ class DefaultConcretizer(object):
not b.external and b.external_module):
# We're choosing between different providers, so
# maintain order from provider sort
- return candidates.index(a) - candidates.index(b)
+ index_of_a = next(i for i in range(0, len(candidates)) \
+ if a.satisfies(candidates[i]))
+ index_of_b = next(i for i in range(0, len(candidates)) \
+ if b.satisfies(candidates[i]))
+ return index_of_a - index_of_b
result = cmp_specs(a, b)
if result != 0: