Skip to content
Snippets Groups Projects
Unverified Commit 60da4023 authored by Minecrell's avatar Minecrell Committed by Oliver Smith
Browse files

pmb/aportgen: lookup package in APKINDEX with correct arch (MR 2493)

This can otherwise fail if the package was only built for some
architectures so far, but not for the architecture that is being generated.

E.g. right now musl-1.2.5-r6 was built already for x86_64 but not aarch64,
which causes errors like the following when running "pmbootstrap aportgen
musl-x86_64" on aarch64:

>>> musl-x86_64: Fetching musl-1.2.5-r5-x86_64-edge.apk::http://dl-4.alpinelinux.org/alpine//edge/main/x86_64/musl-1.2.5-r5.apk
Connecting to dl-4.alpinelinux.org (147.75.40.42:80)
Connecting to dl-4.alpinelinux.org (147.75.40.42:443)
wget: server returned error: HTTP/1.1 404 Not Found
>>> ERROR: musl-x86_64: checksum failed
parent 6836a55d
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ def generate(pkgname: str) -> None:
context = get_context()
# Parse version from APKINDEX
package_data = pmb.parse.apkindex.package("busybox")
package_data = pmb.parse.apkindex.package("busybox", arch=arch)
if package_data is None:
raise RuntimeError("Couldn't find APKINDEX for busybox!")
......
......@@ -208,7 +208,7 @@ def get_upstream_aport(pkgname: str, arch: Arch | None = None, retain_branch: bo
repo = split[-2]
pkgname = split[-1]
index_path = pmb.helpers.repo.alpine_apkindex_path(repo, arch)
package = pmb.parse.apkindex.package(pkgname, indexes=[index_path])
package = pmb.parse.apkindex.package(pkgname, indexes=[index_path], arch=arch)
if package is None:
raise RuntimeError(f"Couldn't find {pkgname} in APKINDEX!")
......
......@@ -15,7 +15,7 @@ def generate(pkgname: str) -> None:
arch = Arch.x86
if pkgname != "grub-efi-x86":
raise RuntimeError("only grub-efi-x86 is available")
package_data = pmb.parse.apkindex.package("grub")
package_data = pmb.parse.apkindex.package("grub", arch=arch)
if package_data is None:
raise RuntimeError("Couldn't find package grub!")
version = package_data.version
......
......@@ -15,7 +15,7 @@ def generate(pkgname: str) -> None:
arch = Arch.from_str(pkgname.split("-")[1])
# Parse musl version from APKINDEX
package_data = pmb.parse.apkindex.package("musl")
package_data = pmb.parse.apkindex.package("musl", arch=arch)
if package_data is None:
raise RuntimeError("Couldn't find package musl!")
version = package_data.version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment