forked from Mirror/pmbootstrap
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
|
@ -10,6 +10,7 @@ See also:
|
|||
"""
|
||||
import copy
|
||||
from typing import Any, Dict
|
||||
from pmb.core.arch import Arch
|
||||
from pmb.core.context import get_context
|
||||
from pmb.helpers import logging
|
||||
import pmb.build._package
|
||||
|
@ -83,7 +84,7 @@ def get(pkgname, arch, replace_subpkgnames=False, must_exist=True):
|
|||
# Find in APKINDEX (other arches)
|
||||
if not ret:
|
||||
pmb.helpers.repo.update()
|
||||
for arch_i in pmb.config.build_device_architectures:
|
||||
for arch_i in Arch.supported():
|
||||
if arch_i != arch:
|
||||
ret = pmb.parse.apkindex.package(pkgname, arch_i, False)
|
||||
if ret:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue