diff options
author | Matthew LeGendre <legendre1@llnl.gov> | 2015-05-29 14:57:24 -0700 |
---|---|---|
committer | Matthew LeGendre <legendre1@llnl.gov> | 2015-10-05 11:36:06 -0700 |
commit | ee68a76a193890231d6df7fa7934d42e3708540b (patch) | |
tree | e9d47f1f5ca13fbf60e30129f3bb5c2d9034b4cd | |
parent | 8d7b7e5d5dadcec9b997b94d95898a4134e122b2 (diff) | |
download | spack-ee68a76a193890231d6df7fa7934d42e3708540b.tar.gz spack-ee68a76a193890231d6df7fa7934d42e3708540b.tar.bz2 spack-ee68a76a193890231d6df7fa7934d42e3708540b.tar.xz spack-ee68a76a193890231d6df7fa7934d42e3708540b.zip |
Bug fixes from testing spack preferred packages
-rw-r--r-- | lib/spack/spack/preferred_packages.py | 7 | ||||
-rw-r--r-- | var/spack/mock_packages/mpich/package.py | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index 248508fe80..bc5271f693 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -112,9 +112,8 @@ class PreferredPackages(object): elif a_index == None and b_index != None: return 1 elif a_index != None and b_index == a_index: return -1 * cmp(a, b) elif a_index != None and b_index != None and a_index != b_index: return cmp(a_index, b_index) - elif a < b: return 1 * reverse - elif b < a: return -1 * reverse - else: return 0 + else: return cmp(a, b) * reverse + # Given a sort order specified by the pkgname/component/second_key, return @@ -148,7 +147,7 @@ class PreferredPackages(object): """Return less-than-0, 0, or greater than 0 if version a of pkgname is respecively less-than, equal-to, or greater-than version b of pkgname. One version is less-than another if it is preferred over the other.""" - return self._spec_compare(pkgname, 'version', a, b, False, None) + return self._spec_compare(pkgname, 'version', a, b, True, None) def variant_compare(self, pkgname, a, b): diff --git a/var/spack/mock_packages/mpich/package.py b/var/spack/mock_packages/mpich/package.py index f77d3efc5d..e4110ad530 100644 --- a/var/spack/mock_packages/mpich/package.py +++ b/var/spack/mock_packages/mpich/package.py @@ -38,6 +38,7 @@ class Mpich(Package): version('3.0.2', 'foobarbaz') version('3.0.1', 'foobarbaz') version('3.0', 'foobarbaz') + version('1.0', 'foobarbas') provides('mpi@:3', when='@3:') provides('mpi@:1', when='@:1') |