aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs13
1 files changed, 12 insertions, 1 deletions
diff --git a/URPM.xs b/URPM.xs
index ee3a97d..bb098b0 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1030,14 +1030,25 @@ pack_header(URPM__Package pkg) {
char buff[1024];
char *p = buff;
const char *group = get_name(pkg->h, RPMTAG_GROUP);
+ const char *disttag = get_name(pkg->h, RPMTAG_DISTTAG);
+ const char *distepoch = get_name(pkg->h, RPMTAG_DISTEPOCH);
const char *nvra = headerFormat(pkg->h,
"%{NAME}-%{VERSION}-%{RELEASE}%|DISTTAG?{-%{DISTTAG}%|DISTEPOCH?"
"{%{DISTEPOCH}}|}|.%|ARCH?{%|SOURCERPM?{%{ARCH}}:{src}|}:{}|",
NULL
);
- p += 1 + snprintf(buff, sizeof(buff), "%s@%d@%d@%s", nvra,
+ p += snprintf(buff, sizeof(buff), "%s@%d@%d@%s", nvra,
get_int(pkg->h, RPMTAG_EPOCH), get_int(pkg->h, RPMTAG_SIZE),
group);
+ if (*disttag || *distepoch) {
+ p = stpcpy(p, "@");
+ if (*disttag)
+ p = stpcpy(p, disttag);
+ p = stpcpy(p, "@");
+ if (*distepoch)
+ p = stpcpy(p, distepoch);
+ }
+ *++p = '\0';
pkg->info = memcpy(malloc(p-buff), buff, p-buff);
_free(nvra);
}