From: Dave Rolsky Date: Mon, 23 Aug 2010 13:34:04 +0000 (-0500) Subject: Revert "Use check_conflicts from Module::Install" X-Git-Tag: 1.06~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b97025480e918c47efe49570ad4878c0ead9d11;p=gitmo%2FClass-MOP.git Revert "Use check_conflicts from Module::Install" This reverts commit 3f3e009e602ec89c1f724e3fabef114ddf68e6d3. Using this seems to break make disttest and I don't have time to figure this out. --- diff --git a/Makefile.PL b/Makefile.PL index 41aaab6..13b1775 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -8,12 +8,6 @@ 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.'; @@ -75,6 +69,47 @@ 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;