Skip to content

Commit 1fb834d

Browse files
committed
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
1 parent 26710bc commit 1fb834d

File tree

5 files changed

+41
-15
lines changed

5 files changed

+41
-15
lines changed

maint/Makefile.PL.inc/51_autohandle_MANIFEST.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
postamble <<"EOM";
55
66
fresh_manifest : remove_manifest manifest
7+
@{[ $crlf_fixup->('MANIFEST') ]}
78
89
remove_manifest :
910
\t\$(RM_F) MANIFEST

maint/Makefile.PL.inc/53_autogen_pod.pl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,18 @@
105105
106106
\tperldoc -u lib/DBIx/Class.pm > $dist_pod_fn
107107
\t@{[ $mm_proto->oneliner(
108-
"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",
109-
[qw( -0777 -p -i )]
108+
"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",
109+
[qw( -0777 -p -i.arghwin32 )]
110110
) ]} $dist_pod_fn
111+
\t\$(RM_F) $dist_pod_fn.arghwin32
111112
112113
create_distdir : dbic_distdir_defang_authors
113114
114115
# Remove the maintainer-only warning (be nice ;)
115116
dbic_distdir_defang_authors :
116-
\t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i )] ) ]} \$(DISTVNAME)/AUTHORS
117+
\t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i.arghwin32 )] ) ]} \$(DISTVNAME)/AUTHORS
118+
@{[ $crlf_fixup->( '$(DISTVNAME)/AUTHORS' ) ]}
119+
\t\$(RM_F) \$(DISTVNAME)/AUTHORS.arghwin32
117120
118121
EOP
119122
}

maint/Makefile.PL.inc/54_autogen_legalese_and_README.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
dbic_distdir_regen_license :
3434
@{[ $start_file->( Meta->name . '-' . Meta->version . '/LICENSE' ) ]}
3535
\t@{[ $mm_proto->oneliner('cat', ['-MExtUtils::Command']) ]} LICENSE >> \$(DISTVNAME)/LICENSE
36+
@{[ $crlf_fixup->('$(DISTVNAME)/LICENSE') ]}
3637
3738
EOP
3839

maint/Makefile.PL.inc/11_authortests.pl renamed to maint/Makefile.PL.inc/92_authortests.pl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
my @xt_dist_tests = map { "$_/*.t" } sort keys %$xt_dist_dirs;
1212

13+
my $parallel_jobs = ( $^O eq 'MSWin32' )
14+
? 1 # FIXME for some reason windows hangs on parallel jobs at `make dist`
15+
: 4
16+
;
17+
1318
# inject an explicit xt test run, mainly to check the contents of
1419
# lib and the generated POD's *before* anything is copied around
1520
#
@@ -30,7 +35,10 @@
3035
# perl cmd
3136
join( ' ',
3237
'$(ABSPERLRUN)',
33-
map { $mm_proto->quote_literal($_) } qw(-e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;)
38+
map { $mm_proto->quote_literal($_) } (
39+
'-e',
40+
"\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;"
41+
),
3442
),
3543
# test list
3644
join( ' ',
@@ -49,7 +57,11 @@
4957
# perl cmd
5058
join( ' ',
5159
'$(ABSPERLRUN)',
52-
map { $mm_proto->quote_literal($_) } qw(-Ilib -e $ENV{RELEASE_TESTING}=1;$ENV{HARNESS_OPTIONS}=j4;)
60+
map { $mm_proto->quote_literal($_) } (
61+
'-Ilib',
62+
'-e',
63+
"\$ENV{RELEASE_TESTING}=1;\$ENV{HARNESS_OPTIONS}=j$parallel_jobs;"
64+
),
5365
),
5466
'xt/dist/postdistdir/*.t',
5567
)

xt/dist/postdistdir/whitespace.t

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, @pl_targets);
2727
Test::NoTabs::all_perl_files_ok(@pl_targets);
2828

2929
# check some non-"perl files" in the root separately
30-
# use .gitignore as a guide of what to skip
31-
# (or do not test at all if no .gitignore is found)
30+
my @root_files = grep { -f $_ } bsd_glob('*');
31+
32+
# use .gitignore as a partial guide of what to skip
3233
if (open(my $gi, '<', '.gitignore')) {
3334
my $skipnames;
3435
while (my $ln = <$gi>) {
@@ -37,15 +38,23 @@ if (open(my $gi, '<', '.gitignore')) {
3738
$skipnames->{$_}++ for bsd_glob($ln);
3839
}
3940

40-
# that we want to check anyway
41-
delete $skipnames->{'META.yml'};
41+
# these we want to check no matter what the above says
42+
delete $skipnames->{qw(
43+
Changes
44+
LICENSE
45+
AUTHORS
46+
README
47+
MANIFEST
48+
META.yml
49+
META.json
50+
)};
51+
52+
@root_files = grep { ! $skipnames->{$_} } @root_files;
53+
}
4254

43-
for my $fn (bsd_glob('*')) {
44-
next if $skipnames->{$fn};
45-
next unless -f $fn;
46-
Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 });
47-
Test::NoTabs::notabs_ok($fn);
48-
}
55+
for my $fn (@root_files) {
56+
Test::EOL::eol_unix_ok($fn, { trailing_whitespace => 1 });
57+
Test::NoTabs::notabs_ok($fn) unless $fn eq 'MANIFEST'; # it is always tab infested
4958
}
5059

5160
# FIXME - Test::NoTabs and Test::EOL declare 'no_plan' which conflicts with done_testing

0 commit comments

Comments
 (0)