aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.xs
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-02-19 16:45:55 +0000
committerFrancois Pons <fpons@mandriva.com>2001-02-19 16:45:55 +0000
commit5793e3408624f83c9f12d76b340f20b2da63d849 (patch)
treef63390537db849275b9531f4cadf724e256e34cf /rpmtools.xs
parent9d85e901ed85548eca61eecc23bec48cbb76f734 (diff)
downloadrpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.gz
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.bz2
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.xz
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.zip
*** empty log message ***
Diffstat (limited to 'rpmtools.xs')
-rw-r--r--rpmtools.xs10
1 files changed, 9 insertions, 1 deletions
diff --git a/rpmtools.xs b/rpmtools.xs
index dac839b..4aeebd1 100644
--- a/rpmtools.xs
+++ b/rpmtools.xs
@@ -428,7 +428,7 @@ _parse_(fileno_or_rpmfile, flag, info, ...)
SV* info
PREINIT:
SV* provides = &PL_sv_undef;
- CODE:
+ PPCODE:
if (items > 3)
provides = ST(3);
if (SvROK(flag) && SvROK(info) && (provides == &PL_sv_undef || SvROK(provides))) {
@@ -473,6 +473,10 @@ _parse_(fileno_or_rpmfile, flag, info, ...)
((header=headerRead(fd, HEADER_MAGIC_YES)) != 0) :
((fd_is_hdlist = -1), rpmReadPackageHeader(fd, &header, &i, NULL, NULL) == 0)) : 0) {
char *name = get_name(header, RPMTAG_NAME);
+ char *version = get_name(header, RPMTAG_VERSION);
+ char *release = get_name(header, RPMTAG_RELEASE);
+ char *fullname = (char*)alloca(strlen(name)+strlen(version)+strlen(release)+3);
+ STRLEN fullname_len = sprintf(fullname, "%s-%s-%s", name, version, release);
HV* header_info = get_info(header, bflag, iprovides);
/* once the hash header_info is built, store a reference to it
@@ -480,6 +484,10 @@ _parse_(fileno_or_rpmfile, flag, info, ...)
note sv_name is not incremented here, it has the default value of before. */
hv_store(iinfo, name, strlen(name), newRV_noinc((SV*)header_info), 0);
+ /* return fullname on stack */
+ EXTEND(SP, 1);
+ PUSHs(sv_2mortal(newSVpv(fullname, fullname_len)));
+
/* dispose of some memory */
headerFree(header);
}