>From 7f8c658d5423947cc9b88d137cec5a2e2e53afd1 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sat, 29 Dec 2018 11:54:24 -0600 Subject: [PATCH 3/5] Add Zstandard compression support for Tramp * lisp/net/tramp-archive.el (tramp-archive-suffixes) (tramp-archive-compression-suffixes): Add zstd compression suffixes. * lisp/net/tramp-sh.el (tramp-inline-compress-commands): Add zstd (de)compression commands. --- doc/misc/tramp.texi | 9 ++++++--- etc/NEWS | 4 ++++ lisp/net/tramp-archive.el | 8 ++++---- lisp/net/tramp-sh.el | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index c9f1e75d8e..d491d04918 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3332,18 +3332,21 @@ Archive file names @cindex @file{shar} file archive suffix @cindex file archive suffix @file{shar} -@item @samp{.tar}, @samp{.tbz}, @samp{.tgz}, @samp{.tlz}, @samp{.txz} --- +@item @samp{.tar}, @samp{.tbz}, @samp{.tgz}, @samp{.tlz}, @samp{.txz}, +@samp{.tzst} --- (Compressed) tape archives @cindex @file{tar} file archive suffix @cindex @file{tbz} file archive suffix @cindex @file{tgz} file archive suffix @cindex @file{tlz} file archive suffix @cindex @file{txz} file archive suffix +@cindex @file{tzst} file archive suffix @cindex file archive suffix @file{tar} @cindex file archive suffix @file{tbz} @cindex file archive suffix @file{tgz} @cindex file archive suffix @file{tlz} @cindex file archive suffix @file{txz} +@cindex file archive suffix @file{tzst} @item @samp{.warc} --- Web archives @@ -3378,8 +3381,8 @@ Archive file names compression suffix. Valid compression suffixes are listed in the constant @code{tramp-archive-compression-suffixes}. They are @samp{.bz2}, @samp{.gz}, @samp{.lrz}, @samp{.lz}, @samp{.lz4}, -@samp{.lzma}, @samp{.lzo}, @samp{.uu}, @samp{.xz} and @samp{.Z}. A -valid archive file name would be +@samp{.lzma}, @samp{.lzo}, @samp{.uu}, @samp{.xz}, @samp{.Z}, and +@samp{.zst}. A valid archive file name would be @file{/path/to/dir/file.tar.gz/dir/file}. Even several suffixes in a row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. diff --git a/etc/NEWS b/etc/NEWS index af99e29e40..e65823413b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -927,6 +927,10 @@ ad-hoc multi-hop file names must match the previous hop. timeout, after which the underlying session is disabled. This is for security reasons. ++++ +*** Zstandard compression is now supported when using libarchive 3.3 +or newer. + ** Rcirc --- diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 03b1eed970..910982978d 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -77,8 +77,8 @@ ;; File archives could also be compressed, identified by an additional ;; compression suffix. Valid compression suffixes are listed in the ;; constant `tramp-archive-compression-suffixes'. They are ".bz2", -;; ".gz", ".lrz", ".lz", ".lz4", ".lzma", ".lzo", ".uu", ".xz" and -;; ".Z". A valid archive file name would be +;; ".gz", ".lrz", ".lz", ".lz4", ".lzma", ".lzo", ".uu", ".xz",".Z", +;; and .zst. A valid archive file name would be ;; "/path/to/dir/file.tar.gz/dir/file". Even several suffixes in a ;; row are possible, like "/path/to/dir/file.tar.gz.uu/dir/file". @@ -149,7 +149,7 @@ tramp-archive-suffixes "rar" ;; RAR archives. "rpm" ;; Red Hat packages. "shar" ;; Shell archives. Not in libarchive testsuite. - "tar" "tbz" "tgz" "tlz" "txz" ;; (Compressed) tape archives. + "tar" "tbz" "tgz" "tlz" "txz" ".tzst" ;; (Compressed) tape archives. "warc" ;; Web archives. "xar" ;; macOS XAR archives. Not in libarchive testsuite. "xpi" ;; XPInstall Mozilla addons. Not in libarchive testsuite. @@ -164,7 +164,7 @@ tramp-archive-suffixes ;;;###autoload (defconst tramp-archive-compression-suffixes - '("bz2" "gz" "lrz" "lz" "lz4" "lzma" "lzo" "uu" "xz" "Z") + '("bz2" "gz" "lrz" "lz" "lz4" "lzma" "lzo" "uu" "xz" "Z" "zst") "List of suffixes which indicate a compressed file. It must be supported by libarchive(3).") diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 991a210263..332cd356bf 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4542,6 +4542,7 @@ tramp-inline-compress-commands ("env GZIP= gzip" "env GZIP= gzip -d") ("bzip2" "bzip2 -d") ("xz" "xz -d") + ("zstd --rm" "zstd -d --rm") ("compress" "compress -d")) "List of compress and decompress commands for inline transfer. Each item is a list that looks like this: -- 2.20.1