summaryrefslogtreecommitdiffstats
path: root/RPM4/src/RPM4.xs
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4/src/RPM4.xs')
-rw-r--r--RPM4/src/RPM4.xs24
1 files changed, 24 insertions, 0 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index 2a17ad0..ac6c556 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -181,6 +181,30 @@ static rpmTag sv2dbquerytag(SV * sv_tag) {
#define sv2tagtype(sv) sv2constant((sv), "rpmtagtype")
+/*
+ * From URPM.xs:
+ */
+
+static char *
+get_name(Header header, int32_t tag) {
+ struct rpmtd_s val;
+
+ headerGet(header, tag, &val, HEADERGET_MINMEM);
+ char *name = (char *) rpmtdGetString(&val);
+ rpmtdFreeData(&val);
+ return name ? name : "";
+}
+
+static char*
+get_arch(Header header) {
+ return headerIsEntry(header, RPMTAG_SOURCERPM) ? get_name(header, RPMTAG_ARCH) : "src";
+}
+
+/*
+ * End of URPM import
+ * */
+
+
/* This function replace the standard rpmShowProgress callback
* during transaction to allow perl callback */