aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-04-22 17:13:57 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-04-22 17:13:57 +0000
commit1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b (patch)
tree36f88c233ce56e74bb83a6e5a12de5b5dd0758a1
parent98c4a5c2c529f1fdcda1dd30faeb77268f65594f (diff)
downloadperl-URPM-1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b.tar
perl-URPM-1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b.tar.gz
perl-URPM-1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b.tar.bz2
perl-URPM-1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b.tar.xz
perl-URPM-1c8e6de908d515f48d2f2039bc77ef07c6e9ae1b.zip
fix appending of distepoch & disttag to @info@
-rw-r--r--URPM.xs18
1 files changed, 14 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index c2ec981..f701b96 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1049,14 +1049,24 @@ pack_header(URPM__Package pkg) {
const char *disttag = get_name(pkg->h, RPMTAG_DISTTAG);
const char *distepoch = get_name(pkg->h, RPMTAG_DISTEPOCH);
- p += 1 + snprintf(buff, sizeof(buff), "%s@%d@%d@%s@%s@%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, disttag, distepoch);
+ group);
+ if (*disttag || *distepoch) {
+ p = stpcpy(p, "@");
+ if (*disttag) {
+ p = stpcpy(p, disttag);
+ _free(disttag);
+ }
+ p = stpcpy(p, "@");
+ if (*distepoch) {
+ p = stpcpy(p, distepoch);
+ _free(distepoch);
+ }
+ }
pkg->info = memcpy(malloc(p-buff), buff, p-buff);
_free(group);
_free(nvra);
- _free(disttag);
- _free(distepoch);
}
if (pkg->filesize == 0) pkg->filesize = sigsize_to_filesize(get_int(pkg->h, RPMTAG_SIGSIZE));
if (pkg->requires == NULL && pkg->suggests == NULL)