]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/pkgcachegen.cc:
authoregon <egon@debian-vm>
Tue, 23 Sep 2008 05:31:23 +0000 (07:31 +0200)
committeregon <egon@debian-vm>
Tue, 23 Sep 2008 05:31:23 +0000 (07:31 +0200)
  - do not add multiple identical descriptions for the same
    language (closes: #400768)

apt-pkg/pkgcache.cc
apt-pkg/pkgcachegen.cc
debian/changelog

index 133899a274fa8728f0a43181ea90426eab92ebda..8eb62089a8369af4c23f89b07045a71804ed5169 100644 (file)
@@ -622,7 +622,8 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
    for (; Desc.end() == false; Desc++)
       if (pkgIndexFile::LanguageCode() == Desc.LanguageCode())
         break;
    for (; Desc.end() == false; Desc++)
       if (pkgIndexFile::LanguageCode() == Desc.LanguageCode())
         break;
-   if (Desc.end() == true) Desc = DescDefault;
+   if (Desc.end() == true) 
+      Desc = DescDefault;
    return Desc;
 };
 
    return Desc;
 };
 
index d00cd4e646b120641cf5cde2359956860419f3d2..f71547f3925e8e6b24186ab2859caa2e3fc7a9f4 100644 (file)
@@ -139,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
@@ -434,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
index 68ff35efc3cdd21cd2df3eed7d879ab5387aea04..1b3be907e7e54d1dde8666c59c406874ad4fcfc1 100644 (file)
@@ -1,3 +1,11 @@
+apt (0.7.15~exp2) experimental; urgency=low
+
+  * apt-pkg/pkgcachegen.cc:
+    - do not add multiple identical descriptions for the same 
+      language (closes: #400768)
+
+ -- Michael Vogt <mvo@debian.org>  Tue, 23 Sep 2008 07:29:59 +0200
+
 apt (0.7.15~exp1) experimental; urgency=low
 
   [ Christian Perrier ]
 apt (0.7.15~exp1) experimental; urgency=low
 
   [ Christian Perrier ]