]> git.saurik.com Git - apt.git/commitdiff
purge packages in 'rc' state, thanks Rogier! (Closes: #150831)
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 Aug 2010 14:45:41 +0000 (16:45 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 Aug 2010 14:45:41 +0000 (16:45 +0200)
cmdline/apt-get.cc
debian/changelog

index dac0d42a8d2f1a2b47876aa967d100729e008fc2..6ca9e14024d46cba25cc360aadf699b01eeca189 100644 (file)
@@ -844,9 +844,11 @@ struct TryToRemove {
    pkgCacheFile* Cache;
    pkgProblemResolver* Fix;
    bool FixBroken;
+   bool PurgePkgs;
    unsigned long AutoMarkChanged;
 
-   TryToRemove(pkgCacheFile &Cache, pkgProblemResolver &PM) : Cache(&Cache), Fix(&PM) {};
+   TryToRemove(pkgCacheFile &Cache, pkgProblemResolver &PM) : Cache(&Cache), Fix(&PM),
+                               PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
 
    void operator() (pkgCache::VerIterator const &Ver)
    {
@@ -856,10 +858,11 @@ struct TryToRemove {
       Fix->Protect(Pkg);
       Fix->Remove(Pkg);
 
-      if (Pkg->CurrentVer == 0)
+      if ((Pkg->CurrentVer == 0 && PurgePkgs == false) ||
+         (PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled))
         ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str());
       else
-        Cache->GetDepCache()->MarkDelete(Pkg,_config->FindB("APT::Get::Purge",false));
+        Cache->GetDepCache()->MarkDelete(Pkg, PurgePkgs);
    }
 };
                                                                        /*}}}*/
index 0a6a7a8fa4fcd513aa3dac380c84b4b8f5f019d9..e7df5574382e9d205ef6f6a488335585330f7174 100644 (file)
@@ -32,6 +32,7 @@ apt (0.8.0~pre1) UNRELASED; urgency=low
   * cmdline/apt-get.cc:
     - let APT::Get::Arch-Only in build-dep default to false again
       (Closes: #592628) Thanks Mohamed Amine IL Idrissi for report!
+    - purge packages in 'rc' state, thanks Rogier! (Closes: #150831)
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 11 Aug 2010 19:36:21 +0200