diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 17:13:14 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 17:13:14 +0300 |
commit | ade8d0b4e9c206ab67dc8ef2006e8070011aae83 (patch) | |
tree | 6e9df56d13cfd344d0b1ab0e26012a20257c52ab /src/commit.c | |
parent | 0a131418899436b58a163978176d99c08cbddb0c (diff) | |
download | apk-tools-ade8d0b4e9c206ab67dc8ef2006e8070011aae83.tar.gz apk-tools-ade8d0b4e9c206ab67dc8ef2006e8070011aae83.tar.bz2 apk-tools-ade8d0b4e9c206ab67dc8ef2006e8070011aae83.tar.xz apk-tools-ade8d0b4e9c206ab67dc8ef2006e8070011aae83.zip |
cache: implement progress bar (ref #1170)
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commit.c b/src/commit.c index 8030692..857c7bc 100644 --- a/src/commit.c +++ b/src/commit.c @@ -122,6 +122,7 @@ struct progress { struct apk_stats done; struct apk_stats total; struct apk_package *pkg; + int flags; }; static void progress_cb(void *ctx, size_t pkg_percent) @@ -137,9 +138,8 @@ static void progress_cb(void *ctx, size_t pkg_percent) prog->total.bytes + prog->total.packages); else percent = 0; - if (pkg_percent == 0) - percent |= APK_PRINT_PROGRESS_FORCE; - apk_print_progress(percent); + apk_print_progress(percent | prog->flags); + prog->flags = 0; } static int dump_packages(struct apk_changeset *changeset, @@ -298,6 +298,7 @@ int apk_solver_commit_changeset(struct apk_database *db, if (print_change(db, change, prog.done.changes, prog.total.changes)) { prog.pkg = change->new_pkg; + prog.flags = APK_PRINT_PROGRESS_FORCE; progress_cb(&prog, 0); if (!(apk_flags & APK_SIMULATE)) { |