Преглед изворни кода

* apt-pkg/aptconfiguration.cc:
- if the compressor is not installed, but we link against it's
library accept it as a CompressionType (Closes: #669328)

David Kalnischkies пре 14 година
родитељ
комит
858fd39f6a
2 измењених фајлова са 18 додато и 13 уклоњено
  1. 13 12
      apt-pkg/aptconfiguration.cc
  2. 5 1
      debian/changelog

+ 13 - 12
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);
 	}
 

+ 5 - 1
debian/changelog

@@ -5,13 +5,17 @@ apt (0.9.2) unstable; urgency=low
     - only treat the native apt as essential by default (Closes: #669377)
   * apt-pkg/contrib/fileutl.cc:
     - redirect stderr from compressors to /dev/null
+  * apt-pkg/aptconfiguration.cc:
+    - if the compressor is not installed, but we link against it's
+      library accept it as a CompressionType (Closes: #669328)
+
 
   [ Malcolm Scott ]
   * apt-pkg/packagemanager.cc:
     - iterate over all pre-depends or-group member instead of looping
       endlessly over the first member in SmartUnpack (LP: #985852)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 19 Apr 2012 22:38:02 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 20 Apr 2012 09:52:01 +0200
 
 apt (0.9.1) unstable; urgency=low