ci/check_changed_aports_ver: add tests for new dev pkg rules (MR 4994)

[ci:ignore-count]

[ci:skip-vercheck]
[ci:skip-build]: already built successfully in CI
This commit is contained in:
Clayton Craft 2024-04-12 12:36:40 -07:00
parent 40a46fd4e5
commit 970bc34c45
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A

View file

@ -123,6 +123,33 @@ def check_versions(args, packages):
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Additional checks for device packages
if package.startswith('device-'):
head_parsed = get_package_contents(args, package, "HEAD", False)
upstream_parsed = get_package_contents(args, package, commit, False)
# checksums did not change
if head_parsed["sha512sums"] == upstream_parsed["sha512sums"]:
# Check that pkgver did not change
if head_parsed["pkgver"] != upstream_parsed["pkgver"]:
print(f" - {package}: pkgver should not change when package source checksums did not change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# We do not check for a bumped pkgrel, because not everything
# needs it, e.g: pmb_recommends
# checksums changed
else:
# Check that pkgrel was reset to 0
if head_parsed["pkgrel"] != 0:
print(f" - {package}: pkgrel should be 0 when package source checksums change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Check that pkgver was changed
if head_parsed["pkgver"] == upstream_parsed["pkgver"]:
print(f" - {package}: pkgver should change when package source checksums change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Compare head and upstream versions
result = pmb.parse.version.compare(head, upstream)
if result != 1: