summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-24 14:18:07 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-24 14:18:45 +0300
commit1c92602172790bbcb75f6083cf53ce7fea25b33a (patch)
tree03e607086477a15fe9e6500cba428d8e369ae700 /src/state.c
parent195859b3fd35819b218336f0bdd87eaa55778d56 (diff)
downloadapk-tools-1c92602172790bbcb75f6083cf53ce7fea25b33a.tar.gz
apk-tools-1c92602172790bbcb75f6083cf53ce7fea25b33a.tar.bz2
apk-tools-1c92602172790bbcb75f6083cf53ce7fea25b33a.tar.xz
apk-tools-1c92602172790bbcb75f6083cf53ce7fea25b33a.zip
apk: add -i/--interactive option (fixes #60)
and use that to figure if questions are allowed or not instead of the verbosity level.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c
index f539b3b..16acfba 100644
--- a/src/state.c
+++ b/src/state.c
@@ -667,7 +667,7 @@ int apk_state_commit(struct apk_state *state,
}
size_diff /= 1024;
- if (apk_verbosity > 1) {
+ if (apk_verbosity > 1 || (apk_flags & APK_INTERACTIVE)) {
r = dump_packages(state, cmp_remove,
"The following packages will be REMOVED");
r += dump_packages(state, cmp_downgrade,
@@ -681,6 +681,8 @@ int apk_state_commit(struct apk_state *state,
(size_diff < 0) ?
"disk space will be freed" :
"additional disk space will be used");
+ }
+ if (apk_flags & APK_INTERACTIVE) {
fprintf(stderr, "Do you want to continue [Y/n]? ");
fflush(stderr);
r = fgetc(stdin);