Skip to content

Commit ab5e7f5

Browse files
committed
Breakup MakeMaker->new: check_PREREQ_FATAL method
1 parent 7f5a22e commit ab5e7f5

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

lib/ExtUtils/MakeMaker.pm

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -455,17 +455,7 @@ sub new {
455455

456456
$self->extract_ARGV(\@ARGV);
457457

458-
# RT#91540 PREREQ_FATAL not recognized on command line
459-
if (%$unsatisfied_prereqs && $self->{PREREQ_FATAL}){
460-
my $failedprereqs = join "\n", map {" $_ $unsatisfied_prereqs->{$_}"}
461-
sort { $a cmp $b } keys %$unsatisfied_prereqs;
462-
die <<"END";
463-
MakeMaker FATAL: prerequisites not found.
464-
$failedprereqs
465-
466-
Please install these modules first and rerun 'perl Makefile.PL'.
467-
END
468-
}
458+
$self->check_PREREQ_FATAL($unsatisfied_prereqs); # after ARGV processed
469459

470460
$self->{NAME} ||= $self->guess_name;
471461
warn "Warning: NAME must be a package name\n"
@@ -485,6 +475,21 @@ END
485475
$self;
486476
}
487477

478+
sub check_PREREQ_FATAL {
479+
my ($self, $unsatisfied_prereqs) = @_;
480+
# RT#91540 PREREQ_FATAL not recognized on command line
481+
if (%$unsatisfied_prereqs && $self->{PREREQ_FATAL}){
482+
my $failedprereqs = join "\n", map {" $_ $unsatisfied_prereqs->{$_}"}
483+
sort { $a cmp $b } keys %$unsatisfied_prereqs;
484+
die <<"END";
485+
MakeMaker FATAL: prerequisites not found.
486+
$failedprereqs
487+
488+
Please install these modules first and rerun 'perl Makefile.PL'.
489+
END
490+
}
491+
}
492+
488493
sub extract_CONFIGURE {
489494
my ($self) = @_;
490495
my %initial_att = %$self; # record initial attributes

0 commit comments

Comments
 (0)