Blame SOURCES/0012-inspection-Return-RPM-epoch.patch

13e635
From 3ce392c9870a589cc50d2270fcf07b4d129c3dc3 Mon Sep 17 00:00:00 2001
13e635
From: "Richard W.M. Jones" <rjones@redhat.com>
13e635
Date: Sat, 27 Mar 2021 09:31:00 +0000
13e635
Subject: [PATCH] inspection: Return RPM epoch.
13e635
13e635
Fixes: commit c9ee831affed55abe0f928134cbbd2ed83b2f510
13e635
(cherry picked from commit fef73bce7eec0ce0753a2e150e4e088020d38643)
13e635
---
13e635
 daemon/rpm-c.c | 5 ++++-
13e635
 1 file changed, 4 insertions(+), 1 deletion(-)
13e635
13e635
diff --git a/daemon/rpm-c.c b/daemon/rpm-c.c
13e635
index 92a3abf58..be0e81e22 100644
13e635
--- a/daemon/rpm-c.c
13e635
+++ b/daemon/rpm-c.c
13e635
@@ -108,13 +108,16 @@ guestfs_int_daemon_rpm_next_application (value unitv)
13e635
 
13e635
   h = headerLink (h);
13e635
   app.app2_name = headerFormat (h, "%{NAME}", NULL);
13e635
-  // XXXapp.app2_epoch = headerFormat (h, "%{NAME}", NULL);
13e635
   app.app2_version = headerFormat (h, "%{VERSION}", NULL);
13e635
   app.app2_release = headerFormat (h, "%{RELEASE}", NULL);
13e635
   app.app2_arch = headerFormat (h, "%{ARCH}", NULL);
13e635
   app.app2_url = headerFormat (h, "%{URL}", NULL);
13e635
   app.app2_summary = headerFormat (h, "%{SUMMARY}", NULL);
13e635
   app.app2_description = headerFormat (h, "%{DESCRIPTION}", NULL);
13e635
+
13e635
+  /* epoch is special as the only int field. */
13e635
+  app.app2_epoch = headerGetNumber (h, RPMTAG_EPOCH);
13e635
+
13e635
   headerFree (h);
13e635
 
13e635
   /* Convert this to an OCaml struct.  Any NULL fields must be turned
13e635
-- 
e29d66
2.31.1
13e635