diff options
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | URPM.pm | 2 | ||||
-rw-r--r-- | URPM.xs | 16 |
3 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Version 4.29 - 7 May 2011, by Per Øyvind Karlsen + +- fix segfault when trying to get EVR of a src.rpm from synthesis, as + @provides@ are omitted for these + Version 4.28 - 5 May 2011, by Per Øyvind Karlsen - revert attempt at refactorizing Trans_run() which turned out to give code @@ -11,7 +11,7 @@ use URPM::Resolve; use URPM::Signature; our @ISA = qw(DynaLoader); -our $VERSION = '4.28'; +our $VERSION = '4.29'; URPM->bootstrap($VERSION); @@ -944,7 +944,21 @@ pack_list(Header header, rpmTag tag_name, rpmTag tag_flags, rpmTag tag_version, static const char * get_evr(URPM__Package pkg) { const char *evr = NULL; - if(pkg->provides && !pkg->h) { + if(pkg->info && !pkg->h) { + if (!pkg->provides) { + /* for src.rpms there's no @provides@ field added to the synthesis, so + * we'll create one by request here for EVR. */ + char *name = NULL; + int epoch = 0; + char *version = NULL; + char *release = NULL; + char *distepoch = NULL; + get_fullname_parts(pkg, &name, &epoch, &version, &release, NULL, NULL, NULL, NULL); + int sz = asprintf(&pkg->provides, "%s[== %d:%s-%s]", name, epoch, version, release); + restore_chars(); + if (sz < 0) + return ""; + } char *name = NULL; char *tmp = NULL, *tmp2 = NULL, *tmp3 = NULL; get_fullname_parts(pkg, &name, NULL, NULL, NULL, NULL, NULL, NULL, NULL); |