X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=maint%2FMakefile.PL.inc%2F12_authordeps.pl;h=e6d7f343224651a1ee604e9265fc59d78b0c0cc1;hb=7b87b77c04e07cfea1103dba8ecbd3f219e949d2;hp=1083b7eaee6b7be3dfc69f99148168cbf8fed70f;hpb=65a231a8160a23779d1683dc76d4a453aa19af1c;p=dbsrgits%2FDBIx-Class.git diff --git a/maint/Makefile.PL.inc/12_authordeps.pl b/maint/Makefile.PL.inc/12_authordeps.pl index 1083b7e..e6d7f34 100644 --- a/maint/Makefile.PL.inc/12_authordeps.pl +++ b/maint/Makefile.PL.inc/12_authordeps.pl @@ -1,6 +1,6 @@ my ($optdep_msg, $opt_testdeps); -if ($args->{skip_author_deps}) { +unless ($args->{with_optdeps}) { $optdep_msg = <<'EOW'; ****************************************************************************** @@ -9,8 +9,12 @@ if ($args->{skip_author_deps}) { *** IGNORING AUTHOR MODE: no optional test dependencies will be forced. *** *** *** *** If you are using this checkout with the intention of submitting a DBIC *** -*** patch, you are *STRONGLY ENCOURAGED* to install all dependencies, so *** -*** that every possible unit-test will run. *** +*** patch you may want to aim at running more tests by re-configuring via: *** +*** *** +*** perl Makefile.PL --with-optdeps *** +*** *** +*** which will install all optional dependencies. This is not a mandatory *** +*** step - the extensive CI setup will likely catch your mistakes anyway. *** *** *** ****************************************************************************** ****************************************************************************** @@ -23,8 +27,8 @@ else { ****************************************************************************** ****************************************************************************** *** *** -*** AUTHOR MODE: all optional test dependencies converted to hard requires *** -*** ( to disable re-run Makefile.PL with --skip_author_deps ) *** +*** --with-optdeps specified: converting all optional test dependencies to *** +*** hard requires ( to disable re-run Makefile.PL without options ) *** *** *** ****************************************************************************** ****************************************************************************** @@ -32,12 +36,19 @@ else { EOW require DBIx::Class::Optional::Dependencies; - my %reqs_for_group = %{DBIx::Class::Optional::Dependencies->req_group_list}; # exclude the rdbms_* groups which are for DBIC users - $opt_testdeps = { - map { %{$reqs_for_group{$_}} } grep { !/^rdbms_/ } keys %reqs_for_group - }; + # and the moose-related stuff iff we are under 5.8.3 + $opt_testdeps = DBIx::Class::Optional::Dependencies->req_list_for([ + grep { + !/^rdbms_|^dist_/ + and + ( "$]" > 5.008002 or !/^ (?: test_ )? (?: admin | admin_script | replicated ) $/x ) + } keys %{DBIx::Class::Optional::Dependencies->req_group_list} + ]); + + # this one is "special" - we need it both in optdeps and as a hard dep + delete $opt_testdeps->{'DBD::SQLite'}; print "Including all optional deps\n"; $reqs->{test_requires} = { @@ -66,6 +77,9 @@ EOW # this will run after the Makefile is written and the main Makefile.PL terminates # END { + # shit already hit the fan + return if $?; + # Re-write META.yml at the end to _exclude_ all forced build-requires (we do not # want to ship this) We are also not using M::I::AuthorRequires as this will be # an extra dep, and deps in Makefile.PL still suck @@ -88,9 +102,18 @@ END { if (keys %removed_build_requires) { print "Regenerating META with author requires excluded\n"; + # M::I understands unicode in meta but does not write with the right + # layers - fhtagn!!! + local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /Wide character in print/ }; Meta->write; } + # strip possible crlf from META + if ($^O eq 'MSWin32' or $^O eq 'cygwin') { + local $ENV{PERLIO} = 'unix'; + system( $^X, qw( -MExtUtils::Command -e dos2unix -- META.yml), ); + } + # test that we really took things away (just in case, happened twice somehow) if (! -f 'META.yml') { warn "No META.yml generated?! aborting...\n"; @@ -99,6 +122,12 @@ END { } my $meta = do { local @ARGV = 'META.yml'; local $/; <> }; + $meta =~ /^\Qname: DBIx-Class\E$/m or do { + warn "Seemingly malformed META.yml...?\n"; + unlink 'Makefile'; + exit 1; + }; + # this is safe as there is a fatal check earlier in the main Makefile.PL # to make sure there are no duplicates (i.e. $opt_testdeps does not contain # any real dependencies)