requires 'Carp';
requires 'Data::OptList';
requires 'Devel::GlobalDestruction';
+requires 'Dist::CheckConflicts';
requires 'Eval::Closure';
requires 'List::MoreUtils' => '0.12';
requires 'MRO::Compat' => '0.05';
author_requires 'Test::Output';
author_requires 'Test::Spelling';
+configure_requires 'Dist::CheckConflicts';
+configure_requires 'Package::Stash::Conflicts';
+
repository 'git://git.moose.perl.org/Class-MOP.git';
add_metadata(x_authority => 'cpan:STEVAN');
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.14',
- 'namespace::autoclean' => '0.08',
- );
-
- 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/Class/MOP/Conflicts.pm'; 1; }) {
+ if (eval { Class::MOP::Conflicts->check_conflicts; 1 }) {
+ return;
+ }
+ else {
+ my $err = $@;
+ $err =~ s/^/ /mg;
+ warn "***\n$err***\n";
+ }
+ }
+ else {
+ 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.
+ Your toolchain doesn't support configure_requires, so Dist::CheckConflicts
+ hasn't been installed yet. You should check for conflicting modules
+ manually using the 'cmop-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 unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
+ return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
sleep 4;
}
--- /dev/null
+package # hide from PAUSE
+ Class::MOP::Conflicts;
+use strict;
+use warnings;
+
+# Use the xt/author/test-my-dependents.t test in the Moose test suite to figure
+# out what on CPAN will break with the latest Moose, then update this before a
+# release.
+
+use Dist::CheckConflicts
+ -dist => 'Class-MOP',
+ -conflicts => {
+ 'Moose' => '1.14',
+ 'namespace::autoclean' => '0.08',
+ },
+ -also => [
+ 'Package::Stash::Conflicts',
+ ];
+
+1;