[ostree] repo: Use non-deprecated API with sufficiently new libarchive
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] repo: Use non-deprecated API with sufficiently new libarchive
- Date: Fri, 30 Aug 2013 18:42:41 +0000 (UTC)
commit 23e2593b6dc5954e8d4a68d8b19d71434c451c91
Author: Colin Walters <walters verbum org>
Date: Fri Aug 30 10:50:29 2013 +0200
repo: Use non-deprecated API with sufficiently new libarchive
Based on a patch Tobias Hunger <tobias hunger gmail com>
configure.ac | 4 ++++
src/libostree/ostree-repo-libarchive.c | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index cd0d065..74df7b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,10 @@ AS_IF([ test x$with_libarchive != xno ], [
AS_IF([ test x$have_libarchive = xyes], [
AC_DEFINE(HAVE_LIBARCHIVE, 1, [Define if we have libarchive.pc])
PKG_CHECK_MODULES(OT_DEP_LIBARCHIVE, $LIBARCHIVE_DEPENDENCY)
+ save_LIBS=$LIBS
+ LIBS=$OT_DEP_LIBARCHIVE_LIBS
+ AC_CHECK_FUNCS(archive_read_support_filter_all)
+ LIBS=$save_LIBS
with_libarchive=yes
], [
with_libarchive=no
diff --git a/src/libostree/ostree-repo-libarchive.c b/src/libostree/ostree-repo-libarchive.c
index e06092a..7c0348e 100644
--- a/src/libostree/ostree-repo-libarchive.c
+++ b/src/libostree/ostree-repo-libarchive.c
@@ -305,7 +305,11 @@ ostree_repo_stage_archive_to_mtree (OstreeRepo *self,
gs_free guchar *tmp_csum = NULL;
a = archive_read_new ();
+#ifdef HAVE_ARCHIVE_READ_SUPPORT_FILTER_ALL
+ archive_read_support_filter_all (a);
+#else
archive_read_support_compression_all (a);
+#endif
archive_read_support_format_all (a);
if (archive_read_open_filename (a, gs_file_get_path_cached (archive_f), 8192) != ARCHIVE_OK)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]