]> git.saurik.com Git - apt.git/commitdiff
[ABI break] merge patch from Jonathan Thomas to speed up the
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 28 Jul 2011 11:55:15 +0000 (13:55 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 28 Jul 2011 11:55:15 +0000 (13:55 +0200)
depcache by caching the install-recommends and install-suggests
values

apt-pkg/depcache.cc
apt-pkg/depcache.h
debian/changelog

index 72a0bb542a404467ff48f601254eba94eed837ed..ee93150695e55d9f1d1075878d3c9f8df5d611d4 100644 (file)
@@ -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;
 }
index adc010c28d932bbf3bc54f925b1398389cf10aab..d935c18872c1cb21bf05caa256998615433d0e9f 100644 (file)
@@ -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:
index 08635cae77af422207fd13ca62ab4db1f1e5c93f..e4d1cdd542c3ac81642b7e9cb31690e4a43c36bb 100644 (file)
@@ -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