is_systemd_selected: check for branch support (MR 2273)

Don't attempt to install postmarketos-base-systemd if the current branch
doesn't have a systemd section in pmaports.cfg.
This commit is contained in:
Oliver Smith 2024-03-10 20:23:30 +01:00
parent bfc64d1cb8
commit de5e4c6962
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 4 additions and 3 deletions

View File

@ -1,9 +1,12 @@
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import pmb.helpers.ui
import pmb.config.pmaports
def is_systemd_selected(args):
if "systemd" not in pmb.config.pmaports.read_config_repos(args):
return False
if pmb.helpers.ui.check_option(args, args.ui, "pmb:systemd-never"):
return False
if args.systemd == "always":

View File

@ -178,9 +178,7 @@ def require_bootstrap(args, arch, trigger_str):
:param arch: for which architecture
:param trigger_str: message for the user to understand what caused this
"""
cfg = pmb.config.pmaports.read_config_repos(args)
if "systemd" in cfg and pmb.config.other.is_systemd_selected(args):
if pmb.config.other.is_systemd_selected(args):
pkg = pmb.parse.apkindex.package(args, "postmarketos-base-systemd",
arch, False)
if not pkg: