Add support for lzma, zstd and auto detection of compression methods.
Signed-off-by: Zixun LI <admin(a)hifiphile.com>
---
daemon/tar.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/daemon/tar.c b/daemon/tar.c
index 57b5b37ff..347add341 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -159,6 +159,12 @@ do_tar_in (const char *dir, const char *compress, int xattrs, int
selinux, int a
filter = " --xz";
else if (STREQ (compress, "lzop"))
filter = " --lzop";
+ else if (STREQ (compress, "lzma"))
+ filter = " --lzma";
+ else if (STREQ (compress, "zstd"))
+ filter = " --zstd";
+ else if (STREQ (compress, "auto"))
+ filter = " --auto-compress";
else {
reply_with_error ("unknown compression type: %s", compress);
return -1;
@@ -312,6 +318,12 @@ do_tar_out (const char *dir, const char *compress, int numericowner,
filter = " --xz";
else if (STREQ (compress, "lzop"))
filter = " --lzop";
+ else if (STREQ (compress, "lzma"))
+ filter = " --lzma";
+ else if (STREQ (compress, "zstd"))
+ filter = " --zstd";
+ else if (STREQ (compress, "auto"))
+ filter = " --auto-compress";
else {
reply_with_error ("unknown compression type: %s", compress);
return -1;
--
2.40.1