From 67caa3cab560fb58ef93e71c7562d89afd3b03f2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Nov 2010 21:34:33 -0600 Subject: use dist-checkconflicts --- inc/MMPackageStash.pm | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'inc') diff --git a/inc/MMPackageStash.pm b/inc/MMPackageStash.pm index b29aa5e..f90eb99 100644 --- a/inc/MMPackageStash.pm +++ b/inc/MMPackageStash.pm @@ -45,39 +45,29 @@ CAN_CC # copied out of moose my $check_conflicts = <<'CHECK_CONFLICTS'; sub check_conflicts { - my %conflicts = ( - 'Class::MOP' => '1.08', - 'MooseX::Role::WithOverloading' => '0.08', - 'namespace::clean' => '0.18', - ); - 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"; - + if (eval { require 'lib/Package/Stash/Conflicts.pm'; 1; }) { + if (eval { Package::Stash::Conflicts->check_conflicts; 1 }) { + return; + } + else { + my $err = $@; + $err =~ s/^/ /mg; + warn "***\n$err***\n"; + } + } + else { + print <<'EOF'; *** - This version of Package::Stash conflicts with the version of - $mod ($installed) you have installed. - - You will need to upgrade $mod after installing - this version of Package::Stash. + Your toolchain doesn't support configure_requires, so Dist::CheckConflicts + hasn't been installed yet. You should check for conflicting modules + manually using the 'package-stash-conflicts' script that is installed with + this distribution once the installation finishes. *** - EOF - - $found = 1; - } } - return unless $found; - # More or less copied from Module::Build - return if $ENV{PERL_MM_USE_DEFAULT}; + return if $ENV{PERL_MM_USE_DEFAULT}; return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); sleep 4; -- cgit v1.2.3-54-g00ecf