summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--apt-pkg/depcache.h10
-rw-r--r--debian/changelog3
3 files changed, 14 insertions, 3 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 72a0bb542..ee9315069 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1511,7 +1511,7 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep)
return true;
else if(Dep->Type == pkgCache::Dep::Recommends)
{
- if ( _config->FindB("APT::Install-Recommends", false))
+ if (InstallRecommends)
return true;
// we suport a special mode to only install-recommends for certain
// sections
@@ -1522,7 +1522,7 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep)
return true;
}
else if(Dep->Type == pkgCache::Dep::Suggests)
- return _config->FindB("APT::Install-Suggests", false);
+ return InstallSuggests;
return false;
}
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index adc010c28..d935c1887 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -258,13 +258,21 @@ class pkgDepCache : protected pkgCache::Namespace
class Policy
{
public:
-
+ Policy() {
+ InstallRecommends = _config->FindB("APT::Install-Recommends", false);
+ InstallSuggests = _config->FindB("APT::Install-Suggests", false);
+ }
+
virtual VerIterator GetCandidateVer(PkgIterator const &Pkg);
virtual bool IsImportantDep(DepIterator const &Dep);
virtual signed short GetPriority(PkgIterator const &Pkg);
virtual signed short GetPriority(PkgFileIterator const &File);
virtual ~Policy() {};
+
+ private:
+ bool InstallRecommends;
+ bool InstallSuggests;
};
private:
diff --git a/debian/changelog b/debian/changelog
index 08635cae7..e4d1cdd54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,9 @@ apt (0.8.16~exp4) UNRELEASED; urgency=low
* [ABI break] merged patch from Jonathan Thomas to have a new
RecordField() function in the pkgRecorder parser. Many thanks
Thomas
+ * [ABI break] merge patch from Jonathan Thomas to speed up the
+ depcache by caching the install-recommends and install-suggests
+ values
-- Julian Andres Klode <jak@debian.org> Wed, 20 Jul 2011 16:23:55 +0200