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

build: package: allow building old versions of packages with --force (MR 2457)


It may be desirable to test older versions of packages, allow them to be
built when --force is specified and print a warning that they won't be
installed automatically.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 8ac2e48a
No related branches found
No related tags found
1 merge request!2457build: package: allow building old versions of packages with --force
Pipeline #209039 passed
......@@ -480,18 +480,27 @@ def packages(
channel = pmb.config.pmaports.read_config(aports)["channel"]
index_data = pmb.parse.apkindex.package(name, arch, False)
# Make sure we aren't building a package that will never be used! This can happen if
# building with --src with an outdated pmaports checkout.
# building with --src with an outdated pmaports checkout. Unless --force is used
# in which case we assume it was intentional.
if (
index_data
and pmb.parse.version.compare(index_data.version, f"{pkgver}-r{apkbuild['pkgrel']}")
== 1
):
raise NonBugError(
f"A binary package for {name} has a newer version ({index_data.version})"
f" than the source ({pkgver}-{apkbuild['pkgrel']}). Please ensure your pmaports branch is up"
" to date and that you don't have a newer version of the package in your local"
f" binary repo ({context.config.work / 'packages' / channel / pkg_arch})."
)
if force:
logging.warning(
f"WARNING: A binary package for {name} has a newer version ({index_data.version})"
f" than the source ({pkgver}-{apkbuild['pkgrel']}). The package to be build will"
f" not be installed automatically, use 'apk add {name}={pkgver}-r{apkbuild['pkgrel']}'"
" to install it."
)
else:
raise NonBugError(
f"A binary package for {name} has a newer version ({index_data.version})"
f" than the source ({pkgver}-{apkbuild['pkgrel']}). Please ensure your pmaports branch is up"
" to date and that you don't have a newer version of the package in your local"
f" binary repo ({context.config.work / 'packages' / channel / pkg_arch})."
)
build_queue.append(
{
"name": name,
......
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