From 29550e70a70e1289d79e4f4bc86654f2a8c7d322 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Jun 2011 13:42:24 +0200 Subject: cherry pick from lp:~mvo/apt/mvo --- apt-pkg/deb/debindexfile.cc | 15 +++++---------- apt-pkg/deb/deblistparser.cc | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 1e8c04033..c9e7f1176 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -423,12 +423,10 @@ string debTranslationsIndex::IndexURI(const char *Type) const /* */ bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const { - if (TranslationsAvailable()) { - string const TranslationFile = string("Translation-").append(Language); - new pkgAcqIndexTrans(Owner, IndexURI(Language), - Info(TranslationFile.c_str()), - TranslationFile); - } + string const TranslationFile = string("Translation-").append(Language); + new pkgAcqIndexTrans(Owner, IndexURI(Language), + Info(TranslationFile.c_str()), + TranslationFile); return true; } @@ -468,9 +466,6 @@ string debTranslationsIndex::Info(const char *Type) const /*}}}*/ bool debTranslationsIndex::HasPackages() const /*{{{*/ { - if(!TranslationsAvailable()) - return false; - return FileExists(IndexFile(Language)); } /*}}}*/ @@ -510,7 +505,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { // Check the translation file, if in use string TranslationFile = IndexFile(Language); - if (TranslationsAvailable() && FileExists(TranslationFile)) + if (FileExists(TranslationFile)) { FileFd Trans(TranslationFile,FileFd::ReadOnlyGzip); debListParser TransParser(&Trans); diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b59ae8896..ff6de2d9f 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -201,7 +201,7 @@ string debListParser::DescriptionLanguage() if (Section.FindS("Description").empty() == false) return ""; - std::vector const lang = APT::Configuration::getLanguages(); + std::vector const lang = APT::Configuration::getLanguages(true); for (std::vector::const_iterator l = lang.begin(); l != lang.end(); l++) if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false) -- cgit v1.2.3