From 970bc34c45a3e1fe855d6871d8f66338f5c6de80 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Fri, 12 Apr 2024 12:36:40 -0700 Subject: [PATCH] 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 --- .ci/lib/check_changed_aports_versions.py | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.ci/lib/check_changed_aports_versions.py b/.ci/lib/check_changed_aports_versions.py index 5149f4432..1eed45129 100755 --- a/.ci/lib/check_changed_aports_versions.py +++ b/.ci/lib/check_changed_aports_versions.py @@ -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: