summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
blob: 3c6dad4d50369406ea7c208b555b0fb85e9982b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Add the ability to query the packageorigin

Written by jbj at rpm5.org

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>

Index: rpm-5.4.8/rpmdb/hdrfmt.c
===================================================================
--- rpm-5.4.8.orig/rpmdb/hdrfmt.c
+++ rpm-5.4.8/rpmdb/hdrfmt.c
@@ -2403,8 +2403,10 @@ static int pkgoriginTag(Header h, HE_t 
     int rc = 1;
 
     he->tag = RPMTAG_PACKAGEORIGIN;
-    if (!headerGet(h, he, HEADERGET_NOEXTENSION)
-     && (origin = headerGetOrigin(h)) != NULL)
+    /* XXX two sources for tag data: what search precedence? */
+    if (headerGet(h, he, HEADERGET_NOEXTENSION))
+	rc = 0;
+    else if ((origin = headerGetOrigin(h)) != NULL)
     {
 	he->t = RPM_STRING_TYPE;
 	he->p.str = xstrdup(origin);