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
This commit is contained in:
parent
284fd42c0a
commit
07812a9189
1 changed files with 6 additions and 2 deletions
|
@ -16,8 +16,7 @@ import pmb.parse
|
||||||
import pmb.parse.version
|
import pmb.parse.version
|
||||||
import pmb.helpers.logging
|
import pmb.helpers.logging
|
||||||
|
|
||||||
|
def get_package_contents(args, package, revision, check=True):
|
||||||
def get_package_version(args, package, revision, check=True):
|
|
||||||
# Redirect stderr to /dev/null, so git doesn't complain about files not
|
# Redirect stderr to /dev/null, so git doesn't complain about files not
|
||||||
# existing in upstream branch for new packages
|
# existing in upstream branch for new packages
|
||||||
stderr = None
|
stderr = None
|
||||||
|
@ -40,6 +39,11 @@ def get_package_version(args, package, revision, check=True):
|
||||||
handle.write(apkbuild_content)
|
handle.write(apkbuild_content)
|
||||||
parsed = pmb.parse.apkbuild(tempdir + "/APKBUILD", False, False)
|
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"]
|
return parsed["pkgver"] + "-r" + parsed["pkgrel"]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue