From 07812a91895843408d023eb60e6999dd6a805c76 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Fri, 12 Apr 2024 12:30:17 -0700 Subject: [PATCH] ci/check_changed_aports_ver: move apkbuild reading from get_version (MR 4994) This allows reusing the logic to read apkbuild contents in future methods --- .ci/lib/check_changed_aports_versions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/lib/check_changed_aports_versions.py b/.ci/lib/check_changed_aports_versions.py index 16a7bdd98..5149f4432 100755 --- a/.ci/lib/check_changed_aports_versions.py +++ b/.ci/lib/check_changed_aports_versions.py @@ -16,8 +16,7 @@ import pmb.parse import pmb.parse.version import pmb.helpers.logging - -def get_package_version(args, package, revision, check=True): +def get_package_contents(args, package, revision, check=True): # Redirect stderr to /dev/null, so git doesn't complain about files not # existing in upstream branch for new packages stderr = None @@ -40,6 +39,11 @@ def get_package_version(args, package, revision, check=True): handle.write(apkbuild_content) parsed = pmb.parse.apkbuild(tempdir + "/APKBUILD", False, False) + return parsed + + +def get_package_version(args, package, revision, check=True): + parsed = get_package_contents(args, package, revision, check) return parsed["pkgver"] + "-r" + parsed["pkgrel"]