From: David Kalnischkies Date: Thu, 12 Aug 2010 14:45:41 +0000 (+0200) Subject: purge packages in 'rc' state, thanks Rogier! (Closes: #150831) X-Git-Tag: 0.8.0^2~4^2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/6cb1583a73d7f009f05f8a2b20a177fa31249241 purge packages in 'rc' state, thanks Rogier! (Closes: #150831) --- diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index dac0d42a8..6ca9e1402 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -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); } }; /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 0a6a7a8fa..e7df55743 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 11 Aug 2010 19:36:21 +0200