Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the behavior of --mirror-index so that it won't fall back to …

…the default index. Fixes #150
  • Loading branch information...
commit 0745cdb120152d80c8810263fbd3b8590a204590 1 parent a333914
@miyagawa authored
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/App/cpanminus/script.pm
  2. +1 −1  xt/cascade_search.t
View
6 lib/App/cpanminus/script.pm
@@ -311,7 +311,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;
}
unless ($self->{mirror_only}) {
View
2  xt/cascade_search.t
@@ -10,6 +10,6 @@ run "-L", $local_lib, "--mirror-index", "xt/mirror.txt", "--skip-installed", "Ha
like last_build_log, qr/Hash::MultiValue is up to date/;
run "-L", $local_lib, "--mirror-index", "xt/mirror.txt", "--skip-installed", "--cascade-search", "Hash::MultiValue~0.03";
-like last_build_log, qr/installed Hash-MultiValue/;
+like last_build_log, qr/Couldn't find .* Hash::MultiValue/;
done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.