pmbootstrap init: only display UIs for device arch (MR 1937)

Hide user interfaces that are not available for the selected device's
architecture.

Closes #1790
This commit is contained in:
Anjandev Momi 2020-05-14 03:20:11 -07:00 committed by Oliver Smith
parent 2d2ab1df56
commit 0ff9c5d471
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 55 additions and 7 deletions

View file

@ -105,8 +105,9 @@ def ask_for_channel(args):
" from the list above.")
def ask_for_ui(args):
ui_list = pmb.helpers.ui.list(args)
def ask_for_ui(args, device):
info = pmb.parse.deviceinfo(args, device)
ui_list = pmb.helpers.ui.list(args, info["arch"])
logging.info("Available user interfaces (" +
str(len(ui_list) - 1) + "): ")
ui_completion_list = []
@ -419,7 +420,7 @@ def frontend(args):
args.user, False,
"[a-z_][a-z0-9_-]*")
# UI and various build options
ui = ask_for_ui(args)
ui = ask_for_ui(args, device)
cfg["pmbootstrap"]["ui"] = ui
cfg["pmbootstrap"]["ui_extras"] = str(ask_for_ui_extras(args, ui))
ask_for_build_options(args, cfg)