aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-02-19 16:38:59 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-02-19 16:38:59 +0000
commit80abd3ae98ed26e2b53c012f281214d2af126ddb (patch)
tree1bf1336b9881f086c91738fa106f9304bdd0bf04
parent4f62e73fe8b3ff3121ccac10c0e858ddcc6c4a10 (diff)
downloadperl-URPM-80abd3ae98ed26e2b53c012f281214d2af126ddb.tar
perl-URPM-80abd3ae98ed26e2b53c012f281214d2af126ddb.tar.gz
perl-URPM-80abd3ae98ed26e2b53c012f281214d2af126ddb.tar.bz2
perl-URPM-80abd3ae98ed26e2b53c012f281214d2af126ddb.tar.xz
perl-URPM-80abd3ae98ed26e2b53c012f281214d2af126ddb.zip
fix incorrect arch returned for packages without any (ie. public keys)
-rw-r--r--NEWS1
-rw-r--r--URPM.xs6
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 8ca8811..87fa096 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
Version 3.37.2 - 2011, by Per Øyvind Karlsen
+- fix incorrect arch returned for packages without any (ie. public keys)
- eliminate disttag & distepoch when extracting name, version, release to
handle upgrade
diff --git a/URPM.xs b/URPM.xs
index c8cfc39..f6aff28 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -694,7 +694,7 @@ return_list_tag(URPM__Package pkg, int32_t tag_name) {
case RPMTAG_ARCH:
{
get_fullname_parts(pkg, &name, &version, &release, &arch, &eos);
- XPUSHs(sv_2mortal(newSVpv(arch, eos-arch)));
+ XPUSHs(sv_2mortal(newSVpv(arch == eos ? "" : arch, eos-arch)));
}
break;
case RPMTAG_SUMMARY:
@@ -1580,7 +1580,7 @@ Pkg_arch(pkg)
char *eos;
get_fullname_parts(pkg, NULL, NULL, NULL, &arch, &eos);
- XPUSHs(sv_2mortal(newSVpv(arch, eos-arch)));
+ XPUSHs(sv_2mortal(newSVpv(arch == eos ? "" : arch, eos-arch)));
restore_chars();
} else if (pkg->h) {
XPUSHs(sv_2mortal(newSVpv(headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? get_name(pkg->h, RPMTAG_ARCH) : "src", 0)));
@@ -1798,7 +1798,7 @@ Pkg_fullname(pkg)
PUSHs(sv_2mortal(newSVpv(name, version-name-1)));
PUSHs(sv_2mortal(newSVpv(version, release-version-1)));
PUSHs(sv_2mortal(newSVpv(release, arch-release-1)));
- PUSHs(sv_2mortal(newSVpv(arch, eos-arch)));
+ PUSHs(sv_2mortal(newSVpv(arch == eos ? "" : arch, eos-arch)));
restore_chars();
}
} else if (pkg->h) {