Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
best-practical
rt-extension-sla
Commits
c837fc55
Commit
c837fc55
authored
May 13, 2009
by
Ruslan Zakirov
Browse files
update M::I
parent
b5df3d71
Changes
11
Hide whitespace changes
Inline
Side-by-side
inc/Module/AutoInstall.pm
View file @
c837fc55
...
...
@@ -18,7 +18,9 @@ my %FeatureMap = (
# various lexical flags
my
(
@Missing
,
@Existing
,
%DisabledTests
,
$UnderCPAN
,
$HasCPANPLUS
);
my
(
$Config
,
$CheckOnly
,
$SkipInstall
,
$AcceptDefault
,
$TestOnly
);
my
(
$Config
,
$CheckOnly
,
$SkipInstall
,
$AcceptDefault
,
$TestOnly
,
$AllDeps
);
my
(
$PostambleActions
,
$PostambleUsed
);
# See if it's a testing or non-interactive session
...
...
@@ -73,6 +75,9 @@ sub _init {
elsif
(
$arg
=~
/^--test(?:only)?$/
)
{
$TestOnly
=
1
;
}
elsif
(
$arg
=~
/^--all(?:deps)?$/
)
{
$AllDeps
=
1
;
}
}
}
...
...
@@ -115,7 +120,12 @@ sub import {
)[
0
]
);
$UnderCPAN
=
_check_lock
(
1
);
# check for $UnderCPAN
# We want to know if we're under CPAN early to avoid prompting, but
# if we aren't going to try and install anything anyway then skip the
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
$UnderCPAN
=
_check_lock
(
1
)
unless
$SkipInstall
;
while
(
my
(
$feature
,
$modules
)
=
splice
(
@args
,
0
,
2
)
)
{
my
(
@required
,
@tests
,
@skiptests
);
...
...
@@ -187,6 +197,7 @@ sub import {
and
(
$CheckOnly
or
(
$mandatory
and
$UnderCPAN
)
or
$AllDeps
or
_prompt
(
qq{==> Auto-install the }
.
(
@required
/
2
)
...
...
@@ -235,21 +246,35 @@ sub import {
*
{'
main::WriteMakefile
'}
=
\
&Write
if
caller
(
0
)
eq
'
main
';
}
sub
_running_under
{
my
$thing
=
shift
;
print
<<"END_MESSAGE";
*** Since we're running under ${thing}, I'll just let it take care
of the dependency's installation later.
END_MESSAGE
return
1
;
}
# Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
# if we are, then we simply let it taking care of our dependencies
sub
_check_lock
{
return
unless
@Missing
or
@_
;
my
$cpan_env
=
$ENV
{
PERL5_CPAN_IS_RUNNING
};
if
(
$ENV
{
PERL5_CPANPLUS_IS_RUNNING
})
{
print
<<'END_MESSAGE';
return
_running_under
(
$cpan_env
?
'
CPAN
'
:
'
CPANPLUS
');
}
*** Since we're running under CPANPLUS, I'll just let it take care
of the dependency's installation later.
END_MESSAGE
return
1
;
require
CPAN
;
if
(
$
CPAN::
VERSION
>
'
1.89
'
&&
$cpan_env
)
{
return
_running_under
('
CPAN
')
;
}
_load_cpan
();
# last ditch attempt, this -will- configure CPAN, very sorry
_load_cpan
(
1
);
# force initialize even though it's already loaded
# Find the CPAN lock-file
my
$lock
=
MM
->
catfile
(
$
CPAN::
Config
->
{
cpan_home
},
"
.lock
"
);
...
...
@@ -633,7 +658,7 @@ sub _load {
# Load CPAN.pm and it's configuration
sub
_load_cpan
{
return
if
$
CPAN::
VERSION
;
return
if
$
CPAN::
VERSION
and
not
@_
;
require
CPAN
;
if
(
$
CPAN::HandleConfig::
VERSION
)
{
# Newer versions of CPAN have a HandleConfig module
...
...
@@ -766,4 +791,4 @@ END_MAKE
__END__
#line 10
0
4
#line 104
5
inc/Module/Install.pm
View file @
c837fc55
...
...
@@ -28,7 +28,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
# Storage for the pseudo-singleton
$MAIN
=
undef
;
...
...
inc/Module/Install/AutoInstall.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION $ISCORE @ISA}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
$ISCORE
=
1
;
@ISA
=
qw{Module::Install::Base}
;
}
...
...
inc/Module/Install/Base.pm
View file @
c837fc55
...
...
@@ -4,7 +4,7 @@ package Module::Install::Base;
use
strict
'
vars
';
use
vars
qw{$VERSION}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
}
# Suspend handler for "redefined" warnings
...
...
inc/Module/Install/Can.pm
View file @
c837fc55
...
...
@@ -9,7 +9,7 @@ use ExtUtils::MakeMaker ();
use
vars
qw{$VERSION $ISCORE @ISA}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
$ISCORE
=
1
;
@ISA
=
qw{Module::Install::Base}
;
}
...
...
inc/Module/Install/Fetch.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION $ISCORE @ISA}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
$ISCORE
=
1
;
@ISA
=
qw{Module::Install::Base}
;
}
...
...
inc/Module/Install/Include.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION $ISCORE @ISA}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
$ISCORE
=
1
;
@ISA
=
qw{Module::Install::Base}
;
}
...
...
inc/Module/Install/Makefile.pm
View file @
c837fc55
...
...
@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
use
vars
qw{$VERSION
$ISCORE
@ISA};
BEGIN
{
$VERSION
=
'0.8
5
'
;
$VERSION
=
'0.8
7
'
;
$ISCORE
=
1
;
@ISA = qw{Module
::
Install::Base};
}
...
...
inc/Module/Install/Metadata.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION @ISA $ISCORE}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
@ISA
=
qw{Module::Install::Base}
;
$ISCORE
=
1
;
}
...
...
inc/Module/Install/Win32.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION @ISA $ISCORE}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
@ISA
=
qw{Module::Install::Base}
;
$ISCORE
=
1
;
}
...
...
inc/Module/Install/WriteAll.pm
View file @
c837fc55
...
...
@@ -6,7 +6,7 @@ use Module::Install::Base;
use
vars
qw{$VERSION @ISA $ISCORE}
;
BEGIN
{
$VERSION
=
'
0.8
5
';
$VERSION
=
'
0.8
7
';
@ISA
=
qw{Module::Install::Base}
;
$ISCORE
=
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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