]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
More ignoring of versionless packages
[apt.git] / apt-pkg / algorithms.cc
index e1f9edb2a23bb2462525f50c814a915f0541f0d9..322c667f2d79709443f481d751656c8f0eed1512 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: algorithms.cc,v 1.34 2001/04/06 05:40:03 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