From: Dagfinn Ilmari Mannsåker Date: Wed, 28 Sep 2016 11:39:12 +0000 (+0100) Subject: Fix building on perls with no . in @INC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8aae794001ecccdb26c2bbd1b92c97bba9e65d79;p=dbsrgits%2FDBIx-Class.git Fix building on perls with no . in @INC Perl 5.26 will be able to be built with no . in @INC, and Debian are already building their 5.24 without it. To cope with this, do -It/lib -MFoo instead of -Mt::lib::Foo. --- diff --git a/maint/Makefile.PL.inc/56_autogen_schema_files.pl b/maint/Makefile.PL.inc/56_autogen_schema_files.pl index 2e1efb9..bbc9912 100644 --- a/maint/Makefile.PL.inc/56_autogen_schema_files.pl +++ b/maint/Makefile.PL.inc/56_autogen_schema_files.pl @@ -1,5 +1,5 @@ my $test_ddl_fn = 't/lib/sqlite.sql'; -my @test_ddl_cmd = qw( -I lib -Mt::lib::ANFANG -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema ); +my @test_ddl_cmd = qw( -I lib -I t/lib -MANFANG -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema ); my $example_ddl_fn = 'examples/Schema/db/example.sql'; my $example_db_fn = 'examples/Schema/db/example.db'; diff --git a/t/lib/ANFANG.pm b/t/lib/ANFANG.pm index e5e6035..c429d74 100644 --- a/t/lib/ANFANG.pm +++ b/t/lib/ANFANG.pm @@ -16,7 +16,7 @@ our $anfang_loaded; # this allows the obscure but possible call case to behave correctly: # -# perl -Mt::lib::ANFANG -e 'do "./t/lib/ANFANG.pm" or die ( $@ || $! )' +# perl -It/lib -MANFANG -e 'do "./t/lib/ANFANG.pm" or die ( $@ || $! )' # return 1 if $anfang_loaded; diff --git a/t/lib/DBICTest/Util.pm b/t/lib/DBICTest/Util.pm index 7aeb805..e268b3b 100644 --- a/t/lib/DBICTest/Util.pm +++ b/t/lib/DBICTest/Util.pm @@ -376,7 +376,7 @@ sub can_alloc_MB ($) { local ( $!, $^E, $?, $@ ); - system( $perl, qw( -Mt::lib::ANFANG -e ), <<'EOS', $arg ); + system( $perl, qw( -It/lib -MANFANG -e ), <<'EOS', $arg ); $0 = 'malloc_canary'; my $tail_character_of_reified_megastring = substr( ( join '', map chr, 0..255 ) x (4 * 1024 * $ARGV[0]), -1 ); EOS diff --git a/xt/extra/taint.t b/xt/extra/taint.t index e8c6af1..93190c3 100644 --- a/xt/extra/taint.t +++ b/xt/extra/taint.t @@ -20,7 +20,7 @@ use warnings; # there is talk of possible perl compilations where -T is fatal or just # doesn't work. We don't want to have the user deal with that. -BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) { +BEGIN { unless ($INC{'DBICTest/WithTaint.pm'}) { if ( $^O eq 'MSWin32' and $^X =~ /\x20/ ) { print "1..0 # SKIP Running this test on Windows with spaces within the perl executable path (\$^X) is not possible due to https://rt.perl.org/Ticket/Display.html?id=123907\n"; @@ -56,7 +56,7 @@ BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) { exit 0; } - exec( $perl, qw( -I. -Mt::lib::DBICTest::WithTaint -T ), __FILE__ ); + exec( $perl, qw( -It/lib -MDBICTest::WithTaint -T ), __FILE__ ); }} # We need to specify 'lib' here as well because even if it was already in