ci: fix test_providers.py to not fail if provider_priority is 0

As per the apk-tools and abuild source code, 0 is a perfectly valid integer
for provider_priority, but our Python tests currently fail with a priority of 0
because 0 and None are the same in the if statement that checks priority.

Changes the if statement that checks priority to fail if the priority is
explicitly None.

Signed-off-by: Aster Boese <asterboese@mailbox.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8973>
This commit is contained in:
Aster Boese
2026-07-06 20:47:06 +00:00
parent f88c29beb9
commit 1ab5c4ed75
+4 -1
View File
@@ -34,7 +34,10 @@ def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
for provide in apkbuild["provides"]:
# Having provides entries without version is valid if the
# provider_priorty is also set (pma#1766)
if apkbuild["provider_priority"]:
# We use `is not None` here to allow priorities of 0, as
# otherwise Python would interpret 0 to mean False and the
# check would fail.
if apkbuild["provider_priority"] is not None:
continue
# Otherwise the version =$pkgver-r$pkgrel needs to be set. pmbootstrap
# already replaces the variables, so we check against the inserted