1 package inc::MMPackageStash;
4 extends 'Dist::Zilla::Plugin::MakeMaker::Awesome';
6 # XXX: this is pretty gross, it should be possible to clean this up later
7 around _build_MakeFile_PL_template => sub {
10 my $template = $self->$orig(@_);
12 $template =~ s/(use ExtUtils::MakeMaker.*)/$1\n\ncheck_conflicts();/;
14 $template .= <<'CHECK_CONFLICTS';
17 'Class::MOP' => '1.09',
20 for my $mod ( sort keys %conflicts ) {
24 my $installed = $mod->VERSION();
25 if ( $installed le $conflicts{$mod} ) {
30 This version of Package::Stash conflicts with the version of
31 $mod ($installed) you have installed.
33 You will need to upgrade $mod after installing
34 this version of Package::Stash.
45 # More or less copied from Module::Build
46 return if $ENV{PERL_MM_USE_DEFAULT};
47 return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
56 __PACKAGE__->meta->make_immutable;