From: Max Kanat-Alexander Date: Tue, 26 Oct 2010 21:08:21 +0000 (-0700) Subject: Bug 607083: Improve the error message that install-module.pl prints when X-Git-Tag: bugzilla-3.6.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3732c93005461183c4b6662c93236c59dba5b28c;p=thirdparty%2Fbugzilla.git Bug 607083: Improve the error message that install-module.pl prints when you specify an invalid CPAN module. r=mkanat, a=mkanat (module owner) --- diff --git a/Bugzilla/Install/CPAN.pm b/Bugzilla/Install/CPAN.pm index 52f762a9a2..bdf1d5f051 100644 --- a/Bugzilla/Install/CPAN.pm +++ b/Bugzilla/Install/CPAN.pm @@ -149,6 +149,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 eec0bd90eb..9f8744ec46 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -130,6 +130,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 => <