[file-roller] add a configure environment variable to select the cpio path
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] add a configure environment variable to select the cpio path
- Date: Sun, 13 Dec 2015 10:21:10 +0000 (UTC)
commit 8a5116598de6522ff9b74078759ceffef5fb07a9
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date: Thu Apr 16 13:08:28 2015 +0200
add a configure environment variable to select the cpio path
on some systems (like OpenBSD), gcpio is prefered over the base cpio.
configure.ac | 4 ++++
src/commands/rpm2cpio.c | 2 +-
src/fr-command-cpio.c | 4 ++--
src/fr-command-rpm.c | 4 ++--
4 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1323aa3..177b832 100644
--- a/configure.ac
+++ b/configure.ac
@@ -243,6 +243,10 @@ AC_SUBST(LIBARCHIVE_LIBS)
AC_SUBST(LIBARCHIVE_CFLAGS)
AM_CONDITIONAL(ENABLE_LIBARCHIVE, test x"$enable_libarchive" = xyes)
+AC_ARG_VAR([CPIO], [Path to the `cpio` command])
+AC_PATH_PROGS(CPIO, gcpio cpio)
+AC_DEFINE_UNQUOTED(CPIO_PATH, "${CPIO}", [Path to cpio])
+
dnl ******************************
IT_PROG_INTLTOOL([0.40.0])
diff --git a/src/commands/rpm2cpio.c b/src/commands/rpm2cpio.c
index a2477a7..f52406c 100644
--- a/src/commands/rpm2cpio.c
+++ b/src/commands/rpm2cpio.c
@@ -127,7 +127,7 @@ main (int argc, char **argv)
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 | " CPIO_PATH " %s\"",
g_shell_quote (filename), offset, archive_command, cpio_args->str);
return system (command);
}
diff --git a/src/fr-command-cpio.c b/src/fr-command-cpio.c
index dcdf1b7..55a62f9 100644
--- a/src/fr-command-cpio.c
+++ b/src/fr-command-cpio.c
@@ -168,7 +168,7 @@ fr_command_cpio_list (FrCommand *comm)
fr_process_begin_command (comm->process, "sh");
fr_process_add_arg (comm->process, "-c");
- fr_process_add_arg_concat (comm->process, "cpio -itv < ", comm->e_filename, NULL);
+ fr_process_add_arg_concat (comm->process, CPIO_PATH " -itv < ", comm->e_filename, NULL);
fr_process_end_command (comm->process);
return TRUE;
@@ -233,7 +233,7 @@ fr_command_cpio_get_capabilities (FrArchive *archive,
FrArchiveCap capabilities;
capabilities = FR_ARCHIVE_CAN_STORE_MANY_FILES;
- if (_g_program_is_available ("cpio", check_command))
+ if (_g_program_is_available (CPIO_PATH, check_command))
capabilities |= FR_ARCHIVE_CAN_READ;
return capabilities;
diff --git a/src/fr-command-rpm.c b/src/fr-command-rpm.c
index 035ac5e..5edbbd5 100644
--- a/src/fr-command-rpm.c
+++ b/src/fr-command-rpm.c
@@ -234,7 +234,7 @@ fr_command_rpm_get_capabilities (FrArchive *archive,
FrArchiveCap capabilities;
capabilities = FR_ARCHIVE_CAN_STORE_MANY_FILES;
- if (_g_program_is_available ("cpio", check_command))
+ if (_g_program_is_available (CPIO_PATH, check_command))
capabilities |= FR_ARCHIVE_CAN_READ;
return capabilities;
@@ -245,7 +245,7 @@ static const char *
fr_command_rpm_get_packages (FrArchive *archive,
const char *mime_type)
{
- return PACKAGES ("cpio,rpm");
+ return PACKAGES (CPIO_PATH ",rpm");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]