Version 1 is higher than version fc5.
authorJamie Cameron <jcameron@webmin.com>
Thu, 4 Nov 2010 04:21:12 +0000 (21:21 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 4 Nov 2010 04:21:12 +0000 (21:21 -0700)
software/software-lib.pl

index 1b15e2f..949712a 100755 (executable)
@@ -231,6 +231,14 @@ for(my $i=0; $i<@sp1 || $i<@sp2; $i++) {
                                }
                        }
                }
+       elsif ($v1 =~ /^\d+$/ && $v2 !~ /^\d+$/) {
+               # Numeric compared to non-numeric - numeric is always higher
+               $comp = 1;
+               }
+       elsif ($v1 =~ /^\d+$/ && $v2 !~ /^\d+$/) {
+               # Non-numeric compared to numeric - numeric is always higher
+               $comp = -1;
+               }
        else {
                # String compare only
                $comp = $v1 cmp $v2;