]> git.saurik.com Git - apt.git/commitdiff
aptconfiguration: Set default compression level to 6
authorJulian Andres Klode <jak@debian.org>
Mon, 28 Dec 2015 20:50:13 +0000 (21:50 +0100)
committerJulian Andres Klode <jak@debian.org>
Mon, 28 Dec 2015 20:50:13 +0000 (21:50 +0100)
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

index 74f88640cc54ee2a967e3044df7b9a6a17ccd602..d37ac2537fb904e45095b3fcc2773363b265d865 100644 (file)
@@ -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));