aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-07 12:46:56 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-07 12:46:56 +0000
commit5ee9395c645c7e8450d72a5488f19344db47d8c8 (patch)
treea16568e5cd40b7d8e36030a2de1bc0407fa317b2
parent2a57fc316b69e82a02bb8b6c1670c5de9c50ba11 (diff)
downloadperl-URPM-5ee9395c645c7e8450d72a5488f19344db47d8c8.tar
perl-URPM-5ee9395c645c7e8450d72a5488f19344db47d8c8.tar.gz
perl-URPM-5ee9395c645c7e8450d72a5488f19344db47d8c8.tar.bz2
perl-URPM-5ee9395c645c7e8450d72a5488f19344db47d8c8.tar.xz
perl-URPM-5ee9395c645c7e8450d72a5488f19344db47d8c8.zip
(EVR) fix it on packages from rpmdb (was ok on synthesis ones) (mga#7739)
-rw-r--r--NEWS2
-rw-r--r--URPM.xs7
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index c255a6e..aac1f36 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix EVR() on packages from rpmdb (was ok on synthesis ones) (mga#7739)
+
Version 4.21 - 4 December 2012
- prefer package from first medium when same NEVR exists in several media
diff --git a/URPM.xs b/URPM.xs
index 4391c68..3818162 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1453,8 +1453,11 @@ Pkg_EVR(pkg)
mXPUSHs(newSVpv(res, 0));
*arch = '.'; /* restore info string modified */
}
- } else if (pkg->h)
- mXPUSHs(newSVpv(get_name(pkg->h, RPMTAG_EVR), 0));
+ } else if (pkg->h) {
+ char *s = headerGetAsString(pkg->h, RPMTAG_EVR);
+ mXPUSHs(newSVpv(s, 0));
+ free(s);
+ }
void
Pkg_arch(pkg)