summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-01-07 20:32:09 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-01-08 15:40:01 +0100
commit0179cfa83cf0042235eda41db7f35c420781c63e (patch)
treea1b49bb2d40ae34a5d06139e7ecd203ba0733c8f /apt-pkg/aptconfiguration.cc
parent912a61312a0463b46d6560756c89146f59daaab6 (diff)
keep compressed indexes in a low-cost format
Downloading and storing are two different operations were different compression types can be preferred. For downloading we provide the choice via Acquire::CompressionTypes::Order as there is a choice to be made between download size and speed – and limited by whats available in the repository. Storage on the other hand has all compressions currently supported by apt available and to reduce runtime of tools accessing these files the compression type should be a low-cost format in terms of decompression. apt traditionally stores its indexes uncompressed on disk, but has options to keep them compressed. Now that apt downloads additional files we also deal with files which simply can't be stored uncompressed as they are just too big (like Contents for apt-file). Traditionally they are downloaded in a low-cost format (gz) as repositories do not provide other formats, but there might be even lower-cost formats and for download we could introduce higher-cost in the repositories. Downloading an entire index potentially requires recompression to another format, so an update takes potentially longer – but big files are usually updated via pdiffs which has to de- and re-compress anyhow and does it on the fly anyhow, so there is no extra time needed and in general it seems to be benefitial to invest the time in update to save time later on file access.
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r--apt-pkg/aptconfiguration.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index 53f29df79..01ae5a642 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -37,6 +37,7 @@ static void setDefaultConfigurationForCompressors() {
// Set default application paths to check for optional compression types
_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+ _config->CndSet("Dir::Bin::lz4", "/usr/bin/lz4");
if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
_config->Set("APT::Compressor::lzma::Binary", "xz");
@@ -79,6 +80,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
_config->CndSet("Acquire::CompressionTypes::bz2","bzip2");
_config->CndSet("Acquire::CompressionTypes::lzma","lzma");
_config->CndSet("Acquire::CompressionTypes::gz","gzip");
+ _config->CndSet("Acquire::CompressionTypes::lz4","lz4");
setDefaultConfigurationForCompressors();
std::vector<APT::Configuration::Compressor> const compressors = getCompressors();