diff options
-rw-r--r-- | rpmtools.pm | 9 | ||||
-rw-r--r-- | rpmtools.spec | 6 | ||||
-rw-r--r-- | rpmtools.xs | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/rpmtools.pm b/rpmtools.pm index 245be20..1f29563 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -392,6 +392,7 @@ sub relocate_depslist { if ($relocated_entries) { for (0 .. scalar(@{$params->{depslist}}) - 1) { my $pkg = $params->{depslist}[$_]; + $pkg->{source} and next; #- hack to avoid losing local package. $params->{depslist}[$_] = $params->{info}{$pkg->{name}}; } } @@ -530,17 +531,17 @@ sub write_compss { } #- compare a version string, make sure no deadlock can occur. -#- bug: "0" and "" are equal (same for "" and "0"), should be -#- trapped by release comparison (unless not correct). +#- try to return always a numerical value. sub version_compare { my ($a, $b) = @_; local $_; while ($a || $b) { my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D*)// } ($b, $a); - $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_; - $sa eq '' && $sb eq '' and return $a cmp $b; + $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_ || 0; + $sa eq '' && $sb eq '' and return $a cmp $b || 0; } + 0; } #- compability function which should be removed soon, do not use anymore and replace code. diff --git a/rpmtools.spec b/rpmtools.spec index 9184f94..13b7d1f 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 2mdk +%define release 3mdk # do not modify here, see Makefile in the CVS %define version 2.3 @@ -51,6 +51,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* 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. + * Fri Feb 16 2001 François Pons <fpons@mandrakesoft.com> 2.3-2mdk - fixed invocation of parsehdlist with full package name including version and release. make sure to write only one diff --git a/rpmtools.xs b/rpmtools.xs index 5130133..dac839b 100644 --- a/rpmtools.xs +++ b/rpmtools.xs @@ -472,13 +472,13 @@ _parse_(fileno_or_rpmfile, flag, info, ...) while (fd_is_hdlist >= 0 ? (fd_is_hdlist > 0 ? ((header=headerRead(fd, HEADER_MAGIC_YES)) != 0) : ((fd_is_hdlist = -1), rpmReadPackageHeader(fd, &header, &i, NULL, NULL) == 0)) : 0) { - SV* sv_name = newSVpv(get_name(header, RPMTAG_NAME), 0); + char *name = get_name(header, RPMTAG_NAME); HV* header_info = get_info(header, bflag, iprovides); /* once the hash header_info is built, store a reference to it in iinfo. note sv_name is not incremented here, it has the default value of before. */ - hv_store_ent(iinfo, sv_name, newRV_noinc((SV*)header_info), 0); + hv_store(iinfo, name, strlen(name), newRV_noinc((SV*)header_info), 0); /* dispose of some memory */ headerFree(header); |