[Bps-public-commit] r19652 - in RT-Extension-SLA/inc/Module: Install
ruz at bestpractical.com
ruz at bestpractical.com
Wed May 13 17:56:45 EDT 2009
Author: ruz
Date: Wed May 13 17:56:44 2009
New Revision: 19652
Modified:
RT-Extension-SLA/inc/Module/AutoInstall.pm
RT-Extension-SLA/inc/Module/Install.pm
RT-Extension-SLA/inc/Module/Install/AutoInstall.pm
RT-Extension-SLA/inc/Module/Install/Base.pm
RT-Extension-SLA/inc/Module/Install/Can.pm
RT-Extension-SLA/inc/Module/Install/Fetch.pm
RT-Extension-SLA/inc/Module/Install/Include.pm
RT-Extension-SLA/inc/Module/Install/Makefile.pm
RT-Extension-SLA/inc/Module/Install/Metadata.pm
RT-Extension-SLA/inc/Module/Install/Win32.pm
RT-Extension-SLA/inc/Module/Install/WriteAll.pm
Log:
* update M::I
Modified: RT-Extension-SLA/inc/Module/AutoInstall.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/AutoInstall.pm (original)
+++ RT-Extension-SLA/inc/Module/AutoInstall.pm Wed May 13 17:56:44 2009
@@ -18,7 +18,9 @@
# 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 @@
elsif ( $arg =~ /^--test(?:only)?$/ ) {
$TestOnly = 1;
}
+ elsif ( $arg =~ /^--all(?:deps)?$/ ) {
+ $AllDeps = 1;
+ }
}
}
@@ -115,7 +120,12 @@
)[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 @@
and (
$CheckOnly
or ($mandatory and $UnderCPAN)
+ or $AllDeps
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
@@ -235,21 +246,35 @@
*{'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 @@
# 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__
-#line 1004
+#line 1045
Modified: RT-Extension-SLA/inc/Module/Install.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install.pm (original)
+++ RT-Extension-SLA/inc/Module/Install.pm Wed May 13 17:56:44 2009
@@ -28,7 +28,7 @@
# 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.85';
+ $VERSION = '0.87';
# Storage for the pseudo-singleton
$MAIN = undef;
Modified: RT-Extension-SLA/inc/Module/Install/AutoInstall.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/AutoInstall.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/AutoInstall.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: RT-Extension-SLA/inc/Module/Install/Base.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Base.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Base.pm Wed May 13 17:56:44 2009
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
}
# Suspend handler for "redefined" warnings
Modified: RT-Extension-SLA/inc/Module/Install/Can.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Can.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Can.pm Wed May 13 17:56:44 2009
@@ -9,7 +9,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: RT-Extension-SLA/inc/Module/Install/Fetch.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Fetch.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Fetch.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: RT-Extension-SLA/inc/Module/Install/Include.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Include.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Include.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: RT-Extension-SLA/inc/Module/Install/Makefile.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Makefile.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Makefile.pm Wed May 13 17:56:44 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: RT-Extension-SLA/inc/Module/Install/Metadata.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Metadata.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Metadata.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: RT-Extension-SLA/inc/Module/Install/Win32.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/Win32.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/Win32.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: RT-Extension-SLA/inc/Module/Install/WriteAll.pm
==============================================================================
--- RT-Extension-SLA/inc/Module/Install/WriteAll.pm (original)
+++ RT-Extension-SLA/inc/Module/Install/WriteAll.pm Wed May 13 17:56:44 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.87';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
More information about the Bps-public-commit
mailing list