diff options
author | Francois Pons <fpons@mandriva.com> | 2002-01-09 12:57:54 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-01-09 12:57:54 +0000 |
commit | 6b72aa3f68e6ed0023720defac341273a56fdc6a (patch) | |
tree | e2e6f0058edc4491dd21f8ad079c4979021b4f5d /perl-install/pkgs.pm | |
parent | 8e1302329799723ad368b9f662ba8111f67ea516 (diff) | |
download | drakx-6b72aa3f68e6ed0023720defac341273a56fdc6a.tar drakx-6b72aa3f68e6ed0023720defac341273a56fdc6a.tar.gz drakx-6b72aa3f68e6ed0023720defac341273a56fdc6a.tar.bz2 drakx-6b72aa3f68e6ed0023720defac341273a56fdc6a.tar.xz drakx-6b72aa3f68e6ed0023720defac341273a56fdc6a.zip |
use rpm version comparison function.
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index e8dd9fac2..c02e7f3e7 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -928,15 +928,17 @@ sub done_db { } sub versionCompare($$) { - 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); - $_ = ($sa =~ /^\d/ || $sb =~ /^\d/) && length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0; - $sa eq '' && $sb eq '' and return $a cmp $b || 0; - } + goto &c::rpmvercmp; } +#- old code using perl version, still broken on some case. +#- 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); +#- $_ = ($sa =~ /^\d/ || $sb =~ /^\d/) && length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0; +#- $sa eq '' && $sb eq '' and return $a cmp $b || 0; +#- } sub selectPackagesAlreadyInstalled { my ($packages, $prefix) = @_; |