From: Peter Rabbitson Date: Fri, 4 Mar 2016 18:55:39 +0000 (+0100) Subject: Apparently -i and -jN do not work on win32, what the hell X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1fb834df;p=dbsrgits%2FDBIx-Class-Historic.git Apparently -i and -jN do not work on win32, what the hell These fixes together with RT#112706 make distbuilding on SighOS possible again Also adjust a number of whitespace checks to work properly, ensuring the distdir built on a normal OS and on Win32 match. Read under diff -w -C --- diff --git a/maint/Makefile.PL.inc/51_autohandle_MANIFEST.pl b/maint/Makefile.PL.inc/51_autohandle_MANIFEST.pl index 938cab5..32745cb 100644 --- a/maint/Makefile.PL.inc/51_autohandle_MANIFEST.pl +++ b/maint/Makefile.PL.inc/51_autohandle_MANIFEST.pl @@ -4,6 +4,7 @@ postamble <<"EOM"; fresh_manifest : remove_manifest manifest +@{[ $crlf_fixup->('MANIFEST') ]} remove_manifest : \t\$(RM_F) MANIFEST diff --git a/maint/Makefile.PL.inc/53_autogen_pod.pl b/maint/Makefile.PL.inc/53_autogen_pod.pl index c350734..f595f0d 100644 --- a/maint/Makefile.PL.inc/53_autogen_pod.pl +++ b/maint/Makefile.PL.inc/53_autogen_pod.pl @@ -105,15 +105,18 @@ dbic_distdir_gen_dbic_pod : \tperldoc -u lib/DBIx/Class.pm > $dist_pod_fn \t@{[ $mm_proto->oneliner( - "s!^.*?this line is replaced with the author list.*! qq{List of the awesome contributors who made DBIC v$ver possible\n\n} . qx(\$^X -Ilib maint/gen_pod_authors)!me", - [qw( -0777 -p -i )] + "s!^.*?this line is replaced with the author list.*! qq{List of the awesome contributors who made DBIC v$ver possible\\n\\n} . qx(\$^X -Ilib maint/gen_pod_authors)!me", + [qw( -0777 -p -i.arghwin32 )] ) ]} $dist_pod_fn +\t\$(RM_F) $dist_pod_fn.arghwin32 create_distdir : dbic_distdir_defang_authors # Remove the maintainer-only warning (be nice ;) dbic_distdir_defang_authors : -\t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i )] ) ]} \$(DISTVNAME)/AUTHORS +\t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i.arghwin32 )] ) ]} \$(DISTVNAME)/AUTHORS +@{[ $crlf_fixup->( '$(DISTVNAME)/AUTHORS' ) ]} +\t\$(RM_F) \$(DISTVNAME)/AUTHORS.arghwin32 EOP } diff --git a/maint/Makefile.PL.inc/54_autogen_legalese_and_README.pl b/maint/Makefile.PL.inc/54_autogen_legalese_and_README.pl index 16259af..169fea6 100644 --- a/maint/Makefile.PL.inc/54_autogen_legalese_and_README.pl +++ b/maint/Makefile.PL.inc/54_autogen_legalese_and_README.pl @@ -33,6 +33,7 @@ create_distdir : dbic_distdir_regen_license dbic_distdir_regen_license : @{[ $start_file->( Meta->name . '-' . Meta->version . '/LICENSE' ) ]} \t@{[ $mm_proto->oneliner('cat', ['-MExtUtils::Command']) ]} LICENSE >> \$(DISTVNAME)/LICENSE +@{[ $crlf_fixup->('$(DISTVNAME)/LICENSE') ]} EOP diff --git a/maint/Makefile.PL.inc/11_authortests.pl b/maint/Makefile.PL.inc/92_authortests.pl similarity index 76% rename from maint/Makefile.PL.inc/11_authortests.pl rename to maint/Makefile.PL.inc/92_authortests.pl index 0643ca9..77b52e5 100644 --- a/maint/Makefile.PL.inc/11_authortests.pl +++ b/maint/Makefile.PL.inc/92_authortests.pl @@ -10,6 +10,11 @@ File::Find::find(sub { my @xt_dist_tests = map { "$_/*.t" } sort keys %$xt_dist_dirs; +my $parallel_jobs = ( $^O eq 'MSWin32' ) + ? 1 # FIXME for some reason windows hangs on parallel jobs at `make dist` + : 4 +; + # inject an explicit xt test run, mainly to check the contents of # lib and the generated POD's *before* anything is copied around # @@ -30,7 +35,10 @@ test_xt : pm_to_blib # perl cmd join( ' ', '$(ABSPERLRUN)', - map { $mm_proto->quote_literal($_) } qw(-e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;) + map { $mm_proto->quote_literal($_) } ( + '-e', + "\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;" + ), ), # test list join( ' ', @@ -49,7 +57,11 @@ dbic_distdir_retest_ws_and_footers : # perl cmd join( ' ', '$(ABSPERLRUN)', - map { $mm_proto->quote_literal($_) } qw(-Ilib -e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;) + map { $mm_proto->quote_literal($_) } ( + '-Ilib', + '-e', + "\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;" + ), ), 'xt/dist/postdistdir/*.t', ) diff --git a/xt/dist/postdistdir/whitespace.t b/xt/dist/postdistdir/whitespace.t index 9b2ba87..6601de2 100644 --- a/xt/dist/postdistdir/whitespace.t +++ b/xt/dist/postdistdir/whitespace.t @@ -27,8 +27,9 @@ Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, @pl_targets); Test::NoTabs::all_perl_files_ok(@pl_targets); # check some non-"perl files" in the root separately -# use .gitignore as a guide of what to skip -# (or do not test at all if no .gitignore is found) +my @root_files = grep { -f $_ } bsd_glob('*'); + +# use .gitignore as a partial guide of what to skip if (open(my $gi, '<', '.gitignore')) { my $skipnames; while (my $ln = <$gi>) { @@ -37,15 +38,23 @@ if (open(my $gi, '<', '.gitignore')) { $skipnames->{$_}++ for bsd_glob($ln); } - # that we want to check anyway - delete $skipnames->{'META.yml'}; + # these we want to check no matter what the above says + delete $skipnames->{qw( + Changes + LICENSE + AUTHORS + README + MANIFEST + META.yml + META.json + )}; + + @root_files = grep { ! $skipnames->{$_} } @root_files; +} - for my $fn (bsd_glob('*')) { - next if $skipnames->{$fn}; - next unless -f $fn; - Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 }); - Test::NoTabs::notabs_ok($fn); - } +for my $fn (@root_files) { + Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 }); + Test::NoTabs::notabs_ok($fn) unless $fn eq 'MANIFEST'; # it is always tab infested } # FIXME - Test::NoTabs and Test::EOL declare 'no_plan' which conflicts with done_testing