summaryrefslogtreecommitdiff
path: root/libre/engrampa-libre/fr-rpm-bsdtar.patch
blob: 93a783176f3f07e0c3335de6ba878450d61c39a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This makes Engrampa use bsdtar to extract .RPM packages instead of using cpio.
It is useful on systems that do not have cpio or RPM/YUM
This patch was created for Arch Linux, however should work on any system that has bsdtar capable of handling cpio archives.

------------------+
 rpm2cpio.c       |   2 +-
 fr-command-rpm.c |   8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

Index: src/commands/rpm2cpio.c
================================
--- mate-file-archiver-1.6.0/src/commands/rpm2cpio.c 2013-03-31
+++ mate-file-archiver-1.6.0/src/commands/rpm2cpio.c	2013-07-26
@@ -128,7 +128,7 @@
 		archive_command = "bzip2 -dc";
 	fclose (stream);
 
-	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);
+	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);
 
 	return system (command);
 }
Index: src/fr-command-rpm.c
================================
--- mate-file-archiver-1.6.0/src/fr-command-rpm.c	2013-03-31
+++ mate-file-archiver-1.6.0/src/fr-command-rpm.c	2013-07-26
@@ -175,7 +175,7 @@
 
 	fr_process_begin_command (comm->process, "sh");
 	fr_process_add_arg (comm->process, "-c");
-	fr_process_add_arg_concat (comm->process, PRIVEXECDIR "rpm2cpio ", comm->e_filename, " -itv", NULL);
+	fr_process_add_arg_concat (comm->process, PRIVEXECDIR "rpm2cpio ", comm->e_filename, " -tvf -", NULL);
 	fr_process_end_command (comm->process);
 	fr_process_start (comm->process);
 }
@@ -200,7 +200,7 @@
 
 	cmd = g_string_new (PRIVEXECDIR "rpm2cpio ");
 	g_string_append (cmd, comm->e_filename);
-	g_string_append (cmd, " -idu ");
+	g_string_append (cmd, " -xf - ");
 	for (scan = file_list; scan; scan = scan->next) {
 		char *filename = g_shell_quote (scan->data);
 		g_string_append (cmd, filename);
@@ -233,7 +233,7 @@
 	FrCommandCap capabilities;
 
 	capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
-	if (is_program_available ("cpio", check_command))
+	if (is_program_available ("bsdtar", check_command))
 		capabilities |= FR_COMMAND_CAN_READ;
 
 	return capabilities;
@@ -244,7 +244,7 @@
 fr_command_rpm_get_packages (FrCommand  *comm,
 			     const char *mime_type)
 {
-	return PACKAGES ("cpio,rpm");
+	return PACKAGES ("bsdtar,rpm");
 }