From 374d7779e96863e076bb543d95f9e02a97fb080c Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Wed, 7 Jun 2023 22:57:14 +0200 Subject: [PATCH] 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 Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230607205714.84945-1-luca@z3ntu.xyz%3E --- pmb/config/init.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pmb/config/init.py b/pmb/config/init.py index face8e56..9dad6bf8 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -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