X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a6bfe58397c488da3b4fff94b27f80e6b3dbdab2..c24972cb9ecaca477099c695f0929a0dd1415a51:/apt-pkg/algorithms.cc?ds=inline diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 0fcad42eb..322c667f2 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: algorithms.cc,v 1.33 2001/03/23 07:53:19 jgg Exp $ +// $Id: algorithms.cc,v 1.36 2001/05/27 03:46:10 jgg Exp $ /* ###################################################################### Algorithms - A set of misc algorithms @@ -213,11 +213,14 @@ bool pkgApplyStatus(pkgDepCache &Cache) { for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) { + if (I->VersionList == 0) + continue; + // Only choice for a ReInstReq package is to reinstall if (I->InstState == pkgCache::State::ReInstReq || I->InstState == pkgCache::State::HoldReInstReq) { - if (I.CurrentVer().Downloadable() == true) + if (I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) Cache.MarkKeep(I); else { @@ -238,7 +241,7 @@ bool pkgApplyStatus(pkgDepCache &Cache) re-unpacked (probably) */ case pkgCache::State::UnPacked: case pkgCache::State::HalfConfigured: - if (I.CurrentVer().Downloadable() == true || + if ((I->CurrentVer != 0 && I.CurrentVer().Downloadable() == true) || I.State() != pkgCache::PkgIterator::NeedsUnpack) Cache.MarkKeep(I); else @@ -378,7 +381,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) if (Cache.BrokenCount() != 0) return false; - // We loop indefinately to get the minimal set size. + // We loop for 10 tries to get the minimal set size. bool Change = false; unsigned int Count = 0; do