Skip to content
Snippets Groups Projects
Unverified Commit 657c25c9 authored by Caleb Connolly's avatar Caleb Connolly :recycle: Committed by Oliver Smith
Browse files

build: package: error when --src and --arch but no APKBUILD (MR 2458)

parent d4d7ba03
No related branches found
No related tags found
1 merge request!2458build: package: error when --src and --arch but no APKBUILD
Pipeline #209044 passed
......@@ -323,6 +323,7 @@ def process_package(
arch: Arch | None,
fallback_arch: Arch,
force: bool,
from_src: bool,
) -> list[str]:
"""
:param arch: Set if we should build for a specific arch.
......@@ -330,7 +331,17 @@ def process_package(
# Only build when APKBUILD exists
base_aports, base_apkbuild = get_apkbuild(pkgname)
if not base_apkbuild:
# We allow this function to be called for packages that aren't in pmaports
# and just do nothing in this case. However this can be quite confusing
# when building an Alpine package with --src since we'll just do nothing
if pmb.parse.apkindex.providers(pkgname, fallback_arch, False):
if from_src:
raise NonBugError(
f"Package {pkgname} is not in pmaports, but exists in Alpine."
" to build it with --src you first need to fork it to pmaports."
f" Please run 'pmbootstrap aportgen --fork-alpine {pkgname}' and then"
" try again"
)
return []
raise RuntimeError(
f"{pkgname}: Could not find aport, and" " could not find this package in any APKINDEX!"
......@@ -548,7 +559,7 @@ def packages(
all_dependencies: list[str] = []
for pkgname in pkgnames:
all_dependencies += process_package(
context, queue_build, pkgname, arch, fallback_arch, force
context, queue_build, pkgname, arch, fallback_arch, force, src is not None
)
# If any of our common build packages need to be built and are missing, then add them
......
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