From e2d15a0086b95fef38d67cdcddd24359fdca061d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Tue, 26 Apr 2011 18:09:16 +0000 Subject: add disttag & distepoch to @info@ --- URPM.xs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.1