bugfix: sort variants in spack info --variants-by-name
(#41389)
This was missed while backporting the new `spack info` command from #40326. Variants should be sorted by name when invoking `spack info --variants-by-name`.
This commit is contained in:
parent
de2249c334
commit
e29049d9c0
1 changed files with 1 additions and 1 deletions
|
@ -327,7 +327,7 @@ def _variants_by_name_when(pkg):
|
||||||
"""Adaptor to get variants keyed by { name: { when: { [Variant...] } }."""
|
"""Adaptor to get variants keyed by { name: { when: { [Variant...] } }."""
|
||||||
# TODO: replace with pkg.variants_by_name(when=True) when unified directive dicts are merged.
|
# TODO: replace with pkg.variants_by_name(when=True) when unified directive dicts are merged.
|
||||||
variants = {}
|
variants = {}
|
||||||
for name, (variant, whens) in pkg.variants.items():
|
for name, (variant, whens) in sorted(pkg.variants.items()):
|
||||||
for when in whens:
|
for when in whens:
|
||||||
variants.setdefault(name, {}).setdefault(when, []).append(variant)
|
variants.setdefault(name, {}).setdefault(when, []).append(variant)
|
||||||
return variants
|
return variants
|
||||||
|
|
Loading…
Reference in a new issue