From: Dave Rolsky Date: Fri, 29 May 2009 22:28:39 +0000 (+0000) Subject: We need to capture @ARGV in the restarter, for the benefit of Win32 X-Git-Tag: 1.18~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ad5350a3aec742ee638fabbc4a8e9fa2c806311;p=catagits%2FCatalyst-Devel.git We need to capture @ARGV in the restarter, for the benefit of Win32 only, so that it can re-execute itself with the right options. Getopt::Long eats @ARGV before we have a chance to get to it. --- diff --git a/Changes b/Changes index 9001f97..b8d1394 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ This file documents the revision history for Perl extension Catalyst-Devel. +1.18 + - More fixes for the Win32 restarter. It was effectively + ignoring all command-line options except those related to + the restarter itself. + + 1.17 2009-05-24 18:18:17 - Catalyst::Restarter::Forking loaded the threads and Thread::Cancel modules, even though it doesn't need them. diff --git a/lib/Catalyst/Devel.pm b/lib/Catalyst/Devel.pm index 75680f2..2d05f92 100644 --- a/lib/Catalyst/Devel.pm +++ b/lib/Catalyst/Devel.pm @@ -4,7 +4,7 @@ use strict; use warnings; our $VERSION = '1.17'; -our $CATALYST_SCRIPT_GEN = 38; +our $CATALYST_SCRIPT_GEN = 39; $VERSION = eval $VERSION; diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index c10b438..1798995 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -1051,6 +1051,7 @@ if ( $restart ) { my $restarter = $subclass->new( %args, start_sub => $runner, + argv => \@argv, ); $restarter->run_and_watch; diff --git a/lib/Catalyst/Restarter.pm b/lib/Catalyst/Restarter.pm index d95a944..7a7c6ff 100644 --- a/lib/Catalyst/Restarter.pm +++ b/lib/Catalyst/Restarter.pm @@ -13,6 +13,12 @@ has start_sub => ( required => 1, ); +has argv => ( + is => 'ro', + isa => 'ArrayRef', + required => 1, +); + has _watcher => ( is => 'rw', isa => 'File::ChangeNotify::Watcher', diff --git a/lib/Catalyst/Restarter/Win32.pm b/lib/Catalyst/Restarter/Win32.pm index ef39ee4..65a8e3e 100644 --- a/lib/Catalyst/Restarter/Win32.pm +++ b/lib/Catalyst/Restarter/Win32.pm @@ -16,7 +16,7 @@ sub _fork_and_start { # This is totally hack-tastic, and is probably much slower, but it # does seem to work. - my @command = ( $^X, $0, grep { ! /^\-r/ } @ARGV ); + my @command = ( $^X, $0, grep { ! /^\-r/ } @{ $self->argv } ); my $child = Proc::Background->new(@command);