Do not fall back to searching the mirror when a mirror-index has been specified #150

Closed
wants to merge 1 commit into
from
View
@@ -665,7 +665,11 @@ $fatpacked{"App/cpanminus/script.pm"} = <<'APP_CPANMINUS_SCRIPT';
if ($self->{mirror_index}) {
$self->chat("Searching $module on mirror index $self->{mirror_index} ...\n");
my $pkg = $self->search_mirror_index_file($self->{mirror_index}, $module, $version);
- return $pkg if $pkg;
+ if (not $pkg) {
+ $self->diag_fail("Finding $module ($version) on mirror index $self->{mirror_index} failed.");
+ return;
+ }
+ return $pkg;
}
MIRROR: for my $mirror (@{ $self->{mirrors} }) {
@@ -353,7 +353,11 @@ sub search_module {
if ($self->{mirror_index}) {
$self->chat("Searching $module on mirror index $self->{mirror_index} ...\n");
my $pkg = $self->search_mirror_index_file($self->{mirror_index}, $module, $version);
- return $pkg if $pkg;
+ if (not $pkg) {
+ $self->diag_fail("Finding $module ($version) on mirror index $self->{mirror_index} failed.");
+ return;
+ }
+ return $pkg;
}
MIRROR: for my $mirror (@{ $self->{mirrors} }) {