From 4c022382384f01c73eb5112160c436960e7a74f5 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 3 Jan 2012 11:49:32 +0200 Subject: Eliminate pointless rpmcliPackagesTotal fiddling - The total number of packages equals transaction order count, which is passed as total to transaction start callback. In particular messing with this from rpmtsAddInstallElement() is just stupid. - This will break callers that are relying on rpmcliPackagesTotal value outside a running transaction, but that's just stupid anyway. The correct way to get number of elements in transaction set is calling rpmtsNElements(), which has been there for a good part of a decade. --- lib/depends.c | 3 --- lib/rpminstall.c | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 6ad97aa60..208aca5de 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -4,8 +4,6 @@ #include "system.h" -#include /* XXX rpmcliPackagesTotal */ - #include /* rpmVersionCompare, rpmlib provides */ #include #include @@ -347,7 +345,6 @@ int rpmtsAddInstallElement(rpmts ts, Header h, tsmem->order[oc] = p; if (oc == tsmem->orderCount) { tsmem->orderCount++; - rpmcliPackagesTotal++; } rpmalAdd(tsmem->addedPackages, p); diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 3b64e63ef..6082db026 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -167,6 +167,7 @@ void * rpmShowProgress(const void * arg, rpmcliHashesCurrent = 0; rpmcliProgressTotal = 1; rpmcliProgressCurrent = 0; + rpmcliPackagesTotal = total; if (!(flags & INSTALL_LABEL)) break; if (flags & INSTALL_HASH) @@ -381,8 +382,6 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv) if (fileArgv == NULL) goto exit; - rpmcliPackagesTotal = 0; - (void) rpmtsSetFlags(ts, ia->transFlags); relocations = ia->relocations; -- cgit v1.2.3