diff options
author | Julian Andres Klode <jak@debian.org> | 2018-04-15 18:57:53 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2018-04-15 18:57:53 +0000 |
commit | 1cbb4c95f3fdd0872a7f1cb0f970f50a68c13959 (patch) | |
tree | a4d862020a09309efa6801d791216649368bd263 /apt-pkg/aptconfiguration.cc | |
parent | e441cba86f9aa50c9e785d9aa45ae0a43ac5c123 (diff) | |
parent | 7cf73b7a1e4f127098cae5b8593cd1d0c675e4a4 (diff) |
Merge branch 'pu/zstd' into 'master'
pu/zstd
See merge request apt-team/apt!8
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 0421ea949..61e53ec3a 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -39,6 +39,7 @@ static void setDefaultConfigurationForCompressors() { _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); _config->CndSet("Dir::Bin::xz", "/usr/bin/xz"); _config->CndSet("Dir::Bin::lz4", "/usr/bin/lz4"); + _config->CndSet("Dir::Bin::zstd", "/usr/bin/zstd"); if (FileExists(_config->Find("Dir::Bin::xz")) == true) { _config->Set("Dir::Bin::lzma", _config->Find("Dir::Bin::xz")); _config->Set("APT::Compressor::lzma::Binary", "xz"); @@ -67,6 +68,7 @@ static void setDefaultConfigurationForCompressors() { _config->CndSet("Acquire::CompressionTypes::lzma","lzma"); _config->CndSet("Acquire::CompressionTypes::gz","gzip"); _config->CndSet("Acquire::CompressionTypes::lz4","lz4"); + _config->CndSet("Acquire::CompressionTypes::zst", "zstd"); } /*}}}*/ // getCompressionTypes - Return Vector of usable compressiontypes /*{{{*/ @@ -369,6 +371,12 @@ const Configuration::getCompressors(bool const Cached) { # define APT_ADD_COMPRESSOR(NAME, EXT, BINARY, ARG, DEARG, COST) \ { CompressorsDone.push_back(NAME); compressors.emplace_back(NAME, EXT, BINARY, ARG, DEARG, COST); } APT_ADD_COMPRESSOR(".", "", "", nullptr, nullptr, 0) + if (_config->Exists("Dir::Bin::zstd") == false || FileExists(_config->Find("Dir::Bin::zstd")) == true) + APT_ADD_COMPRESSOR("zstd", ".zst", "zstd", "-19", "-d", 60) +#ifdef HAVE_ZSTD + else + APT_ADD_COMPRESSOR("zstd", ".zst", "false", nullptr, nullptr, 60) +#endif if (_config->Exists("Dir::Bin::lz4") == false || FileExists(_config->Find("Dir::Bin::lz4")) == true) APT_ADD_COMPRESSOR("lz4",".lz4","lz4","-1","-d",50) #ifdef HAVE_LZ4 |