mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-12 19:09:56 +03:00
pmb.aportgen: Update APKINDEX for relevant arch before parsing it (MR 2509)
This might have saved me a couple of minutes of debugging, at least. While working with the aportgen code I had two distinct issues: 1. APKINDEX was outdated, so I got an error about not being able to download the supposedly latest version of BusyBox as it no longer existed on Alpine's mirror. 2. APKINDEX had not been created by any other command, so aportgen would tell me that it couldn't find the "busybox" package. The changes in this commit resolves both of these issues from my testing.
This commit is contained in:
parent
4cc50fa439
commit
d02d6f4bc9
4 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
import pmb.aportgen.core
|
||||
import pmb.build
|
||||
import pmb.chroot.apk
|
||||
import pmb.helpers.repo
|
||||
import pmb.helpers.run
|
||||
import pmb.parse.apkindex
|
||||
from pmb.core import Chroot
|
||||
|
@ -12,6 +13,8 @@ from pmb.core.arch import Arch
|
|||
def generate(pkgname: str) -> None:
|
||||
arch = Arch.from_str(pkgname.split("-")[2])
|
||||
|
||||
# Update or create APKINDEX for relevant arch so we know it exists and is recent.
|
||||
pmb.helpers.repo.update(arch)
|
||||
# Parse version from APKINDEX
|
||||
package_data = pmb.parse.apkindex.package("busybox", arch=arch)
|
||||
|
||||
|
|
|
@ -208,6 +208,8 @@ def get_upstream_aport(pkgname: str, arch: Arch | None = None, retain_branch: bo
|
|||
split = aport_path.parts
|
||||
repo = split[-2]
|
||||
pkgname = split[-1]
|
||||
# Update or create APKINDEX for relevant arch so we know it exists and is recent.
|
||||
pmb.helpers.repo.update(arch)
|
||||
index_path = pmb.helpers.repo.alpine_apkindex_path(repo, arch)
|
||||
package = pmb.parse.apkindex.package(pkgname, indexes=[index_path], arch=arch)
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import pmb.aportgen.core
|
|||
import pmb.build
|
||||
import pmb.chroot.apk
|
||||
from pmb.core.arch import Arch
|
||||
import pmb.helpers.repo
|
||||
import pmb.helpers.run
|
||||
import pmb.parse.apkindex
|
||||
from pmb.core import Chroot
|
||||
|
@ -13,6 +14,9 @@ def generate(pkgname: str) -> None:
|
|||
arch = Arch.x86
|
||||
if pkgname != "grub-efi-x86":
|
||||
raise RuntimeError("only grub-efi-x86 is available")
|
||||
# Update or create APKINDEX for relevant arch so we know it exists and is recent.
|
||||
pmb.helpers.repo.update(arch)
|
||||
|
||||
package_data = pmb.parse.apkindex.package("grub", arch=arch)
|
||||
if package_data is None:
|
||||
raise RuntimeError("Couldn't find package grub!")
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import pmb.aportgen.core
|
||||
import pmb.build
|
||||
import pmb.chroot.apk
|
||||
import pmb.helpers.repo
|
||||
import pmb.helpers.run
|
||||
import pmb.parse.apkindex
|
||||
from pmb.core import Chroot
|
||||
|
@ -12,6 +13,8 @@ from pmb.core.arch import Arch
|
|||
def generate(pkgname: str) -> None:
|
||||
arch = Arch.from_str(pkgname.split("-")[1])
|
||||
|
||||
# Update or create APKINDEX for relevant arch so we know it exists and is recent.
|
||||
pmb.helpers.repo.update(arch)
|
||||
# Parse musl version from APKINDEX
|
||||
package_data = pmb.parse.apkindex.package("musl", arch=arch)
|
||||
if package_data is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue