From 7f350a377e0c65a656b9b5437e27d037fd742901 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Mar 2014 14:39:18 +0100 Subject: use liblzma-dev to provide xz/lzma support We have xz/lzma support for a while, but only via an external binary provided by xz-utils. Now that the Debian archive provides xz by default and dpkg pre-depends on the library provided by liblzma-dev we can switch now to use this library as well to avoid requiring an external binary. For now the binary is in a prio:required package, but this might change in the future. API wise it is quiet similar to bz2 code expect that it doesn't provide file I/O methods, so we piece this together on our own. --- apt-pkg/aptconfiguration.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 941a9c334..6ba047560 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -462,8 +462,16 @@ const Configuration::getCompressors(bool const Cached) { #endif if (_config->Exists("Dir::Bin::xz") == false || FileExists(_config->FindFile("Dir::Bin::xz")) == true) compressors.push_back(Compressor("xz",".xz","xz","-6","-d",4)); +#ifdef HAVE_LZMA + else + compressors.push_back(Compressor("xz",".xz","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)); +#ifdef HAVE_LZMA + else + compressors.push_back(Compressor("lzma",".lzma","false", NULL, NULL, 5)); +#endif std::vector const comp = _config->FindVector("APT::Compressor"); for (std::vector::const_iterator c = comp.begin(); -- cgit v1.2.3