diff options
author | Michael Kuhn <suraia@ikkoku.de> | 2016-07-12 19:54:44 +0200 |
---|---|---|
committer | Michael Kuhn <suraia@ikkoku.de> | 2016-07-12 19:57:08 +0200 |
commit | b7d9b58cc5de8a36d43cc082cac0e1ccb6e05f74 (patch) | |
tree | c426342a91bbdba24c425dc8baeaae20fbadcf52 /lib | |
parent | 069de3f00897b0108243539730c00a83ecb55f09 (diff) | |
download | spack-b7d9b58cc5de8a36d43cc082cac0e1ccb6e05f74.tar.gz spack-b7d9b58cc5de8a36d43cc082cac0e1ccb6e05f74.tar.bz2 spack-b7d9b58cc5de8a36d43cc082cac0e1ccb6e05f74.tar.xz spack-b7d9b58cc5de8a36d43cc082cac0e1ccb6e05f74.zip |
Fix preferred providers.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/preferred_packages.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index 4820584150..e873fa3c7e 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -41,7 +41,7 @@ class PreferredPackages(object): pkglist.append('all') for pkg in pkglist: order = self.preferred.get(pkg, {}).get(component, {}) - if type(order) is dict: + if isinstance(order, dict) and second_key: order = order.get(second_key, {}) if not order: continue @@ -89,9 +89,9 @@ class PreferredPackages(object): # a and b are considered to match entries in the sorting list if they # satisfy the list component. def _spec_compare(self, pkgname, component, a, b, reverse_natural_compare, second_key): - if not a or not a.concrete: + if not a or (not a.concrete and not second_key): return -1 - if not b or not b.concrete: + if not b or (not b.concrete and not second_key): return 1 specs = self._spec_for_pkgname(pkgname, component, second_key) a_index = None |