diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | URPM.xs | 20 |
2 files changed, 20 insertions, 3 deletions
@@ -1,5 +1,6 @@ -Version 3.37.2 - 26 April 2011, by Per Øyvind Karlsen +Version 3.37.2 - 21 June 2011, by Per Øyvind Karlsen +- support getting disttag & distepoch from synthesis - fix URPM::Package->distepoch to actually work - add disttag & distepoch at end of @info@ line - add support for doing comparision against provides with distepoch to allow @@ -2516,14 +2516,30 @@ Pkg_dirnames(pkg) void Pkg_distepoch(pkg) URPM::Package pkg PPCODE: - if (pkg->h) { + if (pkg->info) { + int i; + char *tmp = pkg->info, *eos = NULL; + for (i = 0; i < 5 && tmp != NULL; i++) + tmp = strchr(++tmp, '@'); + if (tmp != NULL && *tmp) + eos = strchr(++tmp, '@'); + XPUSHs(sv_2mortal(newSVpv((tmp && *tmp != '@') ? tmp : "", eos ? eos-tmp : 0))); + } else if (pkg->h) { XPUSHs(sv_2mortal(newSVpv(get_name(pkg->h, RPMTAG_DISTEPOCH), 0))); } void Pkg_disttag(pkg) URPM::Package pkg PPCODE: - if (pkg->h) { + if (pkg->info) { + int i; + char *tmp = pkg->info, *eos = NULL; + for (i = 0; i < 4 && tmp != NULL; i++) + tmp = strchr(++tmp, '@'); + if (tmp != NULL && *tmp) + eos = strchr(++tmp, '@'); + XPUSHs(sv_2mortal(newSVpv((tmp && *tmp != '@') ? tmp : "", eos ? eos-tmp : 0))); + } else if (pkg->h) { XPUSHs(sv_2mortal(newSVpv(get_name(pkg->h, RPMTAG_DISTTAG), 0))); } |