From 8a0c00b85600991cdb9aa05902defec6ac44b777 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Tue, 10 Dec 2019 15:47:38 +0700 Subject: Use libarchive for all compression --- src/libutil/compression.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libutil/compression.hh') diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index dd666a4e1..192cb3e91 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -8,14 +8,18 @@ namespace nix { -struct CompressionSink : BufferedSink +struct CompressionSink : BufferedSink, FinishSink { - virtual void finish() = 0; + using BufferedSink::operator (); + using BufferedSink::write; + using FinishSink::finish; }; +std::unique_ptr makeDecompressionSource(Source & prev); + ref decompress(const std::string & method, const std::string & in); -ref makeDecompressionSink(const std::string & method, Sink & nextSink); +std::unique_ptr makeDecompressionSink(const std::string & method, Sink & nextSink); ref compress(const std::string & method, const std::string & in, const bool parallel = false); -- cgit v1.2.3 From 15f4d4fd437070e898982c510228b6e8eea17b7d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 Apr 2021 13:51:00 +0200 Subject: Drop libbz2 / zlib / lzma dependency + style fixes --- src/libutil/compression.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libutil/compression.hh') diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index 192cb3e91..a140f8be2 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -10,9 +10,9 @@ namespace nix { struct CompressionSink : BufferedSink, FinishSink { - using BufferedSink::operator (); - using BufferedSink::write; - using FinishSink::finish; + using BufferedSink::operator (); + using BufferedSink::write; + using FinishSink::finish; }; std::unique_ptr makeDecompressionSource(Source & prev); -- cgit v1.2.3 From 53857552278173641c0489a3196c51aab769bac8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Apr 2021 10:23:20 +0200 Subject: Remove makeDecompressionSource() This function doesn't support all compression methods (i.e. 'none' and 'br') so it shouldn't be exposed. Also restore the original decompress() as a wrapper around makeDecompressionSink(). --- src/libutil/compression.hh | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/libutil/compression.hh') diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index a140f8be2..338a0d9f2 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -15,8 +15,6 @@ struct CompressionSink : BufferedSink, FinishSink using FinishSink::finish; }; -std::unique_ptr makeDecompressionSource(Source & prev); - ref decompress(const std::string & method, const std::string & in); std::unique_ptr makeDecompressionSink(const std::string & method, Sink & nextSink); -- cgit v1.2.3 From 03bb8f84e0f54d9980b160785f98da8ae07196fe Mon Sep 17 00:00:00 2001 From: Tom Bereknyei Date: Tue, 12 Oct 2021 02:14:36 -0400 Subject: Add compression level for NARs Based off on @dtzWill's #2276 --- src/libutil/compression.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libutil/compression.hh') diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index 338a0d9f2..9b1e4a9d4 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -19,9 +19,9 @@ ref decompress(const std::string & method, const std::string & in); std::unique_ptr makeDecompressionSink(const std::string & method, Sink & nextSink); -ref compress(const std::string & method, const std::string & in, const bool parallel = false); +ref compress(const std::string & method, const std::string & in, const bool parallel = false, int level = -1); -ref makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false); +ref makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false, int level = -1); MakeError(UnknownCompressionMethod, Error); -- cgit v1.2.3