From 8f3ba4e8708cb72be19dacc2af4f601ee5fea292 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 13:31:29 +0200 Subject: do not pollute namespace in the headers with using (Closes: #500198) --- apt-pkg/aptconfiguration.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index e1bc94f31..a0566e05e 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -59,10 +59,10 @@ const Configuration::getCompressionTypes(bool const &Cached) { if ((*o).empty() == true) continue; // ignore types we have no method ready to use - if (_config->Exists(string("Acquire::CompressionTypes::").append(*o)) == false) + if (_config->Exists(std::string("Acquire::CompressionTypes::").append(*o)) == false) continue; // ignore types we have no app ready to use - string const appsetting = string("Dir::Bin::").append(*o); + std::string const appsetting = std::string("Dir::Bin::").append(*o); if (_config->Exists(appsetting) == true) { std::string const app = _config->FindFile(appsetting.c_str(), ""); if (app.empty() == false && FileExists(app) == false) @@ -83,7 +83,7 @@ const Configuration::getCompressionTypes(bool const &Cached) { if (std::find(types.begin(),types.end(),Types->Tag) != types.end()) continue; // ignore types we have no app ready to use - string const appsetting = string("Dir::Bin::").append(Types->Value); + std::string const appsetting = std::string("Dir::Bin::").append(Types->Value); if (appsetting.empty() == false && _config->Exists(appsetting) == true) { std::string const app = _config->FindFile(appsetting.c_str(), ""); if (app.empty() == false && FileExists(app) == false) @@ -95,7 +95,7 @@ const Configuration::getCompressionTypes(bool const &Cached) { // add the special "uncompressed" type if (std::find(types.begin(), types.end(), "uncompressed") == types.end()) { - string const uncompr = _config->FindFile("Dir::Bin::uncompressed", ""); + std::string const uncompr = _config->FindFile("Dir::Bin::uncompressed", ""); if (uncompr.empty() == true || FileExists(uncompr) == true) types.push_back("uncompressed"); } @@ -441,7 +441,7 @@ Configuration::Compressor::Compressor(char const *name, char const *extension, char const *binary, char const *compressArg, char const *uncompressArg, unsigned short const cost) { - std::string const config = string("APT:Compressor::").append(name).append("::"); + std::string const config = std::string("APT:Compressor::").append(name).append("::"); Name = _config->Find(std::string(config).append("Name"), name); Extension = _config->Find(std::string(config).append("Extension"), extension); Binary = _config->Find(std::string(config).append("Binary"), binary); -- cgit v1.2.3 From 7cb28948317e0d326c8663ec3c9ce995d5bf65e8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Oct 2011 22:45:22 +0200 Subject: * apt-pkg/deb/debmetaindex.cc: - none is a separator, not a language: no need for Index (Closes: #624218) * apt-pkg/aptconfiguration.cc: - do not builtin languages only if none is forced (Closes: #643787) --- apt-pkg/aptconfiguration.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index a0566e05e..7441b452c 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -142,7 +142,7 @@ std::vector const Configuration::getLanguages(bool const &All, for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) { string const name = Ent->d_name; size_t const foundDash = name.rfind("-"); - size_t const foundUnderscore = name.rfind("_"); + size_t const foundUnderscore = name.rfind("_", foundDash); if (foundDash == string::npos || foundUnderscore == string::npos || foundDash <= foundUnderscore || name.substr(foundUnderscore+1, foundDash-(foundUnderscore+1)) != "Translation") @@ -153,7 +153,7 @@ std::vector const Configuration::getLanguages(bool const &All, // Skip unusual files, like backups or that alike string::const_iterator s = c.begin(); for (;s != c.end(); ++s) { - if (isalpha(*s) == 0) + if (isalpha(*s) == 0 && *s != '_') break; } if (s != c.end()) @@ -234,6 +234,8 @@ std::vector const Configuration::getLanguages(bool const &All, codes = environment; } else if (forceLang != "none") codes.push_back(forceLang); + else //if (forceLang == "none") + builtin.clear(); allCodes = codes; for (std::vector::const_iterator b = builtin.begin(); b != builtin.end(); ++b) -- cgit v1.2.3