From 4de4200ec2717e777bbf99ed82d1b4344f078ec2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 8 Mar 2018 09:33:39 +0100 Subject: apt-pkg: Add support for zstd zstd is a compression algorithm developed by facebook. At level 19, it is about 6% worse in size than xz -6, but decompression is multiple times faster, saving about 40% install time, especially with eatmydata on cloud instances. --- apt-pkg/contrib/fileutl.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'apt-pkg/contrib/fileutl.h') diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 699b8b802..6249b7c16 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -46,6 +46,7 @@ class FileFd friend class Bz2FileFdPrivate; friend class LzmaFileFdPrivate; friend class Lz4FileFdPrivate; + friend class ZstdFileFdPrivate; friend class DirectFileFdPrivate; friend class PipedFileFdPrivate; protected: @@ -76,8 +77,19 @@ class FileFd ReadOnlyGzip, WriteAtomic = ReadWrite | Create | Atomic }; - enum CompressMode { Auto = 'A', None = 'N', Extension = 'E', Gzip = 'G', Bzip2 = 'B', Lzma = 'L', Xz = 'X', Lz4='4' }; - + enum CompressMode + { + Auto = 'A', + None = 'N', + Extension = 'E', + Gzip = 'G', + Bzip2 = 'B', + Lzma = 'L', + Xz = 'X', + Lz4 = '4', + Zstd = 'Z' + }; + inline bool Read(void *To,unsigned long long Size,bool AllowEof) { unsigned long long Jnk; -- cgit v1.2.3