fr-rpm-bsdtar.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. This makes Engrampa use bsdtar to extract .RPM packages instead of using cpio.
  2. It is useful on systems that do not have cpio or RPM/YUM
  3. This patch was created for Arch Linux, however should work on any system that has bsdtar capable of handling cpio archives.
  4. ------------------+
  5. rpm2cpio.c | 2 +-
  6. fr-command-rpm.c | 8 ++++----
  7. 2 files changed, 5 insertions(+), 5 deletions(-)
  8. Index: src/commands/rpm2cpio.c
  9. ================================
  10. --- mate-file-archiver-1.6.0/src/commands/rpm2cpio.c 2013-03-31
  11. +++ mate-file-archiver-1.6.0/src/commands/rpm2cpio.c 2013-07-26
  12. @@ -128,7 +128,7 @@
  13. archive_command = "bzip2 -dc";
  14. fclose (stream);
  15. - command = g_strdup_printf ("sh -c \"dd if=%s ibs=%u skip=1 2>/dev/null | %s | cpio %s\"", g_shell_quote (filename), offset, archive_command, cpio_args->str);
  16. + command = g_strdup_printf ("sh -c \"dd if=%s ibs=%u skip=1 2>/dev/null | %s | bsdtar %s\"", g_shell_quote (filename), offset, archive_command, cpio_args->str);
  17. return system (command);
  18. }
  19. Index: src/fr-command-rpm.c
  20. ================================
  21. --- mate-file-archiver-1.6.0/src/fr-command-rpm.c 2013-03-31
  22. +++ mate-file-archiver-1.6.0/src/fr-command-rpm.c 2013-07-26
  23. @@ -175,7 +175,7 @@
  24. fr_process_begin_command (comm->process, "sh");
  25. fr_process_add_arg (comm->process, "-c");
  26. - fr_process_add_arg_concat (comm->process, PRIVEXECDIR "rpm2cpio ", comm->e_filename, " -itv", NULL);
  27. + fr_process_add_arg_concat (comm->process, PRIVEXECDIR "rpm2cpio ", comm->e_filename, " -tvf -", NULL);
  28. fr_process_end_command (comm->process);
  29. fr_process_start (comm->process);
  30. }
  31. @@ -200,7 +200,7 @@
  32. cmd = g_string_new (PRIVEXECDIR "rpm2cpio ");
  33. g_string_append (cmd, comm->e_filename);
  34. - g_string_append (cmd, " -idu ");
  35. + g_string_append (cmd, " -xf - ");
  36. for (scan = file_list; scan; scan = scan->next) {
  37. char *filename = g_shell_quote (scan->data);
  38. g_string_append (cmd, filename);
  39. @@ -233,7 +233,7 @@
  40. FrCommandCap capabilities;
  41. capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
  42. - if (is_program_available ("cpio", check_command))
  43. + if (is_program_available ("bsdtar", check_command))
  44. capabilities |= FR_COMMAND_CAN_READ;
  45. return capabilities;
  46. @@ -244,7 +244,7 @@
  47. fr_command_rpm_get_packages (FrCommand *comm,
  48. const char *mime_type)
  49. {
  50. - return PACKAGES ("cpio,rpm");
  51. + return PACKAGES ("bsdtar,rpm");
  52. }