From 4ed813cf0e7a6f19f49f417838fbb62f545c28e6 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 13 Jun 2024 21:39:45 +0200 Subject: [PATCH] config: workdir: handle systemd chroot channel (MR 2252) Correctly denote whether the chroot is for the systemd channel or not so users are warned when switching from edge to systemd staging without zapping. Signed-off-by: Caleb Connolly --- pmb/config/workdir.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pmb/config/workdir.py b/pmb/config/workdir.py index 49e38dda..66702f81 100644 --- a/pmb/config/workdir.py +++ b/pmb/config/workdir.py @@ -30,7 +30,7 @@ def chroot_save_init(suffix: Chroot): cfg[key] = {} # Update sections - channel = pmb.config.pmaports.read_config(pkgrepo_default_path())["channel"] + channel = pmb.config.pmaports.read_config()["channel"] cfg["chroot-channels"][str(suffix)] = channel cfg["chroot-init-dates"][str(suffix)] = str(int(time.time())) @@ -83,9 +83,7 @@ def chroot_check_channel(chroot: Chroot): if key not in cfg or str(chroot) not in cfg[key]: raise RuntimeError(f"{msg_unknown} {msg_again}") - # Exclude systemd repo - aports = pkgrepo_default_path() - channel = pmb.config.pmaports.read_config(aports)["channel"] + channel = pmb.config.pmaports.read_config()["channel"] channel_cfg = cfg[key][str(chroot)] if channel != channel_cfg: raise RuntimeError(f"Chroot '{chroot}' was created for the"