pmb.helpers.aportupgrade: Check for none pkgver_match in upgrade_git_package (MR 2258)

Appeases Mypy.
This commit is contained in:
Newbyte 2024-02-14 18:10:54 +01:00
parent bcfab8cfc3
commit cb3807a9f6
No known key found for this signature in database
GPG key ID: 8A700086A9FE41FD

View file

@ -141,6 +141,10 @@ def upgrade_git_package(args, pkgname: str, package) -> bool:
pkgver = package["pkgver"]
pkgver_match = re.match(r"([\d.]+)_git", pkgver)
if pkgver_match is None:
msg = "pkgver did not match the expected pattern!"
raise RuntimeError(msg)
date_pkgver = verinfo["date"].strftime("%Y%m%d")
pkgver_new = f"{pkgver_match.group(1)}_git{date_pkgver}"