]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcachegen.cc
add the various foldmarkers in apt-pkg & cmdline (no code change)
[apt.git] / apt-pkg / pkgcachegen.cc
index b2725a99df890d1b33793fb3234e91f98a44f1fc..7833d6476645e905820d5d00c4a0ba3886df41f1 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/pkgcachegen.h"
-#endif
-
 #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;
-
-           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
@@ -644,7 +652,6 @@ unsigned long pkgCacheGenerator::WriteUniqString(const char *S,
    return ItemP->String;
 }
                                                                        /*}}}*/
-
 // CheckValidity - Check that a cache is up-to-date                    /*{{{*/
 // ---------------------------------------------------------------------
 /* This just verifies that each file in the list of index files exists,
@@ -785,7 +792,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<pkgIndexFile *> Files;
    for (vector<metaIndex *>::const_iterator i = List.begin();
@@ -932,7 +939,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<pkgIndexFile *> Files;
    unsigned long EndOfSource = Files.size();
    if (_system->AddStatusFiles(Files) == false)