pmb.config: only show first 3 releases

Currently we're already showing a long list of unsupported releases,
which should not really be used by any user. Hide them by just showing
the first 3 releases in the list which avoids adding complicated custom
logic to e.g. channels.cfg.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230607205714.84945-1-luca@z3ntu.xyz%3E
This commit is contained in:
Luca Weiss 2023-06-07 22:57:14 +02:00 committed by Oliver Smith
parent 50ccaae76b
commit 374d7779e9
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 4 additions and 1 deletions

View File

@ -110,7 +110,10 @@ def ask_for_channel(args):
# List channels
logging.info("Choose the postmarketOS release channel.")
logging.info(f"Available ({count}):")
for channel, channel_data in channels_cfg["channels"].items():
# Only show the first 3 releases. This includes edge, the latest supported
# release plus one. Should be a good solution until new needs arrive when
# we might want to have a custom channels.cfg attribute.
for channel, channel_data in list(channels_cfg["channels"].items())[:3]:
logging.info(f"* {channel}: {channel_data['description']}")
# Default for first run: "recommended" from channels.cfg