forked from Mirror/pmbootstrap
treewide: adopt pathlib.Path and type hinting (MR 2252)
With the new chroot type, we can now write fancy paths in the pythonic way. Convert most of the codebase over, as well as adding various other type hints. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
00383bf354
commit
31cc898dd5
64 changed files with 513 additions and 385 deletions
|
@ -1,5 +1,6 @@
|
|||
# Copyright 2023 Attila Szollosi
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from pathlib import Path
|
||||
from pmb.helpers import logging
|
||||
|
||||
import pmb.chroot
|
||||
|
@ -13,7 +14,7 @@ def create_zip(args: PmbArgs, suffix):
|
|||
"""
|
||||
Create android recovery compatible installer zip.
|
||||
"""
|
||||
zip_root = "/var/lib/postmarketos-android-recovery-installer/"
|
||||
zip_root = Path("/var/lib/postmarketos-android-recovery-installer/")
|
||||
rootfs = "/mnt/rootfs_" + args.device
|
||||
flavor = pmb.helpers.frontend._parse_flavor(args)
|
||||
method = args.deviceinfo["flash_method"]
|
||||
|
@ -70,4 +71,4 @@ def create_zip(args: PmbArgs, suffix):
|
|||
["gzip", "-f1", "rootfs.tar"],
|
||||
["build-recovery-zip", args.device]]
|
||||
for command in commands:
|
||||
pmb.chroot.root(args, command, suffix, zip_root)
|
||||
pmb.chroot.root(args, command, suffix, working_dir=zip_root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue