ci: relax pkgrel changes for packages that don’t have remote sources
Motivation is to avoid unnecessary overhead for MR authors & no reason to actually use pkgrel for meta-packages. So instead, recommend pkgver-bumps & pkgrel=0 for metapackages, but don't block MRs when they bumped the "wrong" one. Just make everyone's life easier. Discussed at <https://docs.postmarketos.org/policies-and-processes/governance/team-meetings/meeting-notes.html> (2026-03-16) Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8302>
This commit is contained in:
@@ -137,7 +137,7 @@ def check_versions(packages):
|
||||
pkgver = head.rpartition('-r')[0]
|
||||
if package.startswith('device-') and not pkgver.isdigit():
|
||||
print(f" - {package}: invalid pkgver \"{pkgver}\""
|
||||
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
|
||||
"See: https://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
|
||||
error = True
|
||||
|
||||
# Additional checks for device packages
|
||||
@@ -145,27 +145,11 @@ def check_versions(packages):
|
||||
head_parsed = get_package_contents(package, "HEAD", False)
|
||||
upstream_parsed = get_package_contents(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
|
||||
# Check that pkgrel was reset to 0 when pkgver was changed
|
||||
if head_parsed["pkgver"] != upstream_parsed["pkgver"] and head_parsed["pkgrel"] != "0":
|
||||
print(f" - {package}: pkgrel should be 0 when pkgver changes."
|
||||
"See: https://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
|
||||
error = True
|
||||
|
||||
# Compare head and upstream versions
|
||||
result = pmb.parse.version.compare(head, upstream)
|
||||
|
||||
@@ -264,3 +264,13 @@ only in some specific circumstances? In those situations we have to:
|
||||
versioned provider to disambiguate (e.g:
|
||||
`provides="audio-conf=$pkgver-r$pkgrel"`), or to force the forked packages
|
||||
to provide a lower version than the other package.
|
||||
|
||||
## Meta packages
|
||||
|
||||
### Package versioning (pkgver, pkgrel)
|
||||
|
||||
Packages without upstream sources are a bit special. These are `device-*`
|
||||
packages and other packages like `main/postmarketos-base`, where the source
|
||||
files are included in the package directory. For these packages, the `pkgver`
|
||||
should always be incremented instead of the `pkgrel` (so that `pkgrel` always
|
||||
is `0`).
|
||||
|
||||
Reference in New Issue
Block a user