]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcachegen.cc
debian/changelog: make the build-dep changelog entry match (debian) reality
[apt.git] / apt-pkg / pkgcachegen.cc
index 8ec6a171975ce1a28e7eee26beadbcc1a32adf38..f71547f3925e8e6b24186ab2859caa2e3fc7a9f4 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/pkgcachegen.h"
-#endif
-
 #define APT_COMPATIBILITY 986
 
 #include <apt-pkg/pkgcachegen.h>
 #define APT_COMPATIBILITY 986
 
 #include <apt-pkg/pkgcachegen.h>
@@ -143,10 +139,21 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
         {
            pkgCache::DescIterator Desc = Ver.DescriptionList();
            map_ptrloc *LastDesc = &Ver->DescriptionList;
         {
            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; LastDesc = &Desc->NextDesc, 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
               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)
                  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;
               }
            }
                  break;
               }
            }
@@ -246,7 +253,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       Desc->ParentPkg = Pkg.Index();
 
       if (NewFileDesc(Desc,List) == false)
       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();
    }
 
    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,
 // ---------------------------------------------------------------------
 /* 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
                                            map_ptrloc Next)
 {
    // Get a structure
@@ -785,7 +793,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
                        MMap **OutMap,bool AllowMem)
 {
 bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
                        MMap **OutMap,bool AllowMem)
 {
-   unsigned long MapSize = _config->FindI("APT::Cache-Limit",16*1024*1024);
+   unsigned long MapSize = _config->FindI("APT::Cache-Limit",24*1024*1024);
    
    vector<pkgIndexFile *> Files;
    for (vector<metaIndex *>::const_iterator i = List.begin();
    
    vector<pkgIndexFile *> Files;
    for (vector<metaIndex *>::const_iterator i = List.begin();
@@ -932,7 +940,7 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
 /* */
 bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
 {
 /* */
 bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
 {
-   unsigned long MapSize = _config->FindI("APT::Cache-Limit",12*1024*1024);
+   unsigned long MapSize = _config->FindI("APT::Cache-Limit",20*1024*1024);
    vector<pkgIndexFile *> Files;
    unsigned long EndOfSource = Files.size();
    if (_system->AddStatusFiles(Files) == false)
    vector<pkgIndexFile *> Files;
    unsigned long EndOfSource = Files.size();
    if (_system->AddStatusFiles(Files) == false)