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:
parent
bfc64d1cb8
commit
de5e4c6962
|
@ -1,9 +1,12 @@
|
||||||
# Copyright 2024 Oliver Smith
|
# Copyright 2024 Oliver Smith
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
import pmb.helpers.ui
|
import pmb.helpers.ui
|
||||||
|
import pmb.config.pmaports
|
||||||
|
|
||||||
|
|
||||||
def is_systemd_selected(args):
|
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"):
|
if pmb.helpers.ui.check_option(args, args.ui, "pmb:systemd-never"):
|
||||||
return False
|
return False
|
||||||
if args.systemd == "always":
|
if args.systemd == "always":
|
||||||
|
|
|
@ -178,9 +178,7 @@ def require_bootstrap(args, arch, trigger_str):
|
||||||
:param arch: for which architecture
|
:param arch: for which architecture
|
||||||
:param trigger_str: message for the user to understand what caused this
|
:param trigger_str: message for the user to understand what caused this
|
||||||
"""
|
"""
|
||||||
cfg = pmb.config.pmaports.read_config_repos(args)
|
if pmb.config.other.is_systemd_selected(args):
|
||||||
|
|
||||||
if "systemd" in cfg and pmb.config.other.is_systemd_selected(args):
|
|
||||||
pkg = pmb.parse.apkindex.package(args, "postmarketos-base-systemd",
|
pkg = pmb.parse.apkindex.package(args, "postmarketos-base-systemd",
|
||||||
arch, False)
|
arch, False)
|
||||||
if not pkg:
|
if not pkg:
|
||||||
|
|
Loading…
Reference in New Issue