aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-05 10:35:59 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-05 10:35:59 +0000
commit8f48788d83b7c797218dbd8ad4c061c23a01ee83 (patch)
tree4b650148cfeb11e0cd127ac95361564ab85cee20
parent4d02e7e8a7ebd49f325ddc5a733f0f9e3d9ed69d (diff)
downloadperl-URPM-8f48788d83b7c797218dbd8ad4c061c23a01ee83.tar
perl-URPM-8f48788d83b7c797218dbd8ad4c061c23a01ee83.tar.gz
perl-URPM-8f48788d83b7c797218dbd8ad4c061c23a01ee83.tar.bz2
perl-URPM-8f48788d83b7c797218dbd8ad4c061c23a01ee83.tar.xz
perl-URPM-8f48788d83b7c797218dbd8ad4c061c23a01ee83.zip
always return an array with six items for $package->fullname
-rw-r--r--NEWS3
-rw-r--r--URPM.pm5
-rw-r--r--URPM.xs14
3 files changed, 9 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index ae4be1a..cdbc20b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,7 @@
Version 4.3 -
+- URPM::Package::fullname will now always return six items for array in stead
+ of four to make room for disttag & distepoch, arch will still be returned as
+ last item (ie. array[5] in stead of array[3])
- URPM::Package::files_md5sum() has been renamed to URPM::Package::files_digest()
- fix NEVRA parsing of 'gpg-pubkey'
diff --git a/URPM.pm b/URPM.pm
index 2dcf582..eadeb02 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -572,8 +572,9 @@ List of files in this rpm.
=item $package->fullname()
-Returns a 4 element list: name, version, release and architecture in an array
-context. Returns a string NAME-VERSION-RELEASE.ARCH in scalar context.
+Returns a 6 element list: name, version, release, disttag, distepoch and architecture
+in an array context. Returns a string NAME-VERSION-RELEASE[-DISTTAGDISTEPOCH].ARCH
+in scalar context.
=item $package->get_tag($tagid)
diff --git a/URPM.xs b/URPM.xs
index adfa3ac..692d339 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1781,25 +1781,17 @@ Pkg_fullname(pkg)
PPCODE:
if (gimme == G_ARRAY) {
char *name, *version, *release, *disttag, *distepoch, *arch, *eos;
- int items = 4;
+ int items = 6;
if(get_fullname_parts(pkg, &name, NULL, &version, &release, &disttag, &distepoch, &arch, &eos))
croak("invalid fullname");
- /* XXX: This might result in the number of items and the order which returned
- * being unexpected in the case of disttag/disttag being present.
- */
- if(disttag != NULL) items++;
- if(distepoch != NULL) items++;
-
EXTEND(SP, items);
PUSHs(sv_2mortal(newSVpv(name, 0)));
PUSHs(sv_2mortal(newSVpv(version, 0)));
PUSHs(sv_2mortal(newSVpv(release, 0)));
- if(disttag != NULL)
- PUSHs(sv_2mortal(newSVpv(disttag, 0)));
- if(distepoch != NULL)
- PUSHs(sv_2mortal(newSVpv(distepoch, 0)));
+ PUSHs(sv_2mortal(newSVpv(disttag, 0)));
+ PUSHs(sv_2mortal(newSVpv(distepoch, 0)));
PUSHs(sv_2mortal(newSVpv(arch, 0)));
restore_chars();
} else if (gimme == G_SCALAR) {