aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-25 14:59:35 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-25 14:59:35 +0000
commit5070f3f86e1897c43fb47007d9aebd55c68f5c9e (patch)
tree702f309c30991bd8fa91f17edae627f7258cd6b0 /rpmtools.pm
parentc019f7e04986a404b6a556624d06585f5b3fe744 (diff)
downloadrpmtools-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.pm20
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 {