X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e23e673308e24ccbed5afa04179ade52d408db87..2ac6ce927cda2847baf8e71a74e595e6b82c6d98:/apt-pkg/algorithms.cc diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index c679e76f6..11f5b5671 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1329,7 +1329,7 @@ void pkgMarkPackage(pkgDepCache &Cache, } -bool pkgMarkUsed(pkgDepCache &Cache) +bool pkgMarkUsed(pkgDepCache &Cache, InRootSetFunc func) { bool follow_recommends; bool follow_suggests; @@ -1343,14 +1343,16 @@ bool pkgMarkUsed(pkgDepCache &Cache) // init vars follow_recommends=_config->FindB("APT::AutoRemove::RecommendsImportant",false); - follow_suggests=_config->FindB("APT::AutoRemove::SuggestsImportend", false); + follow_suggests=_config->FindB("APT::AutoRemove::SuggestsImportant", false); // do the mark part for(pkgCache::PkgIterator p=Cache.PkgBegin(); !p.end(); ++p) { - if(!(Cache[p].Flags & pkgCache::Flag::Auto) || - (p->Flags & pkgCache::Flag::Essential)) + if( (func != NULL ? (*func)(p) : false) || + !(Cache[p].Flags & pkgCache::Flag::Auto) || + (p->Flags & pkgCache::Flag::Essential)) + { if(Cache[p].Keep() && !p.CurrentVer().end()) pkgMarkPackage(Cache, p, p.CurrentVer(),