[pacman-dev] [PATCH] Fix integrity check status when installing from file
When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process. Signed-off-by: Allan McRae <allan@archlinux.org> --- I'm not sure this is the best way to fix this issue... But given the loop is essentially doing nothing in this case, I do not see the point in updating the progress bar as we go. lib/libalpm/sync.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b1eab55..bbb319c 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -957,6 +957,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) pmpkg_t *spkg = i->data; int percent = (current * 100) / numtargs; if(spkg->origin == PKG_FROM_FILE) { + current++; continue; /* pkg_load() has been already called, this package is valid */ } PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", percent, -- 1.7.3.5
On Sun, Jan 16, 2011 at 6:38 AM, Allan McRae <allan@archlinux.org> wrote:
When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process.
Signed-off-by: Allan McRae <allan@archlinux.org> ---
I'm not sure this is the best way to fix this issue... But given the loop is essentially doing nothing in this case, I do not see the point in updating the progress bar as we go. For now this seems fine... it would make more sense if we allowed something like `pacman -S mypackage foobar pkg-file-xxx.pkg.tar.gz`.
lib/libalpm/sync.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b1eab55..bbb319c 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -957,6 +957,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) pmpkg_t *spkg = i->data; int percent = (current * 100) / numtargs; if(spkg->origin == PKG_FROM_FILE) { + current++; continue; /* pkg_load() has been already called, this package is valid */ } PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", percent, -- 1.7.3.5
On Tue, Jan 18, 2011 at 1:01 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Sun, Jan 16, 2011 at 6:38 AM, Allan McRae <allan@archlinux.org> wrote:
When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process.
Signed-off-by: Allan McRae <allan@archlinux.org> ---
I'm not sure this is the best way to fix this issue... But given the loop is essentially doing nothing in this case, I do not see the point in updating the progress bar as we go. For now this seems fine... it would make more sense if we allowed something like `pacman -S mypackage foobar pkg-file-xxx.pkg.tar.gz`.
And on that note, I've taken this patch but also "added" current++ calls in the two other early "continue" loop exits- by instead making the counter the responsibility of the for loop. Revised patch on the way. -Dan
When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process. Signed-off-by: Dan McGee <dan@archlinux.org> --- lib/libalpm/sync.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b1eab55..dbd1506 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -953,7 +953,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) EVENT(trans, PM_TRANS_EVT_INTEGRITY_START, NULL, NULL); errors = 0; - for(i = trans->add; i; i = i->next) { + for(i = trans->add; i; i = i->next, current++) { pmpkg_t *spkg = i->data; int percent = (current * 100) / numtargs; if(spkg->origin == PKG_FROM_FILE) { @@ -986,7 +986,6 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) pkgfile->reason = spkg->reason; /* copy over install reason */ i->data = pkgfile; _alpm_pkg_free_trans(spkg); /* spkg has been removed from the target list */ - current++; } PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", 100, numtargs, current); -- 1.7.3.5
On 19/01/11 05:20, Dan McGee wrote:
When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process.
Signed-off-by: Dan McGee<dan@archlinux.org>
Signoff-off-by: Allan This seems a much more sane way to do this.
participants (3)
-
Allan McRae
-
Dan McGee
-
Dan McGee