forked from Mirror/pmbootstrap
pmb.types: Fix type for PmbArgs.output (MR 2522)
And remove hack needed to accomodate this wrong type.
This commit is contained in:
parent
8e09be579a
commit
01faedcf37
2 changed files with 5 additions and 8 deletions
|
@ -7,7 +7,7 @@ from pmb.helpers import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import sys
|
import sys
|
||||||
from typing import cast, Any, NoReturn
|
from typing import Any, NoReturn
|
||||||
|
|
||||||
import pmb.aportgen
|
import pmb.aportgen
|
||||||
import pmb.build
|
import pmb.build
|
||||||
|
@ -19,7 +19,7 @@ import pmb.chroot.other
|
||||||
import pmb.ci
|
import pmb.ci
|
||||||
import pmb.config
|
import pmb.config
|
||||||
from pmb.core import Config
|
from pmb.core import Config
|
||||||
from pmb.types import Env, PmbArgs, RunOutputType
|
from pmb.types import Env, PmbArgs
|
||||||
import pmb.export
|
import pmb.export
|
||||||
import pmb.flasher
|
import pmb.flasher
|
||||||
import pmb.helpers.aportupgrade
|
import pmb.helpers.aportupgrade
|
||||||
|
@ -213,16 +213,13 @@ def chroot(args: PmbArgs) -> None:
|
||||||
|
|
||||||
pmb.helpers.apk.update_repository_list(chroot.path, user_repository=True)
|
pmb.helpers.apk.update_repository_list(chroot.path, user_repository=True)
|
||||||
|
|
||||||
# TODO: Maybe this could be done better.
|
|
||||||
output_type = cast(RunOutputType, args.output)
|
|
||||||
|
|
||||||
# Run the command as user/root
|
# Run the command as user/root
|
||||||
if user:
|
if user:
|
||||||
logging.info(f"({chroot}) % su pmos -c '" + " ".join(args.command) + "'")
|
logging.info(f"({chroot}) % su pmos -c '" + " ".join(args.command) + "'")
|
||||||
pmb.chroot.user(args.command, chroot, output=output_type, env=env)
|
pmb.chroot.user(args.command, chroot, output=args.output, env=env)
|
||||||
else:
|
else:
|
||||||
logging.info(f"({chroot}) % " + " ".join(args.command))
|
logging.info(f"({chroot}) % " + " ".join(args.command))
|
||||||
pmb.chroot.root(args.command, chroot, output=output_type, env=env)
|
pmb.chroot.root(args.command, chroot, output=args.output, env=env)
|
||||||
|
|
||||||
|
|
||||||
def config(args: PmbArgs) -> None:
|
def config(args: PmbArgs) -> None:
|
||||||
|
|
|
@ -143,7 +143,7 @@ class PmbArgs(Namespace):
|
||||||
on_device_installer: bool
|
on_device_installer: bool
|
||||||
ondev_cp: list[tuple[str, str]]
|
ondev_cp: list[tuple[str, str]]
|
||||||
ondev_no_rootfs: bool
|
ondev_no_rootfs: bool
|
||||||
output: str
|
output: RunOutputType
|
||||||
overview: bool
|
overview: bool
|
||||||
# FIXME (#2324): figure out the args.package vs args.packages situation
|
# FIXME (#2324): figure out the args.package vs args.packages situation
|
||||||
package: str | list[str]
|
package: str | list[str]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue