From 3b518bff7579647d2e9160e37dbbabc63c3d6792 Mon Sep 17 00:00:00 2001
From: licihua <licihua@huawei.com>
Date: Thu, 20 Oct 2022 20:28:48 +0800
Subject: [PATCH 02/22] rpm-4.12.0-rpm2cpio-hack

---
 rpm2cpio.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rpm2cpio.c b/rpm2cpio.c
index fcc3b30..5e650d5 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -94,7 +94,12 @@ int main(int argc, char *argv[])
 	exit(EXIT_FAILURE);
     }
 
-    rc = (ufdCopy(gzdi, fdo) == payload_size) ? EXIT_SUCCESS : EXIT_FAILURE;
+    /*
+     * XXX HACK for #1142949: should be equality test, but archive size
+     * short by cpio trailer size in packages built with rpm 4.12.0
+     * and its pre-releases.
+     */
+    rc = (ufdCopy(gzdi, fdo) >= payload_size) ? EXIT_SUCCESS : EXIT_FAILURE;
 
     Fclose(fdo);
 
-- 
2.26.2

