mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
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
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from typing import cast, Any, NoReturn
|
||||
from typing import Any, NoReturn
|
||||
|
||||
import pmb.aportgen
|
||||
import pmb.build
|
||||
|
@ -19,7 +19,7 @@ import pmb.chroot.other
|
|||
import pmb.ci
|
||||
import pmb.config
|
||||
from pmb.core import Config
|
||||
from pmb.types import Env, PmbArgs, RunOutputType
|
||||
from pmb.types import Env, PmbArgs
|
||||
import pmb.export
|
||||
import pmb.flasher
|
||||
import pmb.helpers.aportupgrade
|
||||
|
@ -213,16 +213,13 @@ def chroot(args: PmbArgs) -> None:
|
|||
|
||||
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
|
||||
if user:
|
||||
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:
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue