mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-28 15:25:23 +02:00
lib.pm.*.query_packages(): Make it non-interactive
lib.pm.query_packages() uses a TTY for doing its thing and outputs half-digested stuff to the terminal, fix that. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
8280327602
commit
b2e1e411f1
2 changed files with 8 additions and 8 deletions
|
|
@ -7,8 +7,8 @@ from typing import Iterable, TYPE_CHECKING
|
|||
if TYPE_CHECKING:
|
||||
from ..ExecContext import ExecContext
|
||||
|
||||
from ..ExecContext import InputMode
|
||||
from ..util import run_cmd, run_sudo
|
||||
|
||||
from ..Package import Package, meta_tags
|
||||
|
||||
_meta_map: dict[str, str]|None = None
|
||||
|
|
@ -37,7 +37,7 @@ async def run_dpkg_query(args: list[str], sudo: bool=False, ec: ExecContext=None
|
|||
cmd.extend(args)
|
||||
if sudo:
|
||||
return await run_sudo(cmd)
|
||||
return (await run_cmd(cmd, ec=ec)).decode()
|
||||
return (await run_cmd(cmd, ec=ec, cmd_input=InputMode.NonInteractive)).decode()
|
||||
|
||||
async def query_packages(names: Iterable[str] = [], ec: ExecContext=None) -> Iterable[Package]: # export
|
||||
fmt_str = '|'.join([(f'${{{tag}}}' if tag else '') for tag in meta_map().values()]) + r'\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue