From de5e4c6962f389fb139ca088f0030b170084aae5 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 10 Mar 2024 20:23:30 +0100 Subject: [PATCH] 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. --- pmb/config/other.py | 3 +++ pmb/helpers/repo_bootstrap.py | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pmb/config/other.py b/pmb/config/other.py index 43dbe635..f8d122bd 100644 --- a/pmb/config/other.py +++ b/pmb/config/other.py @@ -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": diff --git a/pmb/helpers/repo_bootstrap.py b/pmb/helpers/repo_bootstrap.py index bf9628fc..cf2eb176 100644 --- a/pmb/helpers/repo_bootstrap.py +++ b/pmb/helpers/repo_bootstrap.py @@ -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: