summaryrefslogtreecommitdiff
path: root/libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch')
-rw-r--r--libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch b/libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch
new file mode 100644
index 000000000..f5b7c8e00
--- /dev/null
+++ b/libre/gloobus-preview-libre/gloobus-preview-usr-bsdtar-for-rar.patch
@@ -0,0 +1,57 @@
+------------------------------------------------------------
+revno: 291
+committer: Michał Masłowski <mtjm@mtjm.eu>
+branch nick: gloobus-preview
+timestamp: Sun 2013-06-23 14:43:35 +0200
+message:
+ Use bsdtar to open RAR archives if unrar is not available.
+
+ Needs bsdtar from libarchive 3.0 or newer, not tested with older
+ versions nor checking for them.
+diff:
+=== modified file 'src/plugin-compressed/plugin-compressed.cpp'
+--- src/plugin-compressed/plugin-compressed.cpp 2012-04-06 11:25:47 +0000
++++ src/plugin-compressed/plugin-compressed.cpp 2013-06-23 12:43:35 +0000
+@@ -52,8 +52,9 @@
+ cmd_args.push_back("--");
+ line_parser = &iCompressed::parse_line_7z;
+ }
+- else if ( type == GP_COMPRESSED_RAR
+- || type == GP_COMPRESSED_RAR_X )
++ else if ( (type == GP_COMPRESSED_RAR
++ || type == GP_COMPRESSED_RAR_X)
++ && interface::is_program_available("unrar") )
+ {
+ cmd_args.push_back("unrar");
+ cmd_args.push_back("vb");
+@@ -70,9 +71,15 @@
+ || type == GP_COMPRESSED_TAR_LZOP
+ || type == GP_COMPRESSED_TAR_X
+ || type == GP_COMPRESSED_TAR_XZ
+- || type == GP_COMPRESSED_TAR_Z )
++ || type == GP_COMPRESSED_TAR_Z
++ || type == GP_COMPRESSED_RAR
++ || type == GP_COMPRESSED_RAR_X )
+ {
+- cmd_args.push_back("tar");
++ if ( type == GP_COMPRESSED_RAR
++ || type == GP_COMPRESSED_RAR_X )
++ cmd_args.push_back("bsdtar");
++ else
++ cmd_args.push_back("tar");
+ cmd_args.push_back("-tf");
+ line_parser = &iCompressed::parse_line_rar;
+ }
+
+=== modified file 'src/plugin-compressed/plugin-compressed.h'
+--- src/plugin-compressed/plugin-compressed.h 2010-03-27 15:55:08 +0000
++++ src/plugin-compressed/plugin-compressed.h 2013-06-23 12:43:35 +0000
+@@ -102,7 +102,7 @@
+ PluginManager::register_filetype(GP_COMPRESSED_7Z, 1);
+ }
+
+-if(interface::is_program_available("unrar")) {
++if(interface::is_program_available("unrar") || interface::is_program_available("bsdtar")) {
+ PluginManager::register_filetype(GP_COMPRESSED_RAR, 1);
+ PluginManager::register_filetype(GP_COMPRESSED_RAR_X, 1);
+ }