summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-05-23 16:55:59 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-05-25 12:05:00 +0200
commit0e5a9bf95d5b9b3c775ed3ce6142d35815a7c7ac (patch)
tree164dbcd35084b1b17f43fbfa717d7c448a7c0d51
parent2ba86f95bfad4ec00a3b99b311d05c158162b25c (diff)
Don't set variables to conditionally override them 2 lines later
Gbp-Dch: Ignore
-rw-r--r--apt-pkg/depcache.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index aa10d8282..0f86640d5 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -2010,22 +2010,24 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache)
{
// Some info
VerIterator Ver = CandidateVerIter(Cache);
-
+
// Use a null string or the version string
if (Ver.end() == true)
CandVersion = "";
else
CandVersion = Ver.VerStr();
-
+
// Find the current version
- CurVersion = "";
if (Pkg->CurrentVer != 0)
CurVersion = Pkg.CurrentVer().VerStr();
+ else
+ CurVersion = "";
// Figure out if its up or down or equal
- Status = Ver.CompareVer(Pkg.CurrentVer());
if (Pkg->CurrentVer == 0 || Pkg->VersionList == 0 || CandidateVer == 0)
- Status = 2;
+ Status = 2;
+ else
+ Status = Ver.CompareVer(Pkg.CurrentVer());
}
/*}}}*/
// Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/