Blame SOURCES/0001-unpacker-Build-with-older-libarchive-without-zstd.patch

073af0
From 11ee20c1cdcc7a76d9e1047e8063b8349a6c6da6 Mon Sep 17 00:00:00 2001
073af0
From: Colin Walters <walters@verbum.org>
073af0
Date: Tue, 15 Oct 2019 15:16:06 +0000
073af0
Subject: [PATCH] unpacker: Build with older libarchive without zstd
073af0
073af0
It's not in RHEL8.1, and I'm trying to rebase rpm-ostree.
073af0
---
073af0
 configure.ac                          | 4 ++++
073af0
 src/libpriv/rpmostree-unpacker-core.c | 2 ++
073af0
 2 files changed, 6 insertions(+)
073af0
073af0
diff --git a/configure.ac b/configure.ac
073af0
index 873dc6b9..a0c5cce4 100644
073af0
--- a/configure.ac
073af0
+++ b/configure.ac
073af0
@@ -122,6 +122,10 @@ dnl bundled libdnf
073af0
 PKGDEP_RPMOSTREE_CFLAGS="-I $(pwd)/libdnf -I $(pwd)/libdnf-build $PKGDEP_RPMOSTREE_CFLAGS"
073af0
 PKGDEP_RPMOSTREE_LIBS="-L$(pwd)/libdnf-build/libdnf -ldnf $PKGDEP_RPMOSTREE_LIBS"
073af0
 
073af0
+dnl RHEL8.1 has old libarchive
073af0
+AS_IF([pkg-config --atleast-version=3.3.3 libarchive],
073af0
+  [AC_DEFINE([HAVE_LIBARCHIVE_ZSTD], 1, [Define if we have libarchive with zstd])])
073af0
+
073af0
 dnl This is the current version in Fedora 25.
073af0
 AS_IF([pkg-config --atleast-version=4.14.2 rpm], [], [AC_MSG_ERROR([librpm 4.14.2 required])])
073af0
 
073af0
diff --git a/src/libpriv/rpmostree-unpacker-core.c b/src/libpriv/rpmostree-unpacker-core.c
073af0
index 3bd574a4..2d741b1e 100644
073af0
--- a/src/libpriv/rpmostree-unpacker-core.c
073af0
+++ b/src/libpriv/rpmostree-unpacker-core.c
073af0
@@ -74,7 +74,9 @@ rpmostree_unpack_rpm2cpio (int fd, GError **error)
073af0
         archive_read_support_filter_gzip,
073af0
         archive_read_support_filter_xz,
073af0
         archive_read_support_filter_bzip2,
073af0
+#ifdef HAVE_LIBARCHIVE_ZSTD
073af0
         archive_read_support_filter_zstd,
073af0
+#endif
073af0
         archive_read_support_format_cpio };
073af0
 
073af0
     for (i = 0; i < G_N_ELEMENTS (archive_setup_funcs); i++)
073af0
-- 
073af0
2.21.0
073af0