From 92d6e99144a4b7227ad29c69fe10e97478bc63bb Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Thu, 23 Feb 2012 15:53:35 +0200 Subject: 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. --- src/apk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/apk.c') diff --git a/src/apk.c b/src/apk.c index 4fce15b..8fb0924 100644 --- a/src/apk.c +++ b/src/apk.c @@ -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); } -- cgit v1.2.3-60-g2f50