Dominique Leuenberger
545a17234b
OBS-URL: https://build.opensuse.org/request/show/634832 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/file-roller?expand=0&rev=273
54 lines
1.6 KiB
Diff
54 lines
1.6 KiB
Diff
Index: file-roller-3.29.91/src/fr-command-rar.c
|
|
===================================================================
|
|
--- file-roller-3.29.91.orig/src/fr-command-rar.c 2018-08-27 20:37:42.000000000 +0200
|
|
+++ file-roller-3.29.91/src/fr-command-rar.c 2018-08-29 01:05:09.879754204 +0200
|
|
@@ -763,6 +763,39 @@ fr_command_rar_get_mime_types (FrArchive
|
|
return rar_mime_type;
|
|
}
|
|
|
|
+static gboolean
|
|
+unrar_is_suse_wrapper ()
|
|
+{
|
|
+ const gchar *path = g_getenv ("PATH");
|
|
+ gchar **paths;
|
|
+ gchar **pp;
|
|
+ gchar *p;
|
|
+ gchar *full_name;
|
|
+ FILE *fp;
|
|
+ char bytes[2];
|
|
+ gboolean ret = FALSE;
|
|
+
|
|
+ if (!path)
|
|
+ path = "/usr/bin";
|
|
+
|
|
+ paths = g_strsplit (path, ":", 0);
|
|
+ for (pp = paths; *pp; pp++)
|
|
+ {
|
|
+ p = *pp;
|
|
+ full_name = g_strconcat (p, "/unrar", NULL);
|
|
+ fp = fopen (full_name, "r");
|
|
+ g_free (full_name);
|
|
+ if (!fp)
|
|
+ continue;
|
|
+ bytes[0] = bytes[1] = 0;
|
|
+ fread (bytes, 2, 1, fp);
|
|
+ fclose (fp);
|
|
+ ret = (bytes[0] == '#' && bytes[1] == '!');
|
|
+ break;
|
|
+ }
|
|
+ g_strfreev (paths);
|
|
+ return ret;
|
|
+}
|
|
|
|
static FrArchiveCap
|
|
fr_command_rar_get_capabilities (FrArchive *archive,
|
|
@@ -774,7 +807,7 @@ fr_command_rar_get_capabilities (FrArchi
|
|
capabilities = FR_ARCHIVE_CAN_STORE_MANY_FILES | FR_ARCHIVE_CAN_ENCRYPT | FR_ARCHIVE_CAN_ENCRYPT_HEADER;
|
|
if (_g_program_is_available ("rar", check_command))
|
|
capabilities |= FR_ARCHIVE_CAN_READ_WRITE | FR_ARCHIVE_CAN_CREATE_VOLUMES;
|
|
- else if (_g_program_is_available ("unrar", check_command))
|
|
+ else if (_g_program_is_available ("unrar", check_command) && !unrar_is_suse_wrapper ())
|
|
capabilities |= FR_ARCHIVE_CAN_READ;
|
|
|
|
/* multi-volumes are read-only */
|