Skip to content
Snippets Groups Projects
Unverified Commit d34e8d17 authored by Oliver Smith's avatar Oliver Smith Committed by GitHub
Browse files

Upstream compatibility test: also test generated aports, e.g. gcc-armhf (#1014)

parent 12605e5e
Branches
Tags
No related merge requests found
......@@ -74,3 +74,51 @@ def test_qt_versions(args):
pkgver_upstream)
assert [] == failed
def test_aportgen_versions(args):
"""
Verify that the packages generated by 'pmbootstrap aportgen' have
the same version (pkgver *and* pkgrel!) as the upstream packages
they are based on.
"""
# Get Alpine's "main" repository APKINDEX path
pmb.helpers.repo.update(args)
repository = args.mirror_alpine + args.alpine_version + "/main"
hash = pmb.helpers.repo.hash(repository)
index_path = (args.work + "/cache_apk_armhf/APKINDEX." + hash +
".tar.gz")
# Alpine packages and patterns for our derivatives
map = {"binutils": "binutils-*",
"busybox": "busybox-static-*",
"gcc": "gcc-*",
"musl": "musl-*"}
# Iterate over Alpine packages
failed = []
generated = "# Automatically generated aport, do not edit!"
for pkgname, pattern in map.items():
# Upstream version
index_data = pmb.parse.apkindex.read(args, pkgname, index_path)
version_upstream = index_data["version"]
# Iterate over our packages
for path in glob.glob(args.aports + "/*/" + pattern + "/APKBUILD"):
# Skip non-aportgen APKBUILDs
with open(path) as handle:
if generated not in handle.read():
continue
# Compare the version
print("Checking " + path)
apkbuild = pmb.parse.apkbuild(args, path)
version = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
if version != version_upstream:
failed.append(apkbuild["pkgname"] + ": " + version +
" != " + version_upstream +
" (from " + pkgname + ")")
continue
assert [] == failed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment