diff options
author | rbuj <[email protected]> | 2020-01-01 23:39:04 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-01-04 13:29:35 +0100 |
commit | 4deb89e7fa95e8abffb86f517878a9bc0d30b7bc (patch) | |
tree | f67633477c1d14b05c8918687607bee296933973 /src/fr-command-rpm.c | |
parent | f0805f3afe61c035cc3477cba880322c15e95766 (diff) | |
download | engrampa-4deb89e7fa95e8abffb86f517878a9bc0d30b7bc.tar.bz2 engrampa-4deb89e7fa95e8abffb86f517878a9bc0d30b7bc.tar.xz |
fr-command-rpm: Use rpm2cpio binary shipped with rpm package
closes #350
Diffstat (limited to 'src/fr-command-rpm.c')
-rw-r--r-- | src/fr-command-rpm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fr-command-rpm.c b/src/fr-command-rpm.c index 751f9a9..227fd58 100644 --- a/src/fr-command-rpm.c +++ b/src/fr-command-rpm.c @@ -184,7 +184,7 @@ fr_command_rpm_list (FrCommand *comm) 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, "rpm2cpio < ", comm->e_filename, " | cpio -itv", NULL); fr_process_end_command (comm->process); fr_process_start (comm->process); } @@ -207,14 +207,14 @@ fr_command_rpm_extract (FrCommand *comm, fr_process_set_working_dir (comm->process, dest_dir); fr_process_add_arg (comm->process, "-c"); - cmd = g_string_new (PRIVEXECDIR "rpm2cpio "); + cmd = g_string_new ("rpm2cpio < "); g_string_append (cmd, comm->e_filename); - g_string_append (cmd, " -idu "); + g_string_append (cmd, " | cpio -idu"); for (scan = file_list; scan; scan = scan->next) { + g_string_append (cmd, " "); char *filename = g_shell_quote (scan->data); g_string_append (cmd, filename); g_free (filename); - g_string_append (cmd, " "); } fr_process_add_arg (comm->process, cmd->str); g_string_free (cmd, TRUE); @@ -241,7 +241,8 @@ fr_command_rpm_get_capabilities (FrCommand *comm, FrCommandCap capabilities; capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES; - if (is_program_available (CPIO_PATH, check_command)) + if (is_program_available ("rpm2cpio", check_command) && + is_program_available (CPIO_PATH, check_command)) capabilities |= FR_COMMAND_CAN_READ; return capabilities; |