From 1a3296c0bd67c46c6ff791345b6101edcb97e778 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 28 Dec 2015 21:50:13 +0100 Subject: aptconfiguration: Set default compression level to 6 Since commit 7a68effcb904b4424b54a30e448b6f2560cd1078, the xz and lzma compressors read the level of compression they shall use. A default of -9 is too much for them, this will use 674 MB, according to the xz manual page. Level -6 on the other hand only needs 94 MB memory for compression. This causes autopkgtest failures in the test-compressed-indexes test, as not enough memory exists to proceed. Change the other compression levels to 6 as well: The gzip and bzip2 FileFd backends do not read them, and use their code's default level which is 6, so do the same for external methods. --- apt-pkg/aptconfiguration.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 74f88640c..d37ac2537 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -42,7 +42,7 @@ static void setDefaultConfigurationForCompressors() { _config->Set("APT::Compressor::lzma::Binary", "xz"); if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) { _config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma"); - _config->Set("APT::Compressor::lzma::CompressArg::", "-9"); + _config->Set("APT::Compressor::lzma::CompressArg::", "-6"); } if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) { _config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma"); @@ -52,7 +52,7 @@ static void setDefaultConfigurationForCompressors() { _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) { _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix="); - _config->Set("APT::Compressor::lzma::CompressArg::", "-9"); + _config->Set("APT::Compressor::lzma::CompressArg::", "-6"); } if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) { _config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix="); @@ -366,7 +366,7 @@ const Configuration::getCompressors(bool const Cached) { 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)); + compressors.push_back(Compressor("gzip",".gz","gzip","-6n","-d",2)); #ifdef HAVE_ZLIB else compressors.push_back(Compressor("gzip",".gz","false", NULL, NULL, 2)); @@ -378,13 +378,13 @@ const Configuration::getCompressors(bool const Cached) { 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)); + compressors.push_back(Compressor("bzip2",".bz2","bzip2","-6","-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)); + compressors.push_back(Compressor("lzma",".lzma","lzma","-6","-d",5)); #ifdef HAVE_LZMA else compressors.push_back(Compressor("lzma",".lzma","false", NULL, NULL, 5)); -- cgit v1.2.3