From: Peter Rabbitson Date: Sun, 17 Jul 2011 17:43:06 +0000 (-0400) Subject: Reshuffle Makefile.PL a bit and add parallel-testing exception X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb7950c01d6b21cf8fe6257e57695f4e6dc74077;p=dbsrgits%2FDBIx-Class-Historic.git Reshuffle Makefile.PL a bit and add parallel-testing exception --- diff --git a/Makefile.PL b/Makefile.PL index 8898285..7fd81e6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -8,23 +8,6 @@ use FindBin; use lib "$FindBin::Bin/lib"; use DBIx::Class::Optional::Dependencies; -# adjust ENV for $AUTHOR system() calls -use Config; -$ENV{PERL5LIB} = join ($Config{path_sep}, @INC); - -use Getopt::Long (); - -my $getopt = Getopt::Long::Parser->new( - config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] -); -my $args = { - skip_author_deps => undef, -}; -$getopt->getoptions($args, 'skip_author_deps'); -if (@ARGV) { - warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; -} - # get cpanX --installdeps . to behave in a checkout (most users do not need # the deps for a full test suite run, and if they do - there's MI::AutoInstall # for that) @@ -86,6 +69,40 @@ my $runtime_requires = { 'File::Path' => '2.07', }; + +# Bail out on parallel testing +if ( + ($ENV{HARNESS_OPTIONS}||'') =~ / (?: ^ | \: ) j(\d+) /x + and + $1 > 1 +) { die <new( + config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] +); +my $args = { + skip_author_deps => undef, +}; +$getopt->getoptions($args, 'skip_author_deps'); +if (@ARGV) { + warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; +} + # this is so we can order requires alphabetically # copies are needed for author requires injection my $reqs = { @@ -172,6 +189,10 @@ warn $optdep_msg if $Module::Install::AUTHOR; # re-create various autogenerated documentation bits if ($Module::Install::AUTHOR) { + # adjust ENV for $AUTHOR system() calls + require Config; + $ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC); + print "Regenerating README\n"; system('pod2text lib/DBIx/Class.pm > README');