summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-01-18 16:07:38 +0100
committerraveit65 <[email protected]>2020-02-15 17:39:05 +0100
commit25b2bdbcfb95c91a33fd62370cac28a863567c3f (patch)
tree973e1f247834b90c927a573b924bb9faa7ab2441 /src
parentf4658da2bcdc2f858434091c0cc121b82adcee5e (diff)
downloadengrampa-25b2bdbcfb95c91a33fd62370cac28a863567c3f.tar.bz2
engrampa-25b2bdbcfb95c91a33fd62370cac28a863567c3f.tar.xz
autoconf: get zstd mime type using libmagic if enabled
Diffstat (limited to 'src')
-rw-r--r--src/fr-command-cfile.c12
-rw-r--r--src/fr-init.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c
index 697d8ab..a914abe 100644
--- a/src/fr-command-cfile.c
+++ b/src/fr-command-cfile.c
@@ -301,7 +301,7 @@ fr_command_cfile_add (FrCommand *comm,
compressed_filename = g_strconcat (filename, ".rz", NULL);
}
- else if (is_mime_type (comm->mime_type, "application/x-zstd")) {
+ else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) {
fr_process_begin_command (comm->process, "zstd");
fr_process_set_working_dir (comm->process, temp_dir);
fr_process_add_arg (comm->process, filename);
@@ -446,7 +446,7 @@ fr_command_cfile_extract (FrCommand *comm,
fr_process_end_command (comm->process);
}
- else if (is_mime_type (comm->mime_type, "application/x-zstd")) {
+ else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) {
fr_process_begin_command (comm->process, "zstd");
fr_process_add_arg (comm->process, "-f");
fr_process_add_arg (comm->process, "-d");
@@ -515,7 +515,7 @@ 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")) {
+ else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) {
compress_cmd = "zstd";
fr_process_begin_command (comm->process, compress_cmd);
fr_process_add_arg (comm->process, "-v");
@@ -542,7 +542,7 @@ const char *cfile_mime_type[] = { "application/x-gzip",
"application/x-lzop",
"application/x-rzip",
"application/x-xz",
- "application/x-zstd",
+ ZSTD_MIME_TYPE,
NULL };
@@ -599,7 +599,7 @@ fr_command_cfile_get_capabilities (FrCommand *comm,
if (is_program_available ("rzip", check_command))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
}
- else if (is_mime_type (mime_type, "application/x-zstd")) {
+ else if (is_mime_type (mime_type, ZSTD_MIME_TYPE)) {
if (is_program_available ("zstd", check_command))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
}
@@ -642,7 +642,7 @@ fr_command_cfile_get_packages (FrCommand *comm,
return PACKAGES ("lzop");
else if (is_mime_type (mime_type, "application/x-rzip"))
return PACKAGES ("rzip");
- else if (is_mime_type (mime_type, "application/x-zstd"))
+ else if (is_mime_type (mime_type, ZSTD_MIME_TYPE))
return PACKAGES ("zstd");
return NULL;
diff --git a/src/fr-init.c b/src/fr-init.c
index e09f463..67393f1 100644
--- a/src/fr-init.c
+++ b/src/fr-init.c
@@ -108,7 +108,7 @@ FrMimeTypeDescription mime_type_desc[] = {
{ "application/x-xz", ".xz", N_("Xz compressed file"), 0 },
{ "application/x-xz-compressed-tar", ".tar.xz", N_("Tar compressed with xz"), 0 },
{ "application/x-zoo", ".zoo", N_("Zoo"), 0 },
- { "application/x-zstd", ".zst", N_("Zstandard compressed file"), 0 },
+ { ZSTD_MIME_TYPE, ".zst", N_("Zstandard compressed file"), 0 },
{ "application/x-zstd-compressed-tar", ".tar.zst", N_("Tar compressed with zstd"), 0 },
{ "application/zip", ".zip", N_("Zip"), 0 },
{ NULL, NULL, NULL, 0 }
@@ -181,7 +181,7 @@ FrExtensionType file_ext_type[] = {
{ ".Z", "application/x-compress" },
{ ".zip", "application/zip" },
{ ".zoo", "application/x-zoo" },
- { ".zst", "application/x-zstd" },
+ { ".zst", ZSTD_MIME_TYPE },
{ NULL, NULL }
};