From 73080f921d8be0bede0a6505a3d1f2eb5240b3f3 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Tue, 26 Oct 2010 21:21:24 +0000 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) git-svn-id: svn://10.0.0.236/branches/BUGZILLA-4_0-BRANCH@261462 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm | 3 +++ .../webtools/bugzilla/template/en/default/setup/strings.txt.pl | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 1ae8b98ea12..c1f7295bd09 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7458 \ No newline at end of file +7459 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm index 1d57b08f3ae..ba3ebc0fe4f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm +++ b/mozilla/webtools/bugzilla/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/mozilla/webtools/bugzilla/template/en/default/setup/strings.txt.pl b/mozilla/webtools/bugzilla/template/en/default/setup/strings.txt.pl index 3793906cace..1cf399c960c 100644 --- a/mozilla/webtools/bugzilla/template/en/default/setup/strings.txt.pl +++ b/mozilla/webtools/bugzilla/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 => <