pmbootstrap-meow/pmb/config/other.py
Oliver Smith de5e4c6962
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.
2024-03-12 23:53:47 +00:00

16 lines
514 B
Python

# 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":
return True
if args.systemd == "never":
return False
return pmb.helpers.ui.check_option(args, args.ui, "pmb:systemd")