From: Chris 'BinGOs' Williams Date: Sat, 21 Mar 2009 16:13:19 +0000 (+0100) Subject: Update CPANPLUS::Dist::Build to 0.16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=baddfc47200940b4403c4d51ab778cf6e1032ec1;p=p5sagit%2Fp5-mst-13.2.git Update CPANPLUS::Dist::Build to 0.16 Also set BinGOs as the maintainer for CPANPLUS::Dist::Build. --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index a56a985..d1006aa 100644 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -18,6 +18,7 @@ package Maintainers; 'arandal' => 'Allison Randal ', 'audreyt' => 'Audrey Tang ', 'avar' => 'Ævar Arnfjörð Bjarmason ', + 'bingos' => 'Chris Williams ', 'chorny' => "Alexandr Ciornii ", 'corion' => 'Max Maischein ', 'craig' => 'Craig Berry ', @@ -270,7 +271,7 @@ package Maintainers; 'CPANPLUS::Dist::Build' => { - 'MAINTAINER' => 'kwilliams', + 'MAINTAINER' => 'bingos', 'FILES' => q[lib/CPANPLUS/Dist/Build.pm lib/CPANPLUS/Dist/Build], 'CPAN' => 1, 'UPSTREAM' => 'cpan', diff --git a/lib/CPANPLUS/Dist/Build.pm b/lib/CPANPLUS/Dist/Build.pm index 550041b..57b908a 100644 --- a/lib/CPANPLUS/Dist/Build.pm +++ b/lib/CPANPLUS/Dist/Build.pm @@ -31,7 +31,7 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; local $Params::Check::VERBOSE = 1; -$VERSION = '0.14'; +$VERSION = '0.16'; =pod @@ -267,7 +267,7 @@ sub prepare { local @INC = CPANPLUS::inc->original_inc; ### this will generate warnings under anything lower than M::B 0.2606 - my %buildflags = $dist->_buildflags_as_hash( $buildflags ); + my @buildflags = $dist->_buildflags_as_list( $buildflags ); $dist->status->_buildflags( $buildflags ); my $fail; @@ -312,7 +312,7 @@ sub prepare { my $env = 'ENV_CPANPLUS_IS_EXECUTING'; local $ENV{$env} = BUILD_PL->( $dir ); - unless ( scalar run( command => [$perl, BUILD_PL->($dir), $buildflags], + unless ( scalar run( command => [$perl, BUILD_PL->($dir), @buildflags], buffer => \$prep_output, verbose => $verbose ) ) { @@ -379,9 +379,11 @@ sub _find_prereqs { my $content; if ( version->new( $Module::Build::VERSION ) >= $safe_ver and ! ON_WIN32 ) { + my @buildflags = $dist->_buildflags_as_list( $buildflags ); + # Use the new Build action 'prereq_data' - unless ( scalar run( command => [$perl, BUILD->($dir), 'prereq_data', $buildflags], + unless ( scalar run( command => [$perl, BUILD->($dir), 'prereq_data', @buildflags], buffer => \$content, verbose => 0 ) ) { @@ -540,7 +542,7 @@ sub create { if $self->best_path_to_module_build; ### this will generate warnings under anything lower than M::B 0.2606 - my %buildflags = $dist->_buildflags_as_hash( $buildflags ); + my @buildflags = $dist->_buildflags_as_list( $buildflags ); $dist->status->_buildflags( $buildflags ); my $fail; my $prereq_fail; my $test_fail; @@ -573,7 +575,7 @@ sub create { my $captured; - unless ( scalar run( command => [$perl, BUILD->($dir), $buildflags], + unless ( scalar run( command => [$perl, BUILD->($dir), @buildflags], buffer => \$captured, verbose => $verbose ) ) { @@ -595,7 +597,7 @@ sub create { unless( $skiptest ) { my $test_output; my $flag = ON_VMS ? '"test"' : 'test'; - my $cmd = [$perl, BUILD->($dir), $flag, $buildflags]; + my $cmd = [$perl, BUILD->($dir), $flag, @buildflags]; unless ( scalar run( command => $cmd, buffer => \$test_output, verbose => $verbose ) @@ -704,7 +706,8 @@ sub install { } my $fail; - my $buildflags = $dist->status->_buildflags; + my @buildflags = $dist->_buildflags_as_list( $dist->status->_buildflags ); + ### hmm, how is this going to deal with sudo? ### for now, check effective uid, if it's not root, ### shell out, otherwise use the method @@ -715,7 +718,7 @@ sub install { ### M::B at the top of the build.pl ### On VMS, flags need to be quoted my $flag = ON_VMS ? '"install"' : 'install'; - my $cmd = [$perl, BUILD->($dir), $flag, $buildflags]; + my $cmd = [$perl, BUILD->($dir), $flag, @buildflags]; my $sudo = $conf->get_program('sudo'); unshift @$cmd, $sudo if $sudo; @@ -729,11 +732,9 @@ sub install { $fail++; } } else { - my %buildflags = $dist->_buildflags_as_hash($buildflags); - my $install_output; my $flag = ON_VMS ? '"install"' : 'install'; - my $cmd = [$perl, BUILD->($dir), $flag, $buildflags]; + my $cmd = [$perl, BUILD->($dir), $flag, @buildflags]; unless( scalar run( command => $cmd, buffer => \$install_output, verbose => $verbose ) @@ -754,15 +755,13 @@ sub install { return $dist->status->installed( $fail ? 0 : 1 ); } -### returns the string 'foo=bar zot=quux' as (foo => bar, zot => quux) -sub _buildflags_as_hash { +### returns the string 'foo=bar --zot quux' +### as the list 'foo=bar', '--zot', 'qux' +sub _buildflags_as_list { my $self = shift; my $flags = shift or return; - my @argv = Module::Build->split_like_shell($flags); - my ($argv) = Module::Build->read_args(@argv); - - return %$argv; + return Module::Build->split_like_shell($flags); } =head1 AUTHOR diff --git a/lib/CPANPLUS/Dist/Build/Constants.pm b/lib/CPANPLUS/Dist/Build/Constants.pm index 52db6b7..4b9ac18 100644 --- a/lib/CPANPLUS/Dist/Build/Constants.pm +++ b/lib/CPANPLUS/Dist/Build/Constants.pm @@ -9,7 +9,7 @@ BEGIN { require Exporter; use vars qw[$VERSION @ISA @EXPORT]; - $VERSION = '0.14'; + $VERSION = '0.16'; @ISA = qw[Exporter]; @EXPORT = qw[ BUILD_DIR BUILD ]; }