]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debmetaindex.cc
* apt-pkg/packagemanager.cc:
[apt.git] / apt-pkg / deb / debmetaindex.cc
index e1f8219e361b314c066084d18e80ec87558cfa8f..5d3a80aa56cc114c82ef0717637965512de3c59c 100644 (file)
@@ -1,14 +1,19 @@
 // ijones, walters
+#include <config.h>
 
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/debindexfile.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/indexrecords.h>
+#include <apt-pkg/sourcelist.h>
 #include <apt-pkg/error.h>
 
 #include <set>
+#include <algorithm>
 
 using namespace std;
 
@@ -197,7 +202,11 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
                }
        }
 
-       std::vector<std::string> const lang = APT::Configuration::getLanguages(true);
+       std::vector<std::string> lang = APT::Configuration::getLanguages(true);
+       std::vector<std::string>::iterator lend = std::remove(lang.begin(), lang.end(), "none");
+       if (lend != lang.end())
+               lang.erase(lend);
+
        if (lang.empty() == true)
                return IndexTargets;
 
@@ -209,7 +218,6 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
                     s != sections.end(); ++s) {
                        for (std::vector<std::string>::const_iterator l = lang.begin();
                             l != lang.end(); ++l) {
-                               if (*l == "none") continue;
                                IndexTarget * Target = new OptionalIndexTarget();
                                Target->ShortDesc = "Translation-" + *l;
                                Target->MetaKey = TranslationIndexURISuffix(l->c_str(), *s);
@@ -221,7 +229,7 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
        } else {
                for (std::set<std::string>::const_iterator s = sections.begin();
                     s != sections.end(); ++s) {
-                       IndexTarget * Target = new OptionalIndexTarget();
+                       IndexTarget * Target = new OptionalSubIndexTarget();
                        Target->ShortDesc = "TranslationIndex";
                        Target->MetaKey = TranslationIndexURISuffix("Index", *s);
                        Target->URI = TranslationIndexURI("Index", *s);