X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FModule%2FInstall%2FCatalyst.pm;h=5230d6f2d5d1563eb658fb44c6cba0d3179ad8be;hb=e0fd6615d3ad1481bcfe788a6b780ab7c4d9f50d;hp=5dec242e3b66ac5a88acb71600f75fbdad8ad755;hpb=4578b8aeaf36024567f5c6b16520d178e28764af;p=catagits%2FCatalyst-Devel.git diff --git a/lib/Module/Install/Catalyst.pm b/lib/Module/Install/Catalyst.pm index 5dec242..5230d6f 100644 --- a/lib/Module/Install/Catalyst.pm +++ b/lib/Module/Install/Catalyst.pm @@ -8,9 +8,9 @@ require Module::Install::Base; use File::Find; use FindBin; -use File::Copy::Recursive 'rcopy'; +use File::Copy::Recursive; use File::Spec (); -use Getopt::Long qw(GetOptionsFromString :config no_ignore_case); +use Getopt::Long (); use Data::Dumper; my $SAFETY = 0; @@ -28,16 +28,16 @@ our %PAROPTS = (); =head1 NAME Module::Install::Catalyst - Module::Install extension for Catalyst - + =head1 SYNOPSIS - + use inc::Module::Install; - + name 'MyApp'; all_from 'lib/MyApp.pm'; - + requires 'Catalyst::Runtime' => '5.7014'; - + catalyst_ignore('.*temp'); catalyst_ignore('.*tmp'); catalyst; @@ -58,6 +58,11 @@ command called in C. sub catalyst { my $self = shift; + + if($Module::Install::AUTHOR) { + $self->include("File::Copy::Recursive"); + } + print < and L). =cut @@ -94,7 +99,7 @@ sub catalyst_files { my @path = split '-', $self->name; for my $orig (@files) { my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig ); - rcopy( $orig, $path ); + File::Copy::Recursive::rcopy( $orig, $path ); } } @@ -193,7 +198,7 @@ as arguments of B command from L package. Example: # part of your Makefile.PL - + catalyst_par_options("--verbose=2 -f Bleach -z 9"); # verbose mode; use filter 'Bleach'; zip with compression level 9 catalyst; @@ -201,12 +206,12 @@ Example: Note1: There is no reason to use catalyst_par_options() command multiple times as you can spacify in "$optstring" as many options as you want. Still, it is supported to call catalyst_par_options() more than once. In that case the -specified options are merged (collisions are handled on principle "later wins"). +specified options are merged (collisions are handled on principle "later wins"). BEWARE: you are discouraged from using parameters -a -A -X -f -F -I -l -M in -multiple catalyst_par_options() as they are not merged but replaced as you would +multiple catalyst_par_options() as they are not merged but replaced as you would expected. -Note2: By default the options "-x -p -o=.par" are set and option "-n" +Note2: By default the options "-x -p -o=.par" are set and option "-n" is unset. This default always overrides whatever you specify by catalyst_par_options(). @@ -214,15 +219,20 @@ catalyst_par_options(). sub catalyst_par_options { my ( $self, $optstring ) = @_; - my %o = (); eval "use PAR::Packer ()"; if ($@) { warn "WARNING: catalyst_par_options ignored - you need PAR::Packer\n" } else { - GetOptionsFromString($optstring, \%o, PAR::Packer->options); + my $p = Getopt::Long::Parser->new(config => ['no_ignore_case']); + my %o; + require Text::ParseWords; + { + local @ARGV = Text::ParseWords::shellwords($optstring); + $p->getoptions(\%o, PAR::Packer->options); + } %PAROPTS = ( %PAROPTS, %o); - } + } } =head2 catalyst_par_script($script) @@ -371,7 +381,7 @@ EOF 'p' => 1, ); # do not replace the whole $opt{'a'} array; just push required default value - push @{$opt{'a'}}, grep( !/par.pl/, glob '.' ); + push @{$opt{'a'}}, grep( !/par.pl/, glob '.' ); App::Packer::PAR->new( frontend => 'Module::ScanDeps',