summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-07 11:52:58 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-07 11:52:58 +0200
commit3a089a0178ee7b3adff28dcc8749735898201e27 (patch)
tree94f379647920e4782308f1e01f7a7cf0e973a850 /apt-pkg/depcache.cc
parent94915e3424601c8fa935c527122d65f1f0878fe2 (diff)
parent1d7229332a7707e9abb341a7ce75ce332df54420 (diff)
* apt-pkg/depcache.cc:
- merged from install-recommends * debian/apt.conf.ubuntu: - added "APT::Install-Recommends-Section" to "metapackages" * renamed apt.conf.autoremove -> apt.conf.ubuntu
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc26
1 files changed, 21 insertions, 5 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 4d193dc2e..740d14426 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -873,6 +873,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
bool found=false;
VerIterator instVer = Pkg.CurrentVer();
if(!instVer.end())
+ {
for (DepIterator D = instVer.DependsList(); D.end() != true; D++)
{
//FIXME: deal better with or-groups(?)
@@ -881,9 +882,10 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
if(IsImportantDep(D) && Start.TargetPkg() == D.TargetPkg())
found=true;
}
- // this is a new dep if it was not found to be already
- // a important dep of the installed pacakge
- isNewImportantDep = !found;
+ // this is a new dep if it was not found to be already
+ // a important dep of the installed pacakge
+ isNewImportantDep = !found;
+ }
}
if(isNewImportantDep)
if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true)
@@ -1330,8 +1332,22 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep)
{
if(Dep.IsCritical())
return true;
- else if(Dep->Type == pkgCache::Dep::Recommends)
- return _config->FindB("APT::Install-Recommends", false);
+ else if(Dep->Type == pkgCache::Dep::Recommends)
+ {
+ if ( _config->FindB("APT::Install-Recommends", false))
+ return true;
+ // we suport a special mode to only install-recommends for certain
+ // sections
+ // FIXME: this is a meant as a temporarly solution until the
+ // recommends are cleaned up
+ string s = _config->Find("APT::Install-Recommends-Section","");
+ if(s.size() > 0)
+ {
+ const char *sec = Dep.TargetPkg().Section();
+ if (sec && strcmp(sec, s.c_str()) == 0)
+ return true;
+ }
+ }
else if(Dep->Type == pkgCache::Dep::Suggests)
return _config->FindB("APT::Install-Suggests", false);