Only normalize conditions during resolution time, instead on every ->search
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 91_inc_sanity_check.pl
1 my @files_to_check = qw(AutoInstall.pm Can.pm WriteAll.pm Win32.pm);
2
3 END {
4   # shit already hit the fan
5   return if $?;
6
7   for my $f (@files_to_check) {
8     if (! -f "inc/Module/Install/$f") {
9       warn "Your inc/ does not contain a critical Module::Install component - \$_. Something went horrifically wrong... please ask the cabal for help\n";
10       unlink 'Makefile';
11       exit 1;
12     }
13   }
14 }
15
16 my $oneliner = <<"EOO";
17 -f qq(\$(DISTVNAME)/inc/Module/Install/\$_) or die "\\nYour \$(DISTVNAME)/inc/ does not contain a critical Module::Install component: \$_. Something went horrifically wrong... please ask the cabal for help\\n\\n" for (qw(@files_to_check))
18 EOO
19
20 postamble <<"EOP";
21 create_distdir : sanity_check_inc
22
23 sanity_check_inc :
24 \t\$(NOECHO) @{[ $mm_proto->oneliner($oneliner) ]}
25
26 EOP
27
28 # keep the Makefile.PL eval happy
29 1;