summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-08-13 16:09:25 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-08-13 16:09:25 +0200
commit4c2f0104d89569e7315b1c1570157c9d2c43161a (patch)
treeccceca3d1efa8ec0b2f393ebe8c9fe39f9b317df /cmdline/apt-get.cc
parente4fa1bca08e6a1df1b6101a1c096f44879b4575e (diff)
parent09a10f9cd2661d28b2ff53d59a0936563cfe1cf7 (diff)
- let the problem resolver install packages to fix or-groups
as a needed remove nuked another or-member (helps for #591882) - purge packages in 'rc' state, thanks Rogier! (Closes: #150831)
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc9
1 files changed, 6 insertions, 3 deletions
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);
}
};
/*}}}*/