From e93b4028825648bb29074a1422287e2cb435b0de Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 29 Aug 2015 19:55:19 +0200 Subject: try xz instead of bz2 first for compressed files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apt-pkg/aptconfiguration.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apt-pkg/aptconfiguration.cc') 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"); @@ -448,18 +448,18 @@ const Configuration::getCompressors(bool const Cached) { #ifdef HAVE_ZLIB 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)); -- cgit v1.2.3