aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--URPM.xs14
2 files changed, 11 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 745b5cd..de9b8aa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
-Version 4.22 - 23 April 2011, by Per Øyvind Karlsen
+Version 4.22 - 25 April 2011, by Per Øyvind Karlsen
+- fix getting expected NVRA tag
- fix possible breakage when trying to load non-existant dependency flags
- fix provide flags not being loaded for headers read from rpm files
diff --git a/URPM.xs b/URPM.xs
index aa73ef0..2ca16e5 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -726,7 +726,11 @@ return_list_tag(URPM__Package pkg, const char *tag_name) {
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = tag;
- if (headerGet(pkg->h, he, 0)) {
+ if (!strcasecmp(tag_name, "nvra")) {
+ const char *nvra = get_nvra(pkg->h);
+ XPUSHs(sv_2mortal(newSVpv(nvra, 0)));
+ _free(nvra);
+ } else if (headerGet(pkg->h, he, 0)) {
void *list = he->p.ptr;
if (tag == RPMTAG_ARCH) {
XPUSHs(sv_2mortal(newSVpv(headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? (char *) list : "src", 0)));
@@ -769,9 +773,9 @@ return_list_tag(URPM__Package pkg, const char *tag_name) {
char *release;
char *disttag;
char *distepoch;
-
char *arch;
char *eos;
+
switch (tag) {
case RPMTAG_NAME:
{
@@ -825,8 +829,8 @@ return_list_tag(URPM__Package pkg, const char *tag_name) {
/* fix to match %{___NVRA} later... */
case RPMTAG_NVRA:
{
- get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos);
- XPUSHs(sv_2mortal(newSVpvf("%s-%s-%s.%s", name, version, release, arch)));
+ const char *eon = strchr(pkg->info, '@');
+ XPUSHs(sv_2mortal(newSVpv(pkg->info, eon ? eon-pkg->info : 0)));
}
break;
default:
@@ -1092,7 +1096,7 @@ pack_header(URPM__Package pkg) {
}
if (!(pkg->flag & FLAG_NO_HEADER_FREE)) pkg->h =headerFree(pkg->h);
- pkg->h = 0;
+ pkg->h = NULL;
}
}