diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-08-03 17:31:49 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-08-03 17:31:49 +0300 |
commit | 065427f417170795daf306f8a4b8efe4932a9e44 (patch) | |
tree | c1df78efc8c6d872cfe7ac830592f1acea8f5e9b | |
parent | ed06091189daaf87d1feee3ed282d1d0f1682e0e (diff) | |
download | apk-tools-065427f417170795daf306f8a4b8efe4932a9e44.tar.gz apk-tools-065427f417170795daf306f8a4b8efe4932a9e44.tar.bz2 apk-tools-065427f417170795daf306f8a4b8efe4932a9e44.tar.xz apk-tools-065427f417170795daf306f8a4b8efe4932a9e44.zip |
commit: don't ask questions if simulating
-rw-r--r-- | src/commit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/commit.c b/src/commit.c index 2b1eb9f..576224a 100644 --- a/src/commit.c +++ b/src/commit.c @@ -249,18 +249,19 @@ int apk_solver_commit_changeset(struct apk_database *db, size_unit = 'M'; } - if (apk_verbosity > 1 || (apk_flags & APK_INTERACTIVE)) { + if ((apk_verbosity > 1 || (apk_flags & APK_INTERACTIVE)) && + !(apk_flags & APK_SIMULATE)) { r = dump_packages(changeset, cmp_remove, "The following packages will be REMOVED"); r += dump_packages(changeset, cmp_downgrade, "The following packages will be DOWNGRADED"); if (r || (apk_flags & APK_INTERACTIVE) || apk_verbosity > 2) { - dump_packages(changeset, cmp_new, - "The following NEW packages will be installed"); - dump_packages(changeset, cmp_upgrade, - "The following packages will be upgraded"); - dump_packages(changeset, cmp_reinstall, - "The following packages will be reinstalled"); + r += dump_packages(changeset, cmp_new, + "The following NEW packages will be installed"); + r += dump_packages(changeset, cmp_upgrade, + "The following packages will be upgraded"); + r += dump_packages(changeset, cmp_reinstall, + "The following packages will be reinstalled"); printf("After this operation, %zd %ciB of %s.\n", (size_diff < 0) ? -size_diff : size_diff, size_unit, @@ -268,8 +269,7 @@ int apk_solver_commit_changeset(struct apk_database *db, "disk space will be freed" : "additional disk space will be used"); } - if (changeset->num_total_changes > 0 && - (apk_flags & APK_INTERACTIVE)) { + if (r > 0 && (apk_flags & APK_INTERACTIVE)) { printf("Do you want to continue [Y/n]? "); fflush(stdout); r = fgetc(stdin); |