summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-15 22:56:17 +0200
committerlukefromdc <[email protected]>2019-10-03 03:31:21 +0000
commitd054028b841d3f29fbe7f9bd57163ce4d125794f (patch)
tree6f0512e2d2f3cd7931748f6e1c0b926fa9d103c8
parent83b63b99caeea75d5ed06ea3b055aa0a6ff4c004 (diff)
downloadengrampa-d054028b841d3f29fbe7f9bd57163ce4d125794f.tar.bz2
engrampa-d054028b841d3f29fbe7f9bd57163ce4d125794f.tar.xz
Zstandard: add test for checking compressed file integrity
-rw-r--r--src/fr-command-cfile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c
index 612c4c8..fff8bfb 100644
--- a/src/fr-command-cfile.c
+++ b/src/fr-command-cfile.c
@@ -490,7 +490,7 @@ fr_command_cfile_test (FrCommand *comm)
{
const char *compress_cmd;
if (is_mime_type (comm->mime_type, "application/x-gzip")) {
- compress_cmd = "gzip";
+ compress_cmd = "gzip";
}
else if (is_mime_type (comm->mime_type, "application/x-brotli")) {
compress_cmd = "brotli";
@@ -512,6 +512,15 @@ fr_command_cfile_test (FrCommand *comm)
}
else if (is_mime_type (comm->mime_type, "application/x-lzop")) {
compress_cmd = "lzop";
+ }
+ else if (is_mime_type (comm->mime_type, "application/x-zstd")) {
+ compress_cmd = "zstd";
+ fr_process_begin_command (comm->process, compress_cmd);
+ fr_process_add_arg (comm->process, "-v");
+ fr_process_add_arg (comm->process, "--test");
+ fr_process_add_arg (comm->process, comm->filename);
+ fr_process_end_command (comm->process);
+ return;
} else { // i.e. if (is_mime_type (comm->mime_type, "application/x-rzip"))
g_warning ("Test integrity is unsupported for %s\n", comm->mime_type);
return;