file-roller/file-roller-ignore-unrar-if-wrapper.patch
Dominique Leuenberger dd655afbc6 - Update to version 44.4:
+ Features:
    - Added bzip3 support.
    - File selector: show volumes and allow to mount unmounted
      volumes.
    - New archive dialog: allow to use all the possible extensions
      a mime type supports, and allow to specify a name without
      extension, which will be concatenated to the selected
      extension to get the full name.
    - File selector: save and restore the sort order.
    - Properties dialog: show an icon, make the headerbar flat.
  + Bugfixes:
    - Error opening rar archive in RAR4 format and password
      protected.
    - Rar: fixed file list parsing for some encrypted archives.
    - Fixed error when renaming a file inside an encrypted archive.
    - Disabled the native appchooser by default.
    - 'Show destination' sometimes opens the wrong folder.
    - 'Show destination' sometimes doesn't show anything.
    - Use the native appchooser only for a single file.
    - Show flat headerbar in empty state.
    - Fixed error messages impossible to close.
    - Fixed segfaults when opening an empty .deb file.
    - --extract-to keeps asking to create a directory.
    - Fixed wrong context menu item activation.
    - Avoid the exit timeout unless file-roller was launched with
      `--service`.
    - Error when opening the created archive after saving as 7zip
      multi-volume.
  + Updated translations.

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/file-roller?expand=0&rev=323
2024-11-25 14:18:52 +00:00

54 lines
1.6 KiB
Diff

Index: file-roller-43.alpha/src/fr-command-rar.c
===================================================================
--- file-roller-43.alpha.orig/src/fr-command-rar.c
+++ file-roller-43.alpha/src/fr-command-rar.c
@@ -766,6 +766,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 FrArchiveCaps
fr_command_rar_get_capabilities (FrArchive *archive,
@@ -777,7 +810,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 */