From: Alexander Gramiak Date: Mon, 24 Jun 2019 13:57:33 +0000 (+0200) Subject: Add Zstandard compression support for Tramp X-Git-Tag: emacs-27.0.90~2272 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=516761576c89e1c8ead0bd34bb104f990bb7a218;p=emacs.git 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. --- diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index e5ade9e97df..dc01f119e7a 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3441,18 +3441,21 @@ Shell archives @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 @@ -3487,8 +3490,8 @@ File archives could also be compressed, identified by an additional 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 5e134c47e42..de961988865 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1286,6 +1286,10 @@ names are adjusted to the host name from 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 d7f99667f45..8f15e37b5d8 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". @@ -154,7 +154,7 @@ "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. @@ -169,7 +169,7 @@ It must be supported by libarchive(3).") ;;;###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 d7db69a5ddb..a42ae9363ca 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4533,6 +4533,7 @@ means discard it)." ("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: