Sfoglia il codice sorgente

* apt-pkg/depcache.cc:
- now that apt-get purge works on 'rc' packages let the MarkDelete
pass this purge forward to the non-pseudo package for pseudos

David Kalnischkies 16 anni fa
parent
commit
35db2f3539
2 ha cambiato i file con 14 aggiunte e 2 eliminazioni
  1. 10 1
      apt-pkg/depcache.cc
  2. 4 1
      debian/changelog

+ 10 - 1
apt-pkg/depcache.cc

@@ -1149,7 +1149,7 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge,
       return;
 
    if (DebugMarker == true)
-      std::clog << OutputInDepth(Depth) << "MarkDelete " << Pkg << " FU=" << FromUser << std::endl;
+      std::clog << OutputInDepth(Depth) << (rPurge ? "MarkPurge " : "MarkDelete ") << Pkg << " FU=" << FromUser << std::endl;
 
    RemoveSizes(Pkg);
    RemoveStates(Pkg);
@@ -1167,6 +1167,15 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge,
    // if we remove the pseudo package, we also need to remove the "real"
    if (Pkg->CurrentVer != 0 && Pkg.CurrentVer().Pseudo() == true)
       MarkDelete(Pkg.Group().FindPkg("all"), rPurge, Depth+1, FromUser);
+   else if (rPurge == true && Pkg->CurrentVer == 0 &&
+	    Pkg->CurrentState != pkgCache::State::NotInstalled &&
+	    strcmp(Pkg.Arch(), "all") != 0)
+   {
+      PkgIterator const allPkg = Pkg.Group().FindPkg("all");
+      if (allPkg.end() == false && allPkg->CurrentVer == 0 &&
+	  allPkg->CurrentState != pkgCache::State::NotInstalled)
+	 MarkDelete(allPkg, rPurge, Depth+1, FromUser);
+   }
 }
 									/*}}}*/
 // DepCache::IsDeleteOk - check if it is ok to remove this package	/*{{{*/

+ 4 - 1
debian/changelog

@@ -19,8 +19,11 @@ apt (0.8.1) UNRELEASED; urgency=low
   * cmdline/apt-get.cc:
     - remove direct calls of ReadMainList and use the wrapper instead
       to protect us from useless re-reads and two-times notice display
+  * apt-pkg/depcache.cc:
+    - now that apt-get purge works on 'rc' packages let the MarkDelete
+      pass this purge forward to the non-pseudo package for pseudos
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 26 Aug 2010 22:39:37 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 27 Aug 2010 12:02:15 +0200
 
 apt (0.8.0) unstable; urgency=low