summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fr-command-tar.c20
-rw-r--r--src/fr-init.c2
2 files changed, 22 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;
}
diff --git a/src/fr-init.c b/src/fr-init.c
index 34b1611..2abf248 100644
--- a/src/fr-init.c
+++ b/src/fr-init.c
@@ -111,6 +111,7 @@ FrMimeTypeDescription mime_type_desc[] = {
{ "application/x-xz-compressed-tar", ".tar.xz", N_("Tar compressed with xz (.tar.xz)"), 0 },
{ "application/x-zoo", ".zoo", N_("Zoo (.zoo)"), 0 },
{ "application/x-zstd", ".zst", N_("Zstandard (.zst)"), 0 },
+ { "application/x-zstd-compressed-tar", ".tar.zst", N_("Tar compressed with zstd (.tar.zst)"), 0 },
{ "application/zip", ".zip", N_("Zip (.zip)"), 0 },
{ NULL, NULL, NULL, 0 }
};
@@ -165,6 +166,7 @@ FrExtensionType file_ext_type[] = {
{ ".tar.lzo", "application/x-lzop-compressed-tar" },
{ ".tar.xz", "application/x-xz-compressed-tar" },
{ ".tar.Z", "application/x-tarz" },
+ { ".tar.zst", "application/x-zstd-compressed-tar" },
{ ".taz", "application/x-tarz" },
{ ".tbz", "application/x-bzip-compressed-tar" },
{ ".tbz2", "application/x-bzip-compressed-tar" },