summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debmetaindex.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-02-18 19:40:13 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-02-18 19:40:13 +0100
commit8e3900d0d7efc11d538b944ed1d9e4e3d5286ff6 (patch)
treefa6d444ad9e323ae6c8b3809c8d1be606210b624 /apt-pkg/deb/debmetaindex.cc
parentc0d58f4276a75f3cd6ebedf20458321a3477a048 (diff)
* apt-pkg/acquire-item.cc:
- drop support for i18n/Index file (introduced in 0.8.11) and use the Release file instead to get the Translations (Closes: #649314) * ftparchive/writer.cc: - add 'Translation-*' to the default patterns i18n/Index was never used outside debian - and even here it isn't used consistently as only 'main' has such a file. As the Release file now includes the Translation-* files we therefore drop support for i18n/Index. A version supporting it was never part of a debian release and still supporting it would mean that we get 99% of the time a 404 as response to the request anyway and confuse archive maintainers who want to provide all files APT tries to acquire.
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r--apt-pkg/deb/debmetaindex.cc36
1 files changed, 11 insertions, 25 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 5d3a80aa5..bcc617da7 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -128,7 +128,7 @@ string debReleaseIndex::TranslationIndexURISuffix(const char *Type, const string
{
string Res ="";
if (Dist[Dist.size() - 1] != '/')
- Res += Section + "/i18n/";
+ Res += Section + "/i18n/Translation-";
return Res + Type;
}
@@ -210,31 +210,17 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
if (lang.empty() == true)
return IndexTargets;
- // get the Translations:
- // - if its a dists-style repository get the i18n/Index first
- // - if its flat try to acquire files by guessing
- if (Dist[Dist.size() - 1] == '/') {
- for (std::set<std::string>::const_iterator s = sections.begin();
- s != sections.end(); ++s) {
- for (std::vector<std::string>::const_iterator l = lang.begin();
- l != lang.end(); ++l) {
- IndexTarget * Target = new OptionalIndexTarget();
- Target->ShortDesc = "Translation-" + *l;
- Target->MetaKey = TranslationIndexURISuffix(l->c_str(), *s);
- Target->URI = TranslationIndexURI(l->c_str(), *s);
- Target->Description = Info (Target->ShortDesc.c_str(), *s);
- IndexTargets->push_back(Target);
- }
- }
- } else {
- for (std::set<std::string>::const_iterator s = sections.begin();
- s != sections.end(); ++s) {
- IndexTarget * Target = new OptionalSubIndexTarget();
- Target->ShortDesc = "TranslationIndex";
- Target->MetaKey = TranslationIndexURISuffix("Index", *s);
- Target->URI = TranslationIndexURI("Index", *s);
+ // get the Translation-* files, later we will skip download of non-existent if we have an index
+ for (std::set<std::string>::const_iterator s = sections.begin();
+ s != sections.end(); ++s) {
+ for (std::vector<std::string>::const_iterator l = lang.begin();
+ l != lang.end(); ++l) {
+ IndexTarget * Target = new OptionalIndexTarget();
+ Target->ShortDesc = "Translation-" + *l;
+ Target->MetaKey = TranslationIndexURISuffix(l->c_str(), *s);
+ Target->URI = TranslationIndexURI(l->c_str(), *s);
Target->Description = Info (Target->ShortDesc.c_str(), *s);
- IndexTargets->push_back (Target);
+ IndexTargets->push_back(Target);
}
}