mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
core: add an Arch type (MR 2252)
Move pmb/parse/arch.py over to core and refactor it as an Arch type, similar to how Chroot was done. Fix all the uses (that I can find) of arch in the codebase that need adjusting. The new Arch type is an Enum, making it clear what architectures can be represented and making it much easier to reason about. Since we support ~5 (kinda) different representations of an Architecture (Alpine, Kernel, target triple, platform, and QEMU), we now formalise that the Alpine format is what we represent internally, with methods to convert to any of the others as-needed. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
505165dc13
commit
866e5bcfab
42 changed files with 389 additions and 303 deletions
|
@ -29,7 +29,7 @@ def chroot_save_init(suffix: Chroot):
|
|||
cfg[key] = {}
|
||||
|
||||
# Update sections
|
||||
channel = pmb.config.pmaports.read_config()["channel"]
|
||||
channel = pmb.config.pmaports.read_config(support_systemd=False)["channel"]
|
||||
cfg["chroot-channels"][str(suffix)] = channel
|
||||
cfg["chroot-init-dates"][str(suffix)] = str(int(time.time()))
|
||||
|
||||
|
@ -82,7 +82,8 @@ 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}")
|
||||
|
||||
channel = pmb.config.pmaports.read_config()["channel"]
|
||||
# Exclude systemd repo
|
||||
channel = pmb.config.pmaports.read_config(support_systemd=False)["channel"]
|
||||
channel_cfg = cfg[key][str(chroot)]
|
||||
if channel != channel_cfg:
|
||||
raise RuntimeError(f"Chroot '{chroot}' was created for the"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue