summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
commit518763f630873e35398d2537ebfabf97b5aea489 (patch)
treed7b36ef50a9301ac8099edc48a0ab9e563125198 /apt-pkg/aptconfiguration.cc
parent8c6d0ba4e25baa7b0dffc4e06e76fc63a71e656f (diff)
parente6a12579e9e5d5735eda450cf2bb3986d828ab65 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r--apt-pkg/aptconfiguration.cc25
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);
}