diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm old mode 100755 new mode 100644 index b920ef108..bce499e13 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -3596,6 +3596,8 @@ sub version_cmp { $ver_a = shift; } my $ver_b = shift; + $ver_a =~ s/([-.]0+)+$//; + $ver_b =~ s/([-.]0+)+$//; my @array_a = ($ver_a =~ /([-.]|\d+|[^-.\d]+)/g); my @array_b = ($ver_b =~ /([-.]|\d+|[^-.\d]+)/g); @@ -3620,9 +3622,12 @@ sub version_cmp { } elsif ( $b eq '.' ) { return 1; } elsif ($a =~ /^\d+$/ and $b =~ /^\d+$/) { - if ($a =~ /^0/ || $b =~ /^0/) { - return ($a cmp $b); - } else { +# if ($a =~ /^0/ || $b =~ /^0/) { +# return ($a cmp $b); +# } else { +# return ($a <=> $b); +# } + if($a != $b ){ return ($a <=> $b); } } else {