Commit 853a6f60 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Update inc/

parent 6a430b71
......@@ -18,6 +18,7 @@ name: RT-Extension-LDAPImport
no_index:
directory:
- inc
- t
- xt
recommends:
Net::LDAP::Server::Test: 0
......
......@@ -174,14 +174,37 @@ 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-@b)
: push @a, (0) x (@b-@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);
require RT::Handle;
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
my @sorted = sort cmp_version $version,$RT::VERSION;
if ($sorted[-1] eq $version) {
# should we die?
......@@ -193,4 +216,4 @@ sub requires_rt {
__END__
#line 313
#line 336
......@@ -7,7 +7,7 @@ use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
$VERSION = '0.20';
$VERSION = '0.22';
sub readme_from {
my $self = shift;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment