summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-08-29 19:55:19 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-29 19:55:19 +0200
commite93b4028825648bb29074a1422287e2cb435b0de (patch)
treeb7de2ff893ec7d9b421e96b05fa507c1921675ba /apt-pkg/aptconfiguration.cc
parent9adb9778d11db138d645e037e092db1fb64b5d4a (diff)
try xz instead of bz2 first for compressed files
xz has pretty much won "the compressor war" and e.g. the Debian archive doesn't even distribute bz2 anymore in favor of 'xz' and 'gz', so by changing the default order we have a more realistic --print-uris behavior as it will always show the first compressor. In practice this effects repositories without a Release file (very bad, we don't want to support them anymore anyhow) as xz will be tried before bz2 now [which is probably not available, but so might be bz2…] AND repositories which provide both, bz2 and xz (which isn't too common) in sofar as apt will now download xz instead of bz2. Users with special needs can stick with bz2 as first compressor tried with Acquire::CompressionTypes::Order:: "bz2"; (see man apt.conf) – but users with special needs usually prefer "gz" anyhow, so the realworld change is expected to be very low.
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r--apt-pkg/aptconfiguration.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index ed68244c6..69f6f6f8d 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -74,8 +74,8 @@ const Configuration::getCompressionTypes(bool const &Cached) {
}
// setup the defaults for the compressiontypes => method mapping
- _config->CndSet("Acquire::CompressionTypes::bz2","bzip2");
_config->CndSet("Acquire::CompressionTypes::xz","xz");
+ _config->CndSet("Acquire::CompressionTypes::bz2","bzip2");
_config->CndSet("Acquire::CompressionTypes::lzma","lzma");
_config->CndSet("Acquire::CompressionTypes::gz","gzip");
@@ -449,17 +449,17 @@ const Configuration::getCompressors(bool const Cached) {
else
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", 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));
+ compressors.push_back(Compressor("xz",".xz","xz","-6","-d",3));
#ifdef HAVE_LZMA
else
- compressors.push_back(Compressor("xz",".xz","false", NULL, NULL, 4));
+ compressors.push_back(Compressor("xz",".xz","false", NULL, NULL, 3));
+#endif
+ if (_config->Exists("Dir::Bin::bzip2") == false || FileExists(_config->FindFile("Dir::Bin::bzip2")) == true)
+ compressors.push_back(Compressor("bzip2",".bz2","bzip2","-9","-d",4));
+#ifdef HAVE_BZ2
+ else
+ compressors.push_back(Compressor("bzip2",".bz2","false", NULL, NULL, 4));
#endif
if (_config->Exists("Dir::Bin::lzma") == false || FileExists(_config->FindFile("Dir::Bin::lzma")) == true)
compressors.push_back(Compressor("lzma",".lzma","lzma","-9","-d",5));