[file-roller: 2/5] libarchive: enable read support for 7z
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller: 2/5] libarchive: enable read support for 7z
- Date: Sat, 12 Oct 2019 16:38:13 +0000 (UTC)
commit e8d3d83ec9f24cb5a989af7608538a738200c9d4
Author: Peter Keresztes Schmidt <carbenium outlook com>
Date: Tue Aug 6 04:19:45 2019 +0200
libarchive: enable read support for 7z
p7zip-like programs still have priority over
the libarchive implementation.
src/fr-archive-libarchive.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 8e8841b3..b0ddcefd 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -111,9 +111,13 @@ fr_archive_libarchive_get_capabilities (FrArchive *archive,
capabilities = FR_ARCHIVE_CAN_STORE_MANY_FILES;
- /* write-only formats */
if (strcmp (mime_type, "application/x-7z-compressed") == 0) {
- capabilities |= FR_ARCHIVE_CAN_WRITE;
+ if (_g_program_is_available ("7za", check_command) ||
+ _g_program_is_available ("7zr", check_command) ||
+ _g_program_is_available ("7z", check_command))
+ return capabilities;
+
+ capabilities |= FR_ARCHIVE_CAN_READ_WRITE;
return capabilities;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]