From: Sebastian Riedel Date: Thu, 8 Dec 2005 04:53:19 +0000 (+0000) Subject: Updated PAR support to use "make catalyst_par", packages are no longer written by... X-Git-Tag: 5.7099_04~786 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=20682ed82be3b342c7a64bdbbb4e2752be3d688c Updated PAR support to use "make catalyst_par", packages are no longer written by Makefile.PL --- diff --git a/Changes b/Changes index b7ec4c3..60e4eac 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ This file documents the revision history for Perl extension Catalyst. 5.62 + - Updated PAR support to use "make catalyst_par", + packages are no longer written by Makefile.PL - Automatically determine Content-Length when serving a filehandle. - Exceptions now return status 500 diff --git a/lib/Module/Install/Catalyst.pm b/lib/Module/Install/Catalyst.pm index c3cda12..70c03c8 100644 --- a/lib/Module/Install/Catalyst.pm +++ b/lib/Module/Install/Catalyst.pm @@ -84,7 +84,25 @@ sub catalyst_ignore { =cut # Workaround for a namespace conflict -sub catalyst_par { Catalyst::Module::Install::_catalyst_par(@_) } +sub catalyst_par { + my ( $self, $par ) = @_; + print <name; + my $usage = $USAGE; + $usage =~ s/"/\\"/g; + my $class_string = join "', '", @CLASSES; + $class_string = "'$class_string'" if $class_string; + $self->postamble(< [$class_string], CORE => $CORE, ENGINE => '$ENGINE', MULTIARCH => $MULTIARCH, SCRIPT => '$SCRIPT', USAGE => q#$usage# } )" +EOF + print <{ENGINE}; + my $CLASSES = $opts->{CLASSES} || []; + my $USAGE = $opts->{USAGE}; + my $SCRIPT = $opts->{SCRIPT}; + my $MULTIARCH = $opts->{MULTIARCH}; + my $CORE = $opts->{CORE}; - my $name = $self->name; + my $name = $class_name; $name =~ s/::/_/g; $name = lc $name; $par ||= "$name.par"; - my $engine = $Module::Install::Catalyst::ENGINE || 'CGI'; + my $engine = $ENGINE || 'CGI'; # Check for PAR eval "use PAR ()"; @@ -167,7 +192,7 @@ sub _catalyst_par { die "Please install Module::ScanDeps\n" if $@; my $root = $FindBin::Bin; - my $path = File::Spec->catfile( 'blib', 'lib', split( '::', $self->name ) ); + my $path = File::Spec->catfile( 'blib', 'lib', split( '::', $class_name ) ); $path .= '.pm'; unless ( -f $path ) { print qq/Not writing PAR, "$path" doesn't exist\n/; @@ -180,14 +205,14 @@ sub _catalyst_par { unlink $par_pl; my $version = $Catalyst::VERSION; - my $class = $self->name; + my $class = $class_name; my $classes = ''; - $classes .= " require $_;\n" for @Catalyst::Module::Install::CLASSES; + $classes .= " require $_;\n" for @$CLASSES; unlink $par_pl; - my $usage = $Module::Install::Catalyst::USAGE || <<"EOF"; + my $usage = $USAGE || <<"EOF"; Usage: [parl] $name\[.par] [script] [arguments] @@ -196,7 +221,7 @@ Usage: myapp $name\_cgi.pl EOF - my $script = $Module::Install::Catalyst::SCRIPT; + my $script = $SCRIPT; my $tmp_file = IO::File->new("> $par_pl "); print $tmp_file <<"EOF"; if ( \$ENV{PAR_PROGNAME} ) { @@ -258,8 +283,8 @@ EOF 'o' => $par, 'a' => [ grep( !/par.pl/, glob '.' ) ], 'p' => 1, - 'B' => $Module::Install::Catalyst::CORE, - 'm' => $Module::Install::Catalyst::MULTIARCH + 'B' => $CORE, + 'm' => $MULTIARCH ); App::Packer::PAR->new( frontend => 'Module::ScanDeps',