X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=maint%2FMakefile.PL.inc%2F56_autogen_testddl.pl;h=21903bf5b5ecb5e7ff93d355fc78d28c5d292510;hp=c3837082c36f98f3cfeaaca558c9295966e6f901;hb=4a51243f734714ee80370ede83b4a67e7fa005b7;hpb=3054407e98a76e2e8bc2c132c15c776b7f640435 diff --git a/maint/Makefile.PL.inc/56_autogen_testddl.pl b/maint/Makefile.PL.inc/56_autogen_testddl.pl index c383708..21903bf 100644 --- a/maint/Makefile.PL.inc/56_autogen_testddl.pl +++ b/maint/Makefile.PL.inc/56_autogen_testddl.pl @@ -6,10 +6,14 @@ my $ddl_fn = File::Spec->catfile(qw(t lib sqlite.sql)); # on error # The EUMM build-stage generation will run unconditionally and # errors will not be trapped -if (my $out = ` "$^X" -Ilib maint/gen_schema `) { - open (my $fh, '>:unix', $ddl_fn) or die "Unable to open $ddl_fn: $!"; - print $fh $out; - close $fh; +require DBIx::Class::Optional::Dependencies; +if ( DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) { + print "Regenerating t/lib/sqlite.sql\n"; + if (my $out = ` "$^X" -Ilib maint/gen_schema `) { + open (my $fh, '>:unix', $ddl_fn) or die "Unable to open $ddl_fn: $!"; + print $fh $out; + close $fh; + } } postamble <<"EOP"; @@ -21,7 +25,5 @@ dbic_clonedir_regen_test_ddl : @{[ $crlf_fixup->($ddl_fn) ]} EOP - - # keep the Makefile.PL eval happy 1;