- 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));
+ std::vector<std::string> CompressorsDone;
+# 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::lz4") == false || FileExists(_config->Find("Dir::Bin::lz4")) == true)
+ APT_ADD_COMPRESSOR("lz4",".lz4","lz4","-1","-d",50)
+#ifdef HAVE_LZ4
+ else
+ APT_ADD_COMPRESSOR("lz4",".lz4","false", nullptr, nullptr, 50)
+#endif
+ if (_config->Exists("Dir::Bin::gzip") == false || FileExists(_config->Find("Dir::Bin::gzip")) == true)
+ APT_ADD_COMPRESSOR("gzip",".gz","gzip","-6n","-d",100)