aboutsummaryrefslogtreecommitdiffstats
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
parent9d85e901ed85548eca61eecc23bec48cbb76f734 (diff)
downloadrpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.gz
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.bz2
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.tar.xz
rpmtools-5793e3408624f83c9f12d76b340f20b2da63d849.zip
*** empty log message ***
-rw-r--r--rpmtools.pm5
-rw-r--r--rpmtools.spec5
-rw-r--r--rpmtools.xs10
3 files changed, 14 insertions, 6 deletions
diff --git a/rpmtools.pm b/rpmtools.pm
index 1f29563..891321a 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -150,10 +150,7 @@ sub build_hdlist {
sub read_rpms {
my ($params, @rpms) = @_;
- foreach (@rpms) {
- rpmtools::_parse_($_, $params->{flags}, $params->{info}, $params->{provides});
- }
- 1;
+ map { rpmtools::_parse_($_, $params->{flags}, $params->{info}, $params->{provides}) } @rpms;
}
#- compute dependancies, result in stored in info values of params.
diff --git a/rpmtools.spec b/rpmtools.spec
index 13b7d1f..0c1492f 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,5 +1,5 @@
%define name rpmtools
-%define release 3mdk
+%define release 4mdk
# do not modify here, see Makefile in the CVS
%define version 2.3
@@ -51,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Mon Feb 19 2001 François Pons <fpons@mandrakesoft.com> 2.3-4mdk
+- _parse_ returns now fullname of package read.
+
* Mon Feb 19 2001 François Pons <fpons@mandrakesoft.com> 2.3-3mdk
- fixed version_compare to return number.
- fixed relocate_depslist for package with source to keep.
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);
}