summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/hdraddorappend.patch
blob: 020337a598e84694ec701eb0da91d10e2a5dcf80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/lib/rpm4compat.h b/lib/rpm4compat.h
index b957f8e..b1954d5 100644
--- a/lib/rpm4compat.h
+++ b/lib/rpm4compat.h
@@ -211,6 +211,17 @@ static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const void *
 	return headerPut(h, he, 0);
 }
 
+static inline int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) {
+	HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he));
+
+	he->tag = (rpmTag)tag;
+	he->t = (rpmTagType)type;
+	he->p.str = (const char*)p;
+	he->c = (rpmTagCount)c;
+	he->append = 1;
+	return headerPut(h, he, 0);
+}
+
 static inline int headerRemoveEntry(Header h, int_32 tag) {
 	HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he));