feature(keyringctl): sort list command for alphabetical listing

Only do so when listing all keys, when a filter is provided, like
usernames or fingerprints, keep the order to allow a 1:1 mapping.
This commit is contained in:
Levente Polyak 2021-10-23 16:07:34 +02:00
parent f3f3a63385
commit 02605edee5
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8

View File

@ -1102,7 +1102,7 @@ def list_keyring(keyring_root: Path, sources: Optional[List[Path]] = None, main_
keyring_dir = keyring_root / ("main" if main_keys else "packager")
if not sources:
sources = list(keyring_dir.iterdir())
sources = list(sorted(keyring_dir.iterdir(), key=lambda path: path.name.casefold()))
# resolve shorthand username exports for packager keys
for index, source in enumerate(sources):