summaryrefslogtreecommitdiff
path: root/src/fr-command-tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fr-command-tar.c')
-rw-r--r--src/fr-command-tar.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index 3c47399..ffa911d 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -827,6 +827,11 @@ get_uncompressed_name (FrCommandTar *c_tar,
if (file_extension_is (e_filename, ".tar.7z"))
new_name[l - 3] = 0;
}
+ else if (is_mime_type (comm->mime_type, "application/x-zstd-compressed-tar")) {
+ /* X.tar.zst --> X.tar */
+ if (file_extension_is (e_filename, ".tar.zst"))
+ new_name[l - 4] = 0;
+ }
return new_name;
}
@@ -980,6 +985,14 @@ fr_command_tar_uncompress (FrCommand *comm)
fr_process_add_arg (comm->process, tmp_name);
fr_process_end_command (comm->process);
}
+ else if (is_mime_type (comm->mime_type, "application/x-zstd-compressed-tar")) {
+ fr_process_begin_command (comm->process, "zstd");
+ fr_process_set_begin_func (comm->process, begin_func__uncompress, comm);
+ fr_process_add_arg (comm->process, "-f");
+ fr_process_add_arg (comm->process, "-d");
+ fr_process_add_arg (comm->process, tmp_name);
+ fr_process_end_command (comm->process);
+ }
}
c_tar->uncomp_filename = get_uncompressed_name (c_tar, tmp_name);
@@ -1009,6 +1022,7 @@ const char *tar_mime_types[] = { "application/x-compressed-tar",
"application/x-lzop-compressed-tar",
"application/x-tarz",
"application/x-xz-compressed-tar",
+ "application/x-zstd-compressed-tar",
NULL };
@@ -1084,6 +1098,10 @@ fr_command_tar_get_capabilities (FrCommand *comm,
}
}
}
+ else if (is_mime_type (mime_type, "application/x-zstd-compressed-tar")) {
+ if (is_program_available ("zstd", check_command))
+ capabilities |= FR_COMMAND_CAN_READ;
+ }
return capabilities;
}
@@ -1137,6 +1155,8 @@ fr_command_tar_get_packages (FrCommand *comm,
return PACKAGES ("tar,lzop");
else if (is_mime_type (mime_type, "application/x-7z-compressed-tar"))
return PACKAGES ("tar,p7zip");
+ else if (is_mime_type (mime_type, "application/x-zstd-compressed-tar"))
+ return PACKAGES ("tar,zstd");
return NULL;
}