repo: Use non-deprecated API with sufficiently new libarchive

Based on a patch Tobias Hunger <tobias.hunger@gmail.com>
This commit is contained in:
Colin Walters 2013-08-30 10:50:29 +02:00
parent 2a14f2cd52
commit 23e2593b6d
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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)
{