From c719f2e5cfafc4ca5af27ff769b2b010dbd1f933 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Tue, 26 Oct 2010 14:08:02 -0700 Subject: [PATCH] Bug 607083: Improve the error message that install-module.pl prints when you specify an invalid CPAN module. r=mkanat, a=mkanat (module owner) --- Bugzilla/Install/CPAN.pm | 3 +++ template/en/default/setup/strings.txt.pl | 1 + 2 files changed, 4 insertions(+) diff --git a/Bugzilla/Install/CPAN.pm b/Bugzilla/Install/CPAN.pm index 1d57b08f3a..ba3ebc0fe4 100644 --- a/Bugzilla/Install/CPAN.pm +++ b/Bugzilla/Install/CPAN.pm @@ -147,6 +147,9 @@ sub install_module { } my $module = CPAN::Shell->expand('Module', $name); + if (!$module) { + die install_string('no_such_module', { module => $name }) . "\n"; + } print install_string('install_module', { module => $name, version => $module->cpan_version }) . "\n"; if ($test) { diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index 3793906cac..1cf399c960 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -150,6 +150,7 @@ EOT module_not_found => "not found", module_ok => 'ok', module_unknown_version => "found unknown version", + no_such_module => "There is no Perl module on CPAN named ##module##.", ppm_repo_add => <