From 9d85e901ed85548eca61eecc23bec48cbb76f734 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 19 Feb 2001 14:56:36 +0000 Subject: *** empty log message *** --- rpmtools.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rpmtools.pm') 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. -- cgit v1.2.1