X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Finstallation_check.pl;h=03b0ae57445b72a9736795e830e72b6e25eefbe0;hb=3695e9792d1b25757e80ffd894a80cd849aa2b67;hp=ba02252af87f64f60b84b8cf80dddc0a60834ca4;hpb=a12a2e5dcccd7d6f012ad4e89a57d24ba5461352;p=kivitendo-erp.git diff --git a/scripts/installation_check.pl b/scripts/installation_check.pl index ba02252af..03b0ae574 100755 --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@ -62,7 +62,7 @@ if ($check{l}) { sub check_latex { my ($res) = check_kpsewhich(); - print_result("Looking for LaTeX kpsewhich", $res ? ('ok', 'green') : ('NOT ok', 'red')); + print_result("Looking for LaTeX kpsewhich", $res); if ($res) { check_template_dir($_) for SL::InstallationCheck::template_dirs($master_templates); } @@ -124,8 +124,14 @@ sub check_module { my ($module, %role) = @_; my $line = "Looking for $module->{fullname}"; - my $res = SL::InstallationCheck::module_available($module->{"name"}, $module->{version}); - print_result($line, $res); + my ($res, $ver) = SL::InstallationCheck::module_available($module->{"name"}, $module->{version}); + if ($res) { + my $ver_string = ref $ver && $ver->can('numify') ? $ver->numify : $ver ? $ver : 'no version'; + print_line($line, $ver_string, 'green'); + } else { + print_result($line, $res); + } + return if $res; @@ -179,10 +185,16 @@ sub mycolor { sub print_result { my ($test, $exit) = @_; - print $test, " ", ('.' x (72 - length $test)); - print $exit ? '.... '. mycolor('ok', 'green') : ' '. mycolor('NOT ok', 'red'); - print "\n"; - return; + if ($exit) { + print_line($test, 'ok', 'green'); + } else { + print_line($test, 'NOT ok', 'red'); + } +} + +sub print_line { + my ($text, $res, $color) = @_; + print $text, " ", ('.' x (78 - length($text) - length($res))), " ", mycolor($res, $color), $/; } sub print_header {