diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-06 23:41:33 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-06 23:41:33 +0000 |
commit | f11451e2ba4c2fa65905c66fb285c50c2e2eecba (patch) | |
tree | d7402f8d7e8cf262d187ba47a9094ff447a531b7 | |
parent | 21f9e8412b6adbf77c86211eda46854eef149d31 (diff) | |
download | perl-URPM-f11451e2ba4c2fa65905c66fb285c50c2e2eecba.tar perl-URPM-f11451e2ba4c2fa65905c66fb285c50c2e2eecba.tar.gz perl-URPM-f11451e2ba4c2fa65905c66fb285c50c2e2eecba.tar.bz2 perl-URPM-f11451e2ba4c2fa65905c66fb285c50c2e2eecba.tar.xz perl-URPM-f11451e2ba4c2fa65905c66fb285c50c2e2eecba.zip |
fix segfault when trying to get EVR of a src.rpm from synthesis, as @provides@ are omitted for these
-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); |