Blame SOURCES/0001-core-Use-new-rpmtsSetVfyLevel-API-for-writing-rpmdb.patch

c467a4
From da27b94b2903ce10a3b0063da62fea8f90a93675 Mon Sep 17 00:00:00 2001
c467a4
From: Colin Walters <walters@verbum.org>
c467a4
Date: Mon, 23 Jul 2018 16:37:43 +0000
c467a4
Subject: [PATCH] core: Use new `rpmtsSetVfyLevel()` API for writing rpmdb
c467a4
c467a4
Newer librpm defaults to doing a full payload checksum, which we can't
c467a4
do at this point (writing the db) because we imported the RPMs into
c467a4
ostree commits, saving just the header in metadata - we don't have the
c467a4
exact original content to provide again.
c467a4
c467a4
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1607223
c467a4
c467a4
Closes: #1469
c467a4
Approved by: jlebon
c467a4
---
c467a4
 configure.ac                 | 4 ++++
c467a4
 src/libpriv/rpmostree-core.c | 9 +++++++++
c467a4
 2 files changed, 13 insertions(+)
c467a4
c467a4
diff --git a/configure.ac b/configure.ac
c467a4
index e1e771ac..f1aa0751 100644
c467a4
--- a/configure.ac
c467a4
+++ b/configure.ac
c467a4
@@ -110,6 +110,10 @@ AS_IF([pkg-config --atleast-version=4.13.0.1 rpm], [
c467a4
   AC_DEFINE([BUILDOPT_HAVE_RPM_FILETRIGGERS], 1, [Set to 1 if we have file triggers])
c467a4
   AC_DEFINE([BUILDOPT_HAVE_RPMFILES], 1, [Set to 1 if we have rpmfiles API])
c467a4
 ], [have_modern_rpm=false])
c467a4
+dnl See usage
c467a4
+AS_IF([pkg-config --atleast-version=4.14.2-rc1 rpm], [
c467a4
+  AC_DEFINE([BUILDOPT_HAVE_NEW_RPM_VERIFY], 1, [Set to 1 if we have rpmtsSetVfyLevel])
c467a4
+])
c467a4
 
c467a4
 AC_PATH_PROG([XSLTPROC], [xsltproc])
c467a4
 
c467a4
diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c
c467a4
index 68ac8871..d38303fa 100644
c467a4
--- a/src/libpriv/rpmostree-core.c
c467a4
+++ b/src/libpriv/rpmostree-core.c
c467a4
@@ -4010,6 +4010,15 @@ rpmostree_context_assemble (RpmOstreeContext      *self,
c467a4
 
c467a4
   g_auto(rpmts) rpmdb_ts = rpmtsCreate ();
c467a4
   rpmtsSetVSFlags (rpmdb_ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS);
c467a4
+  /* https://bugzilla.redhat.com/show_bug.cgi?id=1607223
c467a4
+   * Newer librpm defaults to doing a full payload checksum, which we can't
c467a4
+   * do at this point because we imported the RPMs into ostree commits, saving
c467a4
+   * just the header in metadata - we don't have the exact original content to
c467a4
+   * provide again.
c467a4
+   */
c467a4
+#ifdef BUILDOPT_HAVE_NEW_RPM_VERIFY
c467a4
+  rpmtsSetVfyLevel (rpmdb_ts, 0);
c467a4
+#endif
c467a4
   rpmtsSetFlags (rpmdb_ts, RPMTRANS_FLAG_JUSTDB);
c467a4
 
c467a4
   tdata.ctx = self;
c467a4
-- 
c467a4
2.17.1
c467a4