summaryrefslogtreecommitdiff
path: root/Porting/sync-with-cpan
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2016-12-30 15:26:37 +0000
committerAaron Crane <arc@cpan.org>2016-12-30 18:44:55 +0000
commit469f794845017634fade642803387556b4f226d4 (patch)
treed6c728ab08c9988c599ee1c3c5b18f3cdc5be45b /Porting/sync-with-cpan
parent7035e4d30f85a7fd0408e933a583d34d140e3714 (diff)
downloadperl-469f794845017634fade642803387556b4f226d4.tar.gz
Porting/sync-with-cpan: try to change "::" to "-" in module name
This is needed for cases like IO-Compress when the user asks for "IO::Compress". In addition, if we still can't find the module, be more explicit about what the problem is.
Diffstat (limited to 'Porting/sync-with-cpan')
-rwxr-xr-xPorting/sync-with-cpan13
1 files changed, 8 insertions, 5 deletions
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan
index 564b6aff27..498862d589 100755
--- a/Porting/sync-with-cpan
+++ b/Porting/sync-with-cpan
@@ -229,11 +229,14 @@ my ($module) = shift;
my $info = $Modules{$module};
if (!$info) {
- # Maybe the user said "Test-Simple" instead of "Test::Simple". See if we
- # can fix it up.
- (my $guess = $module) =~ s/-/::/g;
- $info = $Modules{$guess}
- or die "Cannot find module $module";
+ # Maybe the user said "Test-Simple" instead of "Test::Simple", or
+ # "IO::Compress" instead of "IO-Compress". See if we can fix it up.
+ my $guess = $module;
+ s/-/::/g or s/::/-/g for $guess;
+ $info = $Modules{$guess} or die <<"EOF";
+Cannot find module $module.
+The available options are listed in the %Modules hash in Porting/Maintainers.pl
+EOF
say "Guessing you meant $guess instead of $module";
$module = $guess;
}