forked from Mirror/pmbootstrap
pmb: Add lots of type hints (MR 2464)
This commit is contained in:
parent
d05d57b37e
commit
225d8b30a0
71 changed files with 566 additions and 325 deletions
|
@ -12,7 +12,7 @@ import pmb.aportgen.core
|
|||
import pmb.build
|
||||
import pmb.build.autodetect
|
||||
import pmb.chroot
|
||||
from pmb.types import PathString, PmbArgs
|
||||
from pmb.types import Env, PathString, PmbArgs
|
||||
import pmb.helpers
|
||||
import pmb.helpers.mount
|
||||
import pmb.helpers.pmaports
|
||||
|
@ -97,7 +97,7 @@ def find_kbuild_output_dir(function_body):
|
|||
)
|
||||
|
||||
|
||||
def modify_apkbuild(pkgname: str, aport: Path):
|
||||
def modify_apkbuild(pkgname: str, aport: Path) -> None:
|
||||
"""Modify kernel APKBUILD to package build output from envkernel.sh."""
|
||||
work = get_context().config.work
|
||||
apkbuild_path = aport / "APKBUILD"
|
||||
|
@ -119,7 +119,9 @@ def modify_apkbuild(pkgname: str, aport: Path):
|
|||
pmb.aportgen.core.rewrite(pkgname, apkbuild_path, fields=fields)
|
||||
|
||||
|
||||
def run_abuild(context: Context, pkgname: str, arch: Arch, apkbuild_path: Path, kbuild_out):
|
||||
def run_abuild(
|
||||
context: Context, pkgname: str, arch: Arch, apkbuild_path: Path, kbuild_out: str
|
||||
) -> None:
|
||||
"""
|
||||
Prepare build environment and run abuild.
|
||||
|
||||
|
@ -190,7 +192,7 @@ def run_abuild(context: Context, pkgname: str, arch: Arch, apkbuild_path: Path,
|
|||
pmb.helpers.run.root(cmd)
|
||||
|
||||
# Create the apk package
|
||||
env = {
|
||||
env: Env = {
|
||||
"CARCH": str(arch),
|
||||
"CHOST": str(arch),
|
||||
"CBUILD": str(Arch.native()),
|
||||
|
@ -211,7 +213,7 @@ def run_abuild(context: Context, pkgname: str, arch: Arch, apkbuild_path: Path,
|
|||
pmb.chroot.root(["rm", build_path / "src"])
|
||||
|
||||
|
||||
def package_kernel(args: PmbArgs):
|
||||
def package_kernel(args: PmbArgs) -> None:
|
||||
"""Frontend for 'pmbootstrap build --envkernel': creates a package from envkernel output."""
|
||||
pkgname = args.packages[0]
|
||||
if len(args.packages) > 1 or not pkgname.startswith("linux-"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue