diff options
author | Francois Pons <fpons@mandriva.com> | 2001-02-19 14:56:36 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-02-19 14:56:36 +0000 |
commit | 9d85e901ed85548eca61eecc23bec48cbb76f734 (patch) | |
tree | 7eb2833b7795c5e0aa0ea10155867bc29d916924 /rpmtools.pm | |
parent | c92b3c436dc83ee75d711d890ad1b82be43faa20 (diff) | |
download | rpmtools-9d85e901ed85548eca61eecc23bec48cbb76f734.tar rpmtools-9d85e901ed85548eca61eecc23bec48cbb76f734.tar.gz rpmtools-9d85e901ed85548eca61eecc23bec48cbb76f734.tar.bz2 rpmtools-9d85e901ed85548eca61eecc23bec48cbb76f734.tar.xz rpmtools-9d85e901ed85548eca61eecc23bec48cbb76f734.zip |
*** empty log message ***
Diffstat (limited to 'rpmtools.pm')
-rw-r--r-- | rpmtools.pm | 9 |
1 files changed, 5 insertions, 4 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. |