### these constants were exported by CPANPLUS::Internals::Constants
### in previous versions.. they do the same though. If we want to have
### a normal 'use' here, up the dependency to CPANPLUS 0.056 or higher
-BEGIN {
+BEGIN {
require CPANPLUS::Dist::Build::Constants;
CPANPLUS::Dist::Build::Constants->import()
if not __PACKAGE__->can('BUILD') && __PACKAGE__->can('BUILD_DIR');
local $Params::Check::VERBOSE = 1;
-$VERSION = '0.54';
+$VERSION = '0.56';
=pod
format => 'CPANPLUS::Dist::Build',
module => $modobj,
);
-
- $build->prepare; # runs Build.PL
+
+ $build->prepare; # runs Build.PL
$build->create; # runs build && build test
$build->install; # runs build install
modules. It inherits from C<CPANPLUS::Dist>.
Normal users won't have to worry about the interface to this module,
-as it functions transparently as a plug-in to C<CPANPLUS> and will
+as it functions transparently as a plug-in to C<CPANPLUS> and will
just C<Do The Right Thing> when it's loaded.
=head1 ACCESSORS
=item C<distdir ()>
Full path to the directory in which the C<prepare> call took place,
-set after a call to C<prepare>.
+set after a call to C<prepare>.
=item C<created ()>
=head2 $bool = $dist->prepare([perl => '/path/to/perl', buildflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])
-C<prepare> prepares a distribution, running C<Build.PL>
+C<prepare> prepares a distribution, running C<Build.PL>
and establishing any prerequisites this
distribution has.
-The variable C<PERL5_CPANPLUS_IS_EXECUTING> will be set to the full path
+The variable C<PERL5_CPANPLUS_IS_EXECUTING> will be set to the full path
of the C<Build.PL> that is being executed. This enables any code inside
the C<Build.PL> to know that it is being installed via CPANPLUS.
perl => { default => $^X, store => \$perl },
buildflags => { default => $conf->get_conf('buildflags'),
store => \$buildflags },
- prereq_target => { default => '', store => \$prereq_target },
+ prereq_target => { default => '', store => \$prereq_target },
prereq_format => { default => '',
- store => \$prereq_format },
+ store => \$prereq_format },
prereq_build => { default => 0, store => \$prereq_build },
};
### containing a makefile.pl/build.pl for test purposes?
my $safe_ver = version->new('0.85_01');
if ( version->new($CPANPLUS::Internals::VERSION) >= $safe_ver )
- { my $configure_requires = $dist->find_configure_requires;
+ { my $configure_requires = $dist->find_configure_requires;
my $ok = $dist->_resolve_prereqs(
format => $prereq_format,
verbose => $verbose,
target => $prereq_target,
force => $force,
prereq_build => $prereq_build,
- );
-
+ );
+
unless( $ok ) {
-
+
#### use $dist->flush to reset the cache ###
error( loc( "Unable to satisfy '%1' for '%2' " .
- "-- aborting install",
- 'configure_requires', $self->module ) );
+ "-- aborting install",
+ 'configure_requires', $self->module ) );
$dist->status->prepared(0);
- $fail++;
+ $fail++;
last RUN;
- }
+ }
### end of prereq resolving ###
}
unless ( scalar run( command => $cmd,
buffer => \$prep_output,
- verbose => $verbose )
+ verbose => $verbose )
) {
error( loc( "Build.PL failed: %1", $prep_output ) );
$fail++; last RUN;
my $prereqs = $self->status->prereqs;
- $prereqs ||= $dist->_find_prereqs( verbose => $verbose,
- dir => $dir,
+ $prereqs ||= $dist->_find_prereqs( verbose => $verbose,
+ dir => $dir,
perl => $perl,
buildflags => $buildflags );
}
-
+
### send out test report? ###
if( $fail and $conf->get_conf('cpantest') ) {
- $cb->_send_report(
+ $cb->_send_report(
module => $self,
failed => $fail,
buffer => CPANPLUS::Error->stack_as_string,
buildflags => { default => $conf->get_conf('buildflags'),
store => \$buildflags },
};
-
+
my $args = check( $tmpl, \%hash ) or return;
my $prereqs = {};
unless ( scalar run( command => [$perl, $run_perl, BUILD->($dir), 'prereq_data', @buildflags],
buffer => \$content,
- verbose => 0 )
+ verbose => 0 )
) {
error( loc( "Build 'prereq_data' failed: %1 %2", $!, $content ) );
#return;
error( loc( "Cannot open '%1': %2", $file, $! ) );
return;
}
-
+
$content = do { local $/; <$fh> };
}
prereq_format => { #default => $self->status->installer_type,
default => '',
store => \$prereq_format },
- prereq_build => { default => 0, store => \$prereq_build },
+ prereq_build => { default => 0, store => \$prereq_build },
};
$args = check( $tmpl, \%hash ) or return;
unless ( scalar run( command => $cmd,
buffer => \$captured,
- verbose => $verbose )
+ verbose => $verbose )
) {
error( loc( "MAKE failed:\n%1", $captured ) );
$dist->status->build(0);
### add this directory to your lib ###
$self->add_to_includepath();
- ### this buffer will not include what tests failed due to a
- ### M::B/Test::Harness bug. Reported as #9793 with patch
+ ### this buffer will not include what tests failed due to a
+ ### M::B/Test::Harness bug. Reported as #9793 with patch
### against 0.2607 on 26/1/2005
unless( $skiptest ) {
my $test_output;
}
unless ( scalar run( command => $cmd,
buffer => \$test_output,
- verbose => $verbose )
+ verbose => $verbose )
) {
- error( loc( "MAKE TEST failed:\n%1 ", $test_output ) );
+ error( loc( "MAKE TEST failed:\n%1 ", $test_output ), ( $verbose ? 0 : 1 ) );
### mark specifically *test* failure.. so we dont
### send success on force...
$fail++; last RUN;
}
- }
+ }
else {
msg( loc( "MAKE TEST passed:\n%1", $test_output ), 0 );
- #msg( $test_output, 0 );
$dist->status->test(1);
}
- }
+ }
else {
msg(loc("Tests skipped"), $verbose);
}
my $conf = $cb->configure_object;
my %hash = @_;
-
+
my $verbose; my $perl; my $force; my $buildflags;
{ local $Params::Check::ALLOW_UNKNOWN = 1;
my $tmpl = {
store => \$buildflags },
perl => { default => $^X, store => \$perl },
};
-
+
my $args = check( $tmpl, \%hash ) or return;
$dist->status->_install_args( $args );
}
}
### value set and false -- means failure ###
- if( defined $self->status->installed &&
+ if( defined $self->status->installed &&
!$self->status->installed && !$force
) {
error( loc( "Module '%1' has failed to install before this session " .