Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 8014
Status: resolved
Priority: 0/
Queue: CPANPLUS

People
Owner: Nobody in particular
Requestors: neyuki [...] bsx.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.0499
Fixed in: (no value)



Subject: Little typo and separated arguments for MakeMaker and Module::Build.
Salaam alaikum. Firstly, these is a type error in Internals/Make.pm on line 417. Secondly, if installation goes into private directory, Build.PL will not understand MakeMaker set of arguments. Something like makemakerflags is needed for Module::Build. Little patch attached to this post trying to solve this. At least look at it. Thanks. -- neyuki
diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Backend.pm CPANPLUS-0.0499/lib/CPANPLUS/Backend.pm --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Backend.pm 2004-09-20 18:15:22.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Backend.pm 2004-10-14 15:51:32.000000000 +0000 @@ -120,6 +120,7 @@ make => { default => undef }, perl => { default => undef }, makemakerflags => { default => undef }, # hashref + modulebuildflags => { default => undef }, # arrayref fetchdir => { default => undef }, extractdir => { default => undef }, skiptest => { default => undef }, @@ -232,8 +233,8 @@ my %opts = map { $_ => $args->{$_} } grep { defined $args->{$_} } - qw[ force make makeflags makemakerflags perl fetchdir - extractdir skiptest prereq_target]; + qw[ force make makeflags makemakerflags modulebuildflags + perl fetchdir extractdir skiptest prereq_target]; ### a localised hash to store which prereqs where prompted for already ### this means you'll only be asked /once/ about each prereq rather than @@ -442,6 +443,7 @@ make => { default => undef }, perl => { default => undef }, makemakerflags => { default => undef }, # hashref + modulebuildflags => { default => undef }, # arrayref skiptest => { default => undef }, target => { default => 'install' }, prereq_target => { default => 'install' }, diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Config.pm CPANPLUS-0.0499/lib/CPANPLUS/Config.pm --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Config.pm 2004-10-13 18:22:16.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Config.pm 2004-10-14 15:48:17.000000000 +0000 @@ -24,6 +24,7 @@ 'force' => 0, 'makeflags' => {}, 'makemakerflags' => {}, + 'modulebuildflags' => [], 'debug' => 0, 'md5' => 1, 'shell' => 'CPANPLUS::Shell::Default', diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Config.pm-orig CPANPLUS-0.0499/lib/CPANPLUS/Config.pm-orig --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Config.pm-orig 2003-12-11 20:25:22.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Config.pm-orig 2004-10-14 15:48:39.000000000 +0000 @@ -24,6 +24,7 @@ 'force' => 0, 'makeflags' => {}, 'makemakerflags' => {}, + 'modulebuildflags' => [], 'debug' => 0, 'md5' => 1, 'shell' => 'CPANPLUS::Shell::Default', diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Configure/Setup.pm CPANPLUS-0.0499/lib/CPANPLUS/Configure/Setup.pm --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Configure/Setup.pm 2004-09-20 18:15:43.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Configure/Setup.pm 2004-10-14 16:45:36.000000000 +0000 @@ -298,6 +298,46 @@ "'make'" => $conf->get_conf('makeflags'), ); + ####################### + ## modulebuild flags ## + ####################### + + print loc(" +This is a same as 'makemakerflags', but related to Build.PL. + +Enter a preffered arguments list, but quote any embedded +spaces that you want to preserve. (Enter a space to clear any existing +settings.) + +If you don't understand this question, just press ENTER. + +"); + + my $MBflags = $conf->get_conf('modulebuildflags'); + + my $answer = _get_reply( + prompt => loc('Addition Module::Build args? [%1]', "@{$MBflags}"), + default => "@{$MBflags}" + ); + + if ($answer) { + if ($answer =~ m/^\s+$/) { + $MBflags = []; + } else { + (@{$MBflags}) = $answer =~ m/\s*("[^"]+"|'[^']+'|[^\s]+)/g; + } #if + } #if + + printf "\n", loc("Your Module::Build args are now:"), "\n"; + + if (@{$MBflags}) { + print map { " $_\n" } @{$MBflags}; + } else { + print " ", loc("*nothing entered*"), "\n"; + } #if + + print "\n"; + ################# ## shift a lib ## ################# @@ -312,7 +352,7 @@ my $lib = $conf->get_conf('lib'); - my $answer = _get_reply( + $answer = _get_reply( prompt => loc('Additional @INC directories to add? [%1]', "@{$lib}"), default => "@{$lib}", ); @@ -669,6 +709,7 @@ lib => $lib, makeflags => $makeflags, makemakerflags => $MMflags, + modulebuildflags => $MBflags, md5 => $md5, prereqs => $prereqs, shell => $which, diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Configure.pm CPANPLUS-0.0499/lib/CPANPLUS/Configure.pm --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Configure.pm 2004-09-20 18:15:22.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Configure.pm 2004-10-14 14:35:07.000000000 +0000 @@ -106,7 +106,7 @@ ## valid subtypes - must add anything new for Config.pm here my %subtypes = ( conf => [qw( cpantest debug flush force lib makeflags - makemakerflags md5 prereqs shell storable + makemakerflags modulebuildflags md5 prereqs shell storable verbose format signature skiptest )], _build => [qw( curl ftp gzip lynx make ncftp ncftpget pager shell diff -ur -X .ignore CPANPLUS-0.0499.orig/lib/CPANPLUS/Internals/Make.pm CPANPLUS-0.0499/lib/CPANPLUS/Internals/Make.pm --- CPANPLUS-0.0499.orig/lib/CPANPLUS/Internals/Make.pm 2004-09-20 18:15:43.000000000 +0000 +++ CPANPLUS-0.0499/lib/CPANPLUS/Internals/Make.pm 2004-10-14 15:44:14.000000000 +0000 @@ -44,6 +44,7 @@ make => { default => $conf->_get_build('make') }, cpantest => { default => $conf->get_conf('cpantest') }, makemakerflags => { default => $conf->get_conf('makemakerflags') }, + modulebuildflags => { default => $conf->get_conf('modulebuildflags') }, makeflags => { default => $conf->get_conf('makeflags') }, format => { default => $conf->get_conf('format') }, skiptest => { default => $conf->get_conf('skiptest') }, @@ -73,6 +74,7 @@ my $make = $args->{make}; my $report = $args->{cpantest}; my $mmflags = $args->{makemakerflags}; + my $mbflags = $args->{modulebuildflags}; my $makeflags = $args->{makeflags}; my $format = $args->{format}; my $skiptest = $args->{skiptest}; @@ -214,7 +216,8 @@ last PERL_MAKEFILE; } - my @args = @{$self->_flags_arrayref($mmflags)}; + my @args = $Makefile_PL eq 'Build.PL' ? + @$mbflags : @{$self->_flags_arrayref($mmflags)}; unless( $self->_run( command => [$perl, $Makefile_PL, @args], @@ -414,7 +417,8 @@ prereq_target => $prereq_target, force => $force, make => $make, - makemakerlfags => $mmflags, + makemakerflags => $mmflags, + modulebuildflags => $mbflags, makeflags => $makeflags, format => $format, );
[guest - Thu Oct 14 13:51:31 2004]: Show quoted text
> Secondly, if installation goes into private directory, Build.PL will > not understand MakeMaker set of arguments. Something like > makemakerflags is needed for Module::Build. Little patch attached > to this post trying to solve this. At least look at it.
Hi, I've taken a look at the patch, and the idea is sound ;) we've actually already added this to the development version of CPANPLUS. there's just one small problem: Module::Build's API doesn't, at the time of this writing, accept flags to be passed to it's constructor... As soon as that's implemented, of course this will work. Until then, we do ask for flags during setup and store them in the config, but it won't have any effect until Module::Build's constructor does something with them.