]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
Purge support
[apt.git] / apt-pkg / packagemanager.cc
index 9e2eee969e9edda3e6f0f85bf9bfce1f9e9f5d16..126caef930f3c4221eed40007aac6212bbeb449d 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: packagemanager.cc,v 1.16 1999/07/04 23:22:53 jgg Exp $
+// $Id: packagemanager.cc,v 1.18 1999/07/10 04:58:42 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -152,7 +152,9 @@ bool pkgPackageManager::CreateOrderList()
       // Not interesting
       if ((Cache[I].Keep() == true || 
          Cache[I].InstVerIter(Cache) == I.CurrentVer()) && 
-         I.State() == pkgCache::PkgIterator::NeedsNothing)
+         I.State() == pkgCache::PkgIterator::NeedsNothing &&
+         (I.Purge() != false || Cache[I].Mode != pkgDepCache::ModeDelete ||
+          (Cache[I].iFlags & pkgDepCache::Purge) != pkgDepCache::Purge))
         continue;
       
       // Append it to the list
@@ -375,7 +377,7 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
       return true;
 
    List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
-   return Remove(Pkg);
+   return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
 }
                                                                        /*}}}*/
 // PM::SmartUnPack - Install helper                                    /*{{{*/