From 60901ac462ad56a1495ed1ab61cf206d9f7095da Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 1 Mar 2023 21:41:13 +0100 Subject: [PATCH] pmb.helpers.run: don't pass stdin to output=stdout When looking at the table for possible output modes, it only makes sense to pass stdin to "interactive" and "tui". The output mode "stdout" is for non-interactive commands. This fixes apk going interactive (asking for confirmation) when running pmbootstrap with --details-to-stdout and building a package that depends on postmarketos-base. Fixes: issue 2208 Tested-by: Clayton Craft Reviewed-by: Clayton Craft Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230301204112.4351-1-ollieparanoid@postmarketos.org%3E --- pmb/helpers/run_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmb/helpers/run_core.py b/pmb/helpers/run_core.py index c3283e9a..5bf5327b 100644 --- a/pmb/helpers/run_core.py +++ b/pmb/helpers/run_core.py @@ -288,7 +288,7 @@ def core(args, log_message, cmd, working_dir=None, output="log", output value | timeout | out to log | out to stdout | wait | pass stdin ------------------------------------------------------------------------ "log" | x | x | | x | - "stdout" | x | x | x | x | x + "stdout" | x | x | x | x | "interactive" | | x | x | x | x "tui" | | | x | x | x "background" | | x | | | @@ -338,7 +338,7 @@ def core(args, log_message, cmd, working_dir=None, output="log", output_timeout = output in ["log", "stdout"] and not disable_timeout - stdin = subprocess.DEVNULL if output == "log" else None + stdin = subprocess.DEVNULL if output in ["log", "stdout"] else None (code, output_after_run) = foreground_pipe(args, cmd, working_dir, output_to_stdout,