pmb.helpers.ui.check_option: fix for UI = none (MR 2348)

Don't crash on master_staging_systemd (and in the future the merged
systemd branch) if "none" is selected as UI.

Fix for:
  ERROR: Could not find aport for package: postmarketos-ui-none
This commit is contained in:
Oliver Smith 2024-07-04 22:19:51 +02:00
parent 8948594d74
commit a57b338e9e
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -33,6 +33,11 @@ def check_option(ui, option, skip_extra_repos=False):
"""
Check if an option, such as pmb:systemd, is inside an UI's APKBUILD.
"""
if ui == "none":
# Users can select "none" as UI in "pmbootstrap init", which does not
# have a UI package.
return False
pkgname = f"postmarketos-ui-{ui}"
apkbuild = pmb.helpers.pmaports.get(
pkgname, subpackages=False, skip_extra_repos=skip_extra_repos