diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-23 15:53:35 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-23 15:53:35 +0200 |
commit | 92d6e99144a4b7227ad29c69fe10e97478bc63bb (patch) | |
tree | 5374e66bf8d619d28bcf3ad53a6c3c03f1c37115 /src/apk.c | |
parent | ba3ee3f86396f05123f732da7c7879c8ed016c9d (diff) | |
download | apk-tools-92d6e99144a4b7227ad29c69fe10e97478bc63bb.tar.gz apk-tools-92d6e99144a4b7227ad29c69fe10e97478bc63bb.tar.bz2 apk-tools-92d6e99144a4b7227ad29c69fe10e97478bc63bb.tar.xz apk-tools-92d6e99144a4b7227ad29c69fe10e97478bc63bb.zip |
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.
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } |