From 320854985be0fe14491385ca349783ab8a9d7797 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 21 Sep 2006 02:02:13 +0200 Subject: * apt-pkg/depcache.cc: - do not change the auto-flag in MarkKeep() to prevent side-effects in interactive package managers when a package is marked for remove first and then unmarked again. the old code removed the auto-flag, the new code will retain this information - a package can be garbage even if it is already marked for removal --- apt-pkg/depcache.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 369eae70b..2bae94026 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -701,9 +701,18 @@ void pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser) // We dont even try to keep virtual packages.. if (Pkg->VersionList == 0) return; - + +#if 0 // reseting the autoflag here means we lose the + // auto-mark information if a user selects a package for removal + // but changes his mind then and sets it for keep again + // - this makes sense as default when all Garbage dependencies + // are automatically marked for removal (as aptitude does). + // setting a package for keep then makes it no longer autoinstalled + // for all other use-case this action is rather suprising if(FromUser && !P.Marked) P.Flags &= ~Flag::Auto; +#endif + RemoveSizes(Pkg); RemoveStates(Pkg); @@ -1265,8 +1274,7 @@ bool pkgDepCache::Sweep() StateCache &state=PkgState[p->ID]; // if it is not marked and it is installed, it's garbage - if(!state.Marked && (!p.CurrentVer().end() || state.Install()) && - !state.Delete()) + if(!state.Marked && (!p.CurrentVer().end() || state.Install())) { state.Garbage=true; if(_config->FindB("Debug::pkgAutoRemove",false)) -- cgit v1.2.3