X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4541554303b200955019aa477da3db9a9997ac77..bebfc824a8d5da1f05fea1c8502771ad569916fc:/apt-pkg/pkgcachegen.cc diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index c01f3b35d..075af3eec 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcachegen.cc,v 1.52 2002/07/08 03:13:30 jgg Exp $ +// $Id: pkgcachegen.cc,v 1.53.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -640,7 +640,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, } unsigned long Size = (*I)->Size(); - Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading Package Lists")); + Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading package lists")); CurrentSize += Size; if ((*I)->Merge(Gen,Progress) == false) @@ -676,9 +676,20 @@ static bool BuildCache(pkgCacheGenerator &Gen, bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, MMap **OutMap,bool AllowMem) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",6*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",12*1024*1024); + + vector Files; + for (vector::const_iterator i = List.begin(); + i != List.end(); + i++) + { + vector *Indexes = (*i)->GetIndexFiles(); + for (vector::const_iterator j = Indexes->begin(); + j != Indexes->end(); + j++) + Files.push_back (*j); + } - vector Files(List.begin(),List.end()); unsigned long EndOfSource = Files.size(); if (_system->AddStatusFiles(Files) == false) return false; @@ -698,12 +709,12 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, if (Writeable == false && AllowMem == false && CacheFile.empty() == false) return _error->Error(_("Unable to write to %s"),flNotFile(CacheFile).c_str()); - Progress.OverallProgress(0,1,1,_("Reading Package Lists")); + Progress.OverallProgress(0,1,1,_("Reading package lists")); // Cache is OK, Fin. if (CheckValidity(CacheFile,Files.begin(),Files.end(),OutMap) == true) { - Progress.OverallProgress(1,1,1,_("Reading Package Lists")); + Progress.OverallProgress(1,1,1,_("Reading package lists")); return true; } @@ -812,7 +823,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, /* */ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",4*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",8*1024*1024); vector Files; unsigned long EndOfSource = Files.size(); if (_system->AddStatusFiles(Files) == false) @@ -826,7 +837,7 @@ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap) TotalSize = ComputeSize(Files.begin()+EndOfSource,Files.end()); // Build the status cache - Progress.OverallProgress(0,1,1,_("Reading Package Lists")); + Progress.OverallProgress(0,1,1,_("Reading package lists")); pkgCacheGenerator Gen(Map.Get(),&Progress); if (_error->PendingError() == true) return false;