Commit 92d6e991 authored by Timo Teräs's avatar Timo Teräs
Browse files

apk: /etc/apk/interactive enables interactive mode for tty sessions

In case someone prefers extra quesions while running apk in a
terminal. The file is always from the real root; not from --root
so that we will not accidentally enable interactive mode when in
initramfs bootstrap.
parent ba3ee3f8
......@@ -255,8 +255,11 @@ static void on_sigwinch(int s)
static void setup_terminal(void)
{
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) && isatty(STDIN_FILENO))
if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) && isatty(STDIN_FILENO)) {
apk_flags |= APK_PROGRESS;
if (access("/etc/apk/interactive", F_OK) == 0)
apk_flags |= APK_INTERACTIVE;
}
signal(SIGWINCH, on_sigwinch);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment