diff options
author | Francois Pons <fpons@mandriva.com> | 2001-07-25 14:59:35 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-07-25 14:59:35 +0000 |
commit | 5070f3f86e1897c43fb47007d9aebd55c68f5c9e (patch) | |
tree | 702f309c30991bd8fa91f17edae627f7258cd6b0 /rpmtools.pm | |
parent | c019f7e04986a404b6a556624d06585f5b3fe744 (diff) | |
download | rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.gz rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.bz2 rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.tar.xz rpmtools-5070f3f86e1897c43fb47007d9aebd55c68f5c9e.zip |
use rpmlib version comparison function, force destiny.3.1.2
Diffstat (limited to 'rpmtools.pm')
-rw-r--r-- | rpmtools.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/rpmtools.pm b/rpmtools.pm index ab7e7d8..5c8445d 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -601,16 +601,18 @@ sub compat_arch { better_arch(arch(), $_[0]) } #- compare a version string, make sure no deadlock can occur. #- 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); - $_ = ($sa =~ /^\d/ || $sb =~ /^\d/) && length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0; - $sa eq '' && $sb eq '' and return $a cmp $b || 0; - } - 0; + return rpmvercmp(@_); } +#- historical perl version (still breaks on "4m" with "4.1m"... +#- 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; +#- } +#- 0; #- compare package name to increase chance of avoiding loop in prerequisite chain. sub package_name_compare { |