summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install/Requirements.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-08-12 15:05:26 +0200
committerlpsolit%gmail.com <>2009-08-12 15:05:26 +0200
commitc64d5c4846f0f33087fb3d734a8d01588d904dbd (patch)
tree9b682a8b391f4985d559121ea630b1fd3efffea7 /Bugzilla/Install/Requirements.pm
parent835dbdbd5cff2107ed6087ede234641145122352 (diff)
downloadbugzilla-c64d5c4846f0f33087fb3d734a8d01588d904dbd.tar.gz
bugzilla-c64d5c4846f0f33087fb3d734a8d01588d904dbd.tar.xz
Bug 507493: checksetup.pl's output should use colors for missing and too old Perl modules - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'Bugzilla/Install/Requirements.pm')
-rw-r--r--Bugzilla/Install/Requirements.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm
index 2b496fc2c..0d013f62f 100644
--- a/Bugzilla/Install/Requirements.pm
+++ b/Bugzilla/Install/Requirements.pm
@@ -29,6 +29,7 @@ use Bugzilla::Constants;
use Bugzilla::Install::Util qw(vers_cmp install_string);
use List::Util qw(max);
use Safe;
+use Term::ANSIColor;
use base qw(Exporter);
our @EXPORT = qw(
@@ -429,8 +430,8 @@ sub print_module_instructions {
if (vers_cmp($perl_ver, '5.10') > -1) {
$url_to_theory58S = 'http://cpan.uwinnipeg.ca/PPMPackages/10xx/';
}
- print install_string('ppm_repo_add',
- { theory_url => $url_to_theory58S });
+ print colored(install_string('ppm_repo_add',
+ { theory_url => $url_to_theory58S }), 'red');
# ActivePerls older than revision 819 require an additional command.
if (_get_activestate_build_id() < 819) {
print install_string('ppm_repo_up');
@@ -463,7 +464,7 @@ sub print_module_instructions {
}
if (my @missing = @{$check_results->{missing}}) {
- print install_string('commands_required') . "\n";
+ print colored(install_string('commands_required'), 'red') . "\n";
foreach my $package (@missing) {
my $command = install_command($package);
print " $command\n";
@@ -473,6 +474,9 @@ sub print_module_instructions {
if ($output && $check_results->{any_missing} && !ON_WINDOWS) {
print install_string('install_all', { perl => $^X });
}
+ if (!$check_results->{pass}) {
+ print colored(install_string('installation_failed'), 'red') . "\n\n";
+ }
}
sub _translate_feature {
@@ -562,8 +566,9 @@ sub have_vers {
my $want_string = $wanted ? "v$wanted" : install_string('any');
$ok = "$ok:" if $ok;
- printf "%s %19s %-9s $ok $vstr $black_string\n",
- install_string('checking_for'), $package, "($want_string)";
+ my $str = sprintf "%s %19s %-9s $ok $vstr $black_string\n",
+ install_string('checking_for'), $package, "($want_string)";
+ print $vok ? $str : colored($str, 'red');
}
return $vok ? 1 : 0;