Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rt-extension-ldapimport
Commits
853a6f60
Commit
853a6f60
authored
Sep 24, 2013
by
Alex Vandiver
Browse files
Update inc/
parent
6a430b71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
META.yml
META.yml
+1
-0
inc/Module/Install/RTx.pm
inc/Module/Install/RTx.pm
+26
-3
inc/Module/Install/ReadmeFromPod.pm
inc/Module/Install/ReadmeFromPod.pm
+1
-1
No files found.
META.yml
View file @
853a6f60
...
...
@@ -18,6 +18,7 @@ name: RT-Extension-LDAPImport
no_index
:
directory
:
-
inc
-
t
-
xt
recommends
:
Net::LDAP::Server::Test:
0
...
...
inc/Module/Install/RTx.pm
View file @
853a6f60
...
...
@@ -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 3
1
3
#line 33
6
inc/Module/Install/ReadmeFromPod.pm
View file @
853a6f60
...
...
@@ -7,7 +7,7 @@ use warnings;
use
base
qw(Module::Install::Base)
;
use
vars
qw($VERSION)
;
$VERSION
=
'
0.2
0
';
$VERSION
=
'
0.2
2
';
sub
readme_from
{
my
$self
=
shift
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment