Add "Unknown error" check
[catagits/Catalyst-Devel.git] / Makefile.PL
CommitLineData
54616d61 1use inc::Module::Install 0.64;
2
3name 'Catalyst-Devel';
c93c671b 4all_from 'lib/Catalyst/Devel.pm';
68ccb5e5 5
2658a4db 6requires 'Catalyst' => '5.7000';
7requires 'Catalyst::Action::RenderView' => '0.04';
2eea177a 8requires 'Catalyst::Plugin::Static::Simple' => '0.16';
e2a962e1 9requires 'Catalyst::Plugin::ConfigLoader';
3d63fa09 10requires 'Class::Accessor::Fast';
11requires 'Config::General'; # as of 1.07, we use .conf and not .yaml
fde6650e 12requires 'File::Copy::Recursive';
3d63fa09 13requires 'Module::Install' => '0.64';
14requires 'parent'; # as of 1.04
15requires 'Path::Class' => '0.09';
16requires 'Template' => '2.14';
54616d61 17
1cbc4fbe 18if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
19 use Symbol 'gensym';
20 use IPC::Open3;
21 use File::Spec;
22 open NULL, '>', File::Spec->devnull;
23 my $err = gensym;
24 my $pid = open3(gensym, '&>NULL', $err, "$^X -It/lib -MUnknownError -e 1");
25
26 my $unknown_error = 0;
27
28 while (<$err>) {
29 $unknown_error = 1 if /^Unknown error/;
30 }
31
32 waitpid $pid, 0;
33
34 if ($unknown_error) {
35 warn <<EOE;
36############################### WARNING #################################
37# #
38# You are using perl 5.10.0 with the "Unknown error" bug. This can make #
39# developing Catalyst applications much more painful, as it will come #
40# up with no details every time you have a syntax error in a Controller.#
41# #
42# For more information see: #
43# #
44# * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472 #
45# #
46# It is highly recommended that you patch your perl, or use a different #
47# version for Catalyst development. #
48# #
49# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment #
50# variable. #
51# #
52#########################################################################
53
54EOE
55 my $ans = prompt('Do you want to continue?', 'no');
56 exit 0 unless $ans =~ /^y(es)?\z/i;
57 }
58}
59
5539814d 60auto_install;
61
54616d61 62WriteAll;