[Bps-public-commit] Module-Install-RTx branch, remove-cmp_versions, created. 0.32-1-g0ab9be6

Kevin Falcone falcone at bestpractical.com
Fri Sep 6 12:20:23 EDT 2013


The branch, remove-cmp_versions has been created
        at  0ab9be632525a925b3865df7acd7a39a0dfe3e40 (commit)

- Log -----------------------------------------------------------------
commit 0ab9be632525a925b3865df7acd7a39a0dfe3e40
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Sep 6 12:17:08 2013 -0400

    Removing code that we shouldn't need now that 3.6 is EOL
    
    Minimal testing shows that this works, but it wants more poking before I
    ship it as a tagged version.  I've tested on a dist with DB steps, we
    want to test on several other dists first.

diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index ae79a34..99f6cea 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -173,37 +173,13 @@ install ::
     }
 }
 
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
-    a     => -4,
-    alpha => -4,
-    b     => -3,
-    beta  => -3,
-    pre   => -2,
-    rc    => -1,
-    head  => 9999,
-);
-sub cmp_version($$) {
-    my ($a, $b) = (@_);
-    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $a;
-    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $b;
-    @a > @b
-        ? push @b, (0) x (@a- at b)
-        : push @a, (0) x (@b- at a);
-    for ( my $i = 0; $i < @a; $i++ ) {
-        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
-    }
-    return 0;
-}}
 sub requires_rt {
     my ($self,$version) = @_;
 
     # if we're exactly the same version as what we want, silently return
     return if ($version eq $RT::VERSION);
 
-    my @sorted = sort cmp_version $version,$RT::VERSION;
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
         # should we die?

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list