forked from Mirror/pmbootstrap
pmb.parse.apkindex: Introduce proper typing (MR 2425)
And adjust other code. Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2455
This commit is contained in:
parent
566b43edd4
commit
71772b9b6b
18 changed files with 279 additions and 179 deletions
|
@ -36,6 +36,7 @@ import pmb.install
|
|||
import pmb.install.blockdevice
|
||||
import pmb.netboot
|
||||
import pmb.parse
|
||||
import pmb.parse.apkindex
|
||||
import pmb.qemu
|
||||
import pmb.sideload
|
||||
from pmb.core import ChrootType, Chroot
|
||||
|
@ -490,7 +491,12 @@ def apkindex_parse(args: PmbArgs) -> None:
|
|||
if args.package:
|
||||
if args.package not in result:
|
||||
raise RuntimeError(f"Package not found in the APKINDEX: {args.package}")
|
||||
result = result[args.package]
|
||||
if isinstance(args.package, list):
|
||||
raise AssertionError
|
||||
result_temp = result[args.package]
|
||||
if isinstance(result_temp, pmb.parse.apkindex.ApkindexBlock):
|
||||
raise AssertionError
|
||||
result = result_temp
|
||||
print(json.dumps(result, indent=4))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue