diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-04-26 18:09:16 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-04-26 18:09:16 +0000 |
commit | e2d15a0086b95fef38d67cdcddd24359fdca061d (patch) | |
tree | 797b76118940925255c8e45c8b5b39b3dfa917e7 | |
parent | f2e2bbd3209fbc3b317c5bb8956943e4a4d57023 (diff) | |
download | perl-URPM-e2d15a0086b95fef38d67cdcddd24359fdca061d.tar perl-URPM-e2d15a0086b95fef38d67cdcddd24359fdca061d.tar.gz perl-URPM-e2d15a0086b95fef38d67cdcddd24359fdca061d.tar.bz2 perl-URPM-e2d15a0086b95fef38d67cdcddd24359fdca061d.tar.xz perl-URPM-e2d15a0086b95fef38d67cdcddd24359fdca061d.zip |
add disttag & distepoch to @info@
-rw-r--r-- | URPM.xs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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); } |