From: Dave Rolsky Date: Sun, 22 Aug 2010 16:31:57 +0000 (-0500) Subject: Use check_conflicts from Module::Install X-Git-Tag: 1.06~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f3e009e602ec89c1f724e3fabef114ddf68e6d3;p=gitmo%2FClass-MOP.git Use check_conflicts from Module::Install --- diff --git a/Makefile.PL b/Makefile.PL index e8e28da..c0af551 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,6 +10,12 @@ perl_version '5.008001'; all_from 'lib/Class/MOP.pm'; license 'perl'; +my %conflicts = ( + 'Moose' => '1.04', +); + +check_conflicts(%conflicts); + require Config; my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; @@ -71,47 +77,6 @@ EOM WriteAll(); -# Use the cpan-smolder-stable script in the Moose svn root to figure -# out what on CPAN will break with the latest Moose, then update this -# before a release. -sub check_conflicts { - my %conflicts = ( - 'Moose' => '1.04', - ); - - my $found = 0; - for my $mod ( sort keys %conflicts ) { - eval "require $mod"; - next if $@; - - my $installed = $mod->VERSION(); - if ( $installed le $conflicts{$mod} ) { - - print <<"EOF"; - -*** - This version of Class::MOP conflicts with the version of - $mod ($installed) you have installed. - - You will need to upgrade $mod after installing - this version of Class::MOP. -*** - -EOF - - $found = 1; - } - } - - return unless $found; - - # More or less copied from Module::Build - return if $ENV{PERL_MM_USE_DEFAULT}; - return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); - - sleep 4; -} - package MY; use Config;