]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
merged from david
[apt.git] / apt-pkg / aptconfiguration.cc
index f0cd8ebc088502ea0b33fc08fbb76205b978205d..0fd470ed5aa6d5a73260fe5713870cdf8e2e0fba 100644 (file)
@@ -61,12 +61,14 @@ const Configuration::getCompressionTypes(bool const &Cached) {
                if ((*o).empty() == true)
                        continue;
                // ignore types we have no method ready to use
-               if (_config->Exists(std::string("Acquire::CompressionTypes::").append(*o)) == false)
+               std::string const method = std::string("Acquire::CompressionTypes::").append(*o);
+               if (_config->Exists(method) == false)
                        continue;
                // ignore types we have no app ready to use
+               std::string const app = _config->Find(method);
                std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin();
                for (; c != compressors.end(); ++c)
-                       if (c->Name == *o)
+                       if (c->Name == app)
                                break;
                if (c == compressors.end())
                        continue;
@@ -475,18 +477,18 @@ const Configuration::getCompressors(bool const Cached) {
 
        setDefaultConfigurationForCompressors();
 
-       compressors.push_back(Compressor(".", "", "", "", "", 1));
+       compressors.push_back(Compressor(".", "", "", NULL, NULL, 1));
        if (_config->Exists("Dir::Bin::gzip") == false || FileExists(_config->FindFile("Dir::Bin::gzip")) == true)
                compressors.push_back(Compressor("gzip",".gz","gzip","-9n","-d",2));
 #ifdef HAVE_ZLIB
        else
-               compressors.push_back(Compressor("gzip",".gz","false", "", "", 2));
+               compressors.push_back(Compressor("gzip",".gz","false", NULL, NULL, 2));
 #endif
        if (_config->Exists("Dir::Bin::bzip2") == false || FileExists(_config->FindFile("Dir::Bin::bzip2")) == true)
                compressors.push_back(Compressor("bzip2",".bz2","bzip2","-9","-d",3));
 #ifdef HAVE_BZ2
        else
-               compressors.push_back(Compressor("bzip2",".bz2","false", "", "", 3));
+               compressors.push_back(Compressor("bzip2",".bz2","false", NULL, NULL, 3));
 #endif
        if (_config->Exists("Dir::Bin::xz") == false || FileExists(_config->FindFile("Dir::Bin::xz")) == true)
                compressors.push_back(Compressor("xz",".xz","xz","-6","-d",4));