]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debmetaindex.cc
Fix a segfault in the version merger introduced in the previous patch:
[apt.git] / apt-pkg / deb / debmetaindex.cc
index f3ab6960cd67d42b32f8e5c37629c88f0e551dce..520e94a807a0d80cb187ed0bab9bea062b2ca843 100644 (file)
@@ -5,6 +5,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/error.h>
 
 using namespace std;
 #include <apt-pkg/error.h>
 
 using namespace std;
@@ -170,13 +171,20 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool GetAll) const
                     new indexRecords (Dist));
 
    // Queue the translations
                     new indexRecords (Dist));
 
    // Queue the translations
+   std::vector<std::string> const lang = APT::Configuration::getLanguages(true);
    for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
        I != SectionEntries.end(); I++) {
 
       if((*I)->IsSrc)
         continue;
    for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
        I != SectionEntries.end(); I++) {
 
       if((*I)->IsSrc)
         continue;
-      debTranslationsIndex i = debTranslationsIndex(URI,Dist,(*I)->Section);
-      i.GetIndexes(Owner);
+
+      for (vector<string>::const_iterator l = lang.begin();
+               l != lang.end(); l++)
+      {
+       if (*l == "none") continue;
+       debTranslationsIndex i = debTranslationsIndex(URI,Dist,(*I)->Section,(*l).c_str());
+       i.GetIndexes(Owner);
+      }
    }
 
    return true;
    }
 
    return true;
@@ -202,6 +210,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles()
       return Indexes;
 
    Indexes = new vector <pkgIndexFile*>;
       return Indexes;
 
    Indexes = new vector <pkgIndexFile*>;
+   std::vector<std::string> const lang = APT::Configuration::getLanguages(true);
    for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
        I != SectionEntries.end(); I++) {
       if ((*I)->IsSrc)
    for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
        I != SectionEntries.end(); I++) {
       if ((*I)->IsSrc)
@@ -209,7 +218,12 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles()
       else 
       {
          Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted()));
       else 
       {
          Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted()));
-        Indexes->push_back(new debTranslationsIndex(URI, Dist, (*I)->Section));
+
+        for (vector<string>::const_iterator l = lang.begin();
+               l != lang.end(); l++) {
+           if (*l == "none") continue;
+           Indexes->push_back(new debTranslationsIndex(URI,Dist,(*I)->Section,(*l).c_str()));
+        }
       }
    }
 
       }
    }