Skip to content
Snippets Groups Projects

pmb.helpers.pkgrel_bump: Add type hints and fix auto_apkindex_package

Merged Luca Weiss requested to merge pkgrel_bump-fix into master
All threads resolved!
Files
2
@@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from enum import Enum
from pmb.core.apkindex_block import ApkindexBlock
from pmb.core.arch import Arch
from pmb.helpers import logging
@@ -68,7 +69,7 @@ def package(
)
def auto_apkindex_package(arch, aport, apk, dry: bool = False) -> bool:
+1
def auto_apkindex_package(arch: Arch, aport: dict, apk: ApkindexBlock, dry: bool = False) -> bool:
"""Bump the pkgrel of a specific package if it is outdated in the given APKINDEX.
:param arch: the architecture, e.g. "armhf"
@@ -80,7 +81,7 @@ def auto_apkindex_package(arch, aport, apk, dry: bool = False) -> bool:
:returns: True when there was an APKBUILD that needed to be changed.
"""
version_aport = aport["pkgver"] + "-r" + aport["pkgrel"]
version_apk = apk["version"]
version_apk = apk.version
pkgname = aport["pkgname"]
# Skip when aport version != binary package version
@@ -99,7 +100,9 @@ def auto_apkindex_package(arch, aport, apk, dry: bool = False) -> bool:
return False
# Find missing depends
depends = apk["depends"]
depends = apk.depends
+7
if depends is None: # TODO: Why can depends be None?
depends = []
logging.verbose("{}: checking depends: {}".format(pkgname, ", ".join(depends)))
missing = []
for depend in depends:
Loading