summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2014-03-26 09:32:53 +0200
committerPanu Matilainen <pmatilai@redhat.com>2014-09-05 14:48:02 +0300
commit7631aea1f2a073895f225169731971d01fb54f6b (patch)
treed3e5b699a889922e46bc26bbf58a056d89ca3b11
parentbf58bc92ff755448c2542996851976cc39cc63e1 (diff)
downloadrpm-7631aea1f2a073895f225169731971d01fb54f6b.tar.gz
Move progress state variable out of the function to permit resetting
(cherry picked from commit 902b24c214d76073216ffe8f2df13c3e28f4876a)
-rw-r--r--lib/rpminstall.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index a3623fd3a..21715e8d8 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -22,6 +22,7 @@ static int rpmcliHashesCurrent = 0;
static int rpmcliHashesTotal = 0;
static int rpmcliProgressCurrent = 0;
static int rpmcliProgressTotal = 0;
+static int rpmcliProgressState = 0;
/**
* Print a CLI progress bar.
@@ -103,7 +104,6 @@ void * rpmShowProgress(const void * arg,
void * rc = NULL;
const char * filename = (const char *)key;
static FD_t fd = NULL;
- static int state = -1;
switch (what) {
case RPMCALLBACK_INST_OPEN_FILE:
@@ -134,8 +134,8 @@ void * rpmShowProgress(const void * arg,
case RPMCALLBACK_INST_START:
case RPMCALLBACK_UNINST_START:
- if (state != what) {
- state = what;
+ if (rpmcliProgressState != what) {
+ rpmcliProgressState = what;
if (flags & INSTALL_HASH) {
if (what == RPMCALLBACK_INST_START) {
fprintf(stdout, _("Updating / installing...\n"));
@@ -185,7 +185,7 @@ void * rpmShowProgress(const void * arg,
rpmcliProgressTotal = 1;
rpmcliProgressCurrent = 0;
rpmcliPackagesTotal = total;
- state = what;
+ rpmcliProgressState = what;
if (!(flags & INSTALL_LABEL))
break;
if (flags & INSTALL_HASH)