diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-04-20 09:52:17 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-04-20 09:52:17 +0200 |
commit | 858fd39f6adea6353e9367759cf48ae2b439ffcc (patch) | |
tree | 19e07eef0838e796a2efcf5247a5629d576204ce /apt-pkg/aptconfiguration.cc | |
parent | f0633b216cd019ac0c508a46440943c91f07f65d (diff) |
* apt-pkg/aptconfiguration.cc:
- if the compressor is not installed, but we link against it's
library accept it as a CompressionType (Closes: #669328)
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index d72b0c5ae..f0cd8ebc0 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -47,6 +47,7 @@ const Configuration::getCompressionTypes(bool const &Cached) { _config->CndSet("Acquire::CompressionTypes::gz","gzip"); setDefaultConfigurationForCompressors(); + std::vector<APT::Configuration::Compressor> const compressors = getCompressors(); // accept non-list order as override setting for config settings on commandline std::string const overrideOrder = _config->Find("Acquire::CompressionTypes::Order",""); @@ -63,12 +64,12 @@ const Configuration::getCompressionTypes(bool const &Cached) { if (_config->Exists(std::string("Acquire::CompressionTypes::").append(*o)) == false) continue; // ignore types we have no app ready to use - 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) - continue; - } + std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin(); + for (; c != compressors.end(); ++c) + if (c->Name == *o) + break; + if (c == compressors.end()) + continue; types.push_back(*o); } @@ -84,12 +85,12 @@ 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 - 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) - continue; - } + std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin(); + for (; c != compressors.end(); ++c) + if (c->Name == Types->Value) + break; + if (c == compressors.end()) + continue; types.push_back(Types->Tag); } |