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));
 
