X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/5b1df5f0f00dff79fe3297270efa0626f80a02da..6ce7261259132f11fc93af104754e8cfc540bf13:/apt-pkg/pkgcachegen.cc?ds=sidebyside diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 3f02725c1..397c19829 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -10,10 +10,6 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/pkgcachegen.h" -#endif - #define APT_COMPATIBILITY 986 #include @@ -143,10 +139,21 @@ bool pkgCacheGenerator::MergeList(ListParser &List, { pkgCache::DescIterator Desc = Ver.DescriptionList(); map_ptrloc *LastDesc = &Ver->DescriptionList; - - for (; Desc.end() == false; LastDesc = &Desc->NextDesc, Desc++) + bool duplicate=false; + + // don't add a new description if we have one for the given + // md5 && language + for ( ; Desc.end() == false; Desc++) + if (MD5SumValue(Desc.md5()) == CurMd5 && + Desc.LanguageCode() == List.DescriptionLanguage()) + duplicate=true; + if(duplicate) + continue; + + for (Desc = Ver.DescriptionList(); + Desc.end() == false; + LastDesc = &Desc->NextDesc, Desc++) { - if (MD5SumValue(Desc.md5()) == CurMd5) { // Add new description @@ -154,7 +161,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, Desc->ParentPkg = Pkg.Index(); if (NewFileDesc(Desc,List) == false) - return _error->Error(_("Error occured while processing %s (NewFileDesc1)"),PackageName.c_str()); + return _error->Error(_("Error occurred while processing %s (NewFileDesc1)"),PackageName.c_str()); break; } } @@ -246,7 +253,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, Desc->ParentPkg = Pkg.Index(); if (NewFileDesc(Desc,List) == false) - return _error->Error(_("Error occured while processing %s (NewFileDesc2)"),PackageName.c_str()); + return _error->Error(_("Error occurred while processing %s (NewFileDesc2)"),PackageName.c_str()); } FoundFileDeps |= List.HasFileDeps(); @@ -438,7 +445,8 @@ bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc, // --------------------------------------------------------------------- /* This puts a description structure in the linked list */ map_ptrloc pkgCacheGenerator::NewDescription(pkgCache::DescIterator &Desc, - const string &Lang, const MD5SumValue &md5sum, + const string &Lang, + const MD5SumValue &md5sum, map_ptrloc Next) { // Get a structure @@ -678,8 +686,10 @@ static bool CheckValidity(const string &CacheFile, FileIterator Start, if ((*Start)->Exists() == false) { +#if 0 // mvo: we no longer give a message here (Default Sources spec) _error->WarningE("stat",_("Couldn't stat source package list %s"), (*Start)->Describe().c_str()); +#endif continue; } @@ -783,7 +793,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, MMap **OutMap,bool AllowMem) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",12*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",24*1024*1024); vector Files; for (vector::const_iterator i = List.begin(); @@ -930,7 +940,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, /* */ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap) { - unsigned long MapSize = _config->FindI("APT::Cache-Limit",8*1024*1024); + unsigned long MapSize = _config->FindI("APT::Cache-Limit",20*1024*1024); vector Files; unsigned long EndOfSource = Files.size(); if (_system->AddStatusFiles(Files) == false)