Browse Source

Increased cache allocation
Author: jgg
Date: 1999-10-29 04:49:37 GMT
Increased cache allocation

Arch Librarian 22 years ago
parent
commit
67db871e3a
4 changed files with 16 additions and 6 deletions
  1. 9 5
      apt-pkg/pkgcachegen.cc
  2. 1 0
      debian/changelog
  3. 4 0
      doc/apt.conf.5.yo
  4. 2 1
      doc/examples/apt.conf

+ 9 - 5
apt-pkg/pkgcachegen.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: pkgcachegen.cc,v 1.41 1999/07/26 17:46:07 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.42 1999/10/29 04:49:37 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Package Cache Generator - Generator for the cache structure.
    Package Cache Generator - Generator for the cache structure.
@@ -724,6 +724,8 @@ bool pkgGenerateSrcCache(pkgSourceList &List,OpProgress &Progress,
    xstatus files into it. */
    xstatus files into it. */
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress)
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress)
 {
 {
+   unsigned long MapSize = _config->FindI("APT::Cache-Limit",4*1024*1024);
+   
    Progress.OverallProgress(0,1,1,"Reading Package Lists");
    Progress.OverallProgress(0,1,1,"Reading Package Lists");
    
    
    string CacheFile = _config->FindFile("Dir::Cache::pkgcache");
    string CacheFile = _config->FindFile("Dir::Cache::pkgcache");
@@ -736,7 +738,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress)
       string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
       string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
       FileFd SCacheF(SCacheFile,FileFd::WriteEmpty);
       FileFd SCacheF(SCacheFile,FileFd::WriteEmpty);
       FileFd CacheF(CacheFile,FileFd::WriteEmpty);
       FileFd CacheF(CacheFile,FileFd::WriteEmpty);
-      DynamicMMap Map(CacheF,MMap::Public);
+      DynamicMMap Map(CacheF,MMap::Public,MapSize);
       if (_error->PendingError() == true)
       if (_error->PendingError() == true)
 	 return false;
 	 return false;
 
 
@@ -767,7 +769,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress)
 
 
    FileFd SCacheF(SCacheFile,FileFd::ReadOnly);
    FileFd SCacheF(SCacheFile,FileFd::ReadOnly);
    FileFd CacheF(CacheFile,FileFd::WriteEmpty);
    FileFd CacheF(CacheFile,FileFd::WriteEmpty);
-   DynamicMMap Map(CacheF,MMap::Public);
+   DynamicMMap Map(CacheF,MMap::Public,MapSize);
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
       return false;
       return false;
    
    
@@ -794,6 +796,8 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress)
    creates a memory block and puts the cache in there. */
    creates a memory block and puts the cache in there. */
 MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
 MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
 {
 {
+   unsigned long MapSize = _config->FindI("APT::Cache-Limit",4*1024*1024);
+   
    /* If the cache file is writeable this is just a wrapper for
    /* If the cache file is writeable this is just a wrapper for
       MakeStatusCache */
       MakeStatusCache */
    string CacheFile = _config->FindFile("Dir::Cache::pkgcache");
    string CacheFile = _config->FindFile("Dir::Cache::pkgcache");
@@ -828,7 +832,7 @@ MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
    // Rebuild the source and package caches   
    // Rebuild the source and package caches   
    if (SrcOk == false)
    if (SrcOk == false)
    {
    {
-      DynamicMMap *Map = new DynamicMMap(MMap::Public);
+      DynamicMMap *Map = new DynamicMMap(MMap::Public,MapSize);
       if (_error->PendingError() == true)
       if (_error->PendingError() == true)
       {
       {
 	 delete Map;
 	 delete Map;
@@ -875,7 +879,7 @@ MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
    // We use the source cache to generate the package cache
    // We use the source cache to generate the package cache
    string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
    string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
    FileFd SCacheF(SCacheFile,FileFd::ReadOnly);
    FileFd SCacheF(SCacheFile,FileFd::ReadOnly);
-   DynamicMMap *Map = new DynamicMMap(MMap::Public);
+   DynamicMMap *Map = new DynamicMMap(MMap::Public,MapSize);
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
    {
    {
       delete Map;
       delete Map;

+ 1 - 0
debian/changelog

@@ -28,6 +28,7 @@ apt (0.3.13.1) unstable; urgency=low
   * Remove is not 'sticky'. Closes: #48392
   * Remove is not 'sticky'. Closes: #48392
   * Slightly more accurate 'can not find package' message. Closes: #48311
   * Slightly more accurate 'can not find package' message. Closes: #48311
   * --trivial-only and --no-remove. Closes: #48518
   * --trivial-only and --no-remove. Closes: #48518
+  * Increased the cache size. Closes: #47648
   
   
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700
  
  

+ 4 - 0
doc/apt.conf.5.yo

@@ -76,6 +76,10 @@ packages. SUCH A LOOP SHOULD NEVER EXIST AND IS A GRAVE BUG. This option will
 work if the essential packages are not tar, gzip, libc, dpkg, bash or 
 work if the essential packages are not tar, gzip, libc, dpkg, bash or 
 anything that those packages depend on.
 anything that those packages depend on.
 
 
+dit(bf(Cache-Limit))
+APT uses a fixed size memory mapped cache file to store the 'available'
+information. This sets the size of that cache.
+
 dit(bf(Get))
 dit(bf(Get))
 The Get subsection controls the bf(apt-get(8)) tool, please see its
 The Get subsection controls the bf(apt-get(8)) tool, please see its
 documentation for more information about the options here.
 documentation for more information about the options here.

+ 2 - 1
doc/examples/apt.conf

@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.40 1999/10/28 05:54:46 jgg Exp $
+// $Id: apt.conf,v 1.41 1999/10/29 04:49:37 jgg Exp $
 /* This file is an index of all APT configuration directives. It should
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    NOT actually be used as a real config file, though it is a completely
    valid file. Most of the options have sane default values, unless
    valid file. Most of the options have sane default values, unless
@@ -62,6 +62,7 @@ APT
   Clean-Installed "true";
   Clean-Installed "true";
   Immediate-Configure "true";      // DO NOT turn this off, see the man page
   Immediate-Configure "true";      // DO NOT turn this off, see the man page
   Force-LoopBreak "false";         // DO NOT turn this on, see the man page
   Force-LoopBreak "false";         // DO NOT turn this on, see the man page
+  Cache-Limit "4194304";
 };
 };
 
 
 // Options for the downloading routines
 // Options for the downloading routines