4b2f5c72d6
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
43 lines
1.2 KiB
Diff
43 lines
1.2 KiB
Diff
From c182d762c3160a9a2fdde600d39cfbb2eca4d831 Mon Sep 17 00:00:00 2001
|
|
From: Marek Blaha <marek.blaha@gmail.com>
|
|
Date: Fri, 4 May 2018 16:30:41 +0200
|
|
Subject: [PATCH 1/6] source/binary rpm detection heuristic when
|
|
ENABLE_RPMPKG_LIBRPM used
|
|
|
|
The headerIsSource() simply checks a presence of the RPMTAG_SOURCERPM
|
|
tag in package header, which is not really useful in this context.
|
|
This patch provides the same "heuristic" as the librpm uses for
|
|
detecting source/binary rpm.
|
|
|
|
Relevant bug: https://bugzilla.redhat.com/show_bug.cgi?id=1572338
|
|
|
|
(cherry picked from commit 8e1dcb6e23a4ee7ea329609d3a05d17aa0201b87)
|
|
---
|
|
ext/repo_rpmdb.c | 10 +++++++++-
|
|
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
|
|
index cd14a9b4..d5f3bf8e 100644
|
|
--- a/ext/repo_rpmdb.c
|
|
+++ b/ext/repo_rpmdb.c
|
|
@@ -457,7 +457,15 @@ headbinary(RpmHead *h, int tag, unsigned int *sizep)
|
|
static int
|
|
headissourceheuristic(RpmHead *h)
|
|
{
|
|
- return headerIsSource(h);
|
|
+ int issource = 0;
|
|
+ char **dn;
|
|
+ int dcnt;
|
|
+ dn = headstringarray(h, TAG_DIRNAMES, &dcnt);
|
|
+ if (dn) {
|
|
+ issource = dcnt == 1 && dn[0] && !*dn[0];
|
|
+ solv_free(dn);
|
|
+ }
|
|
+ return issource;
|
|
}
|
|
|
|
static inline void
|
|
--
|
|
2.18.0.rc2
|
|
|