summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2008-10-07 20:38:46 +0200
committerMichael Vogt <mvo@debian.org>2008-10-07 20:38:46 +0200
commit2ee50e0af732ddd94222ca7cbb120341651b02f0 (patch)
tree8da51623f9e3b66498c46846d3e997ac8506b47f /apt-pkg/pkgcachegen.cc
parentc5fdf360513f8d2e5858711ff46c744cddcdeb6f (diff)
parent12f894a435b5c6766835be434be41734e1ee631c (diff)
merged from debian-sid
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index d00cd4e64..f71547f39 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -139,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; 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
@@ -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,
- const string &Lang, const MD5SumValue &md5sum,
+ const string &Lang,
+ const MD5SumValue &md5sum,
map_ptrloc Next)
{
// Get a structure