Skip to content
Snippets Groups Projects
Verified Commit 59bc5cff authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

pmb.parse.apkindex: fix crash when origin or timestamp are unset

Sometimes these fields are not set, e.g.:

pdb> p ret
{'depends': ['build-base', 'bash', 'bison', 'findutils', 'flex', 'musl-dev', 'openssl-dev', 'perl', 'python3'], 'arch': 'noarch', 'version': '20241022.022230', 'pkgname': '.makedepends-linux-lenovo-21bx', 'provides': []}

I hit this crash when I installed the build deps for the
linux-lenovo-21bx package in the native chroot, and then ran
`pmbootstrap stats`
parent 4f3ede33
No related branches found
No related tags found
No related merge requests found
Pipeline #208679 canceled
......@@ -94,11 +94,11 @@ def parse_next_block(path: Path, lines: list[str]) -> ApkindexBlock | None:
return ApkindexBlock(
arch=Arch.from_str(ret["arch"]),
depends=ret["depends"],
origin=ret["origin"],
origin=ret.get("origin", None),
pkgname=ret["pkgname"],
provides=ret["provides"],
provider_priority=ret.get("provider_priority"),
timestamp=ret["timestamp"],
timestamp=ret.get("timestamp"),
version=ret["version"],
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment