X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Finstallation_check.pl;h=520b4f1c2346b15422d134d633fa43715f02deb0;hb=a71821962da6b8b6b16cdd44c6d446c7112fe03e;hp=1cebcb28e3c911288e65970aed55540985722aa4;hpb=6920de21be13ea47d782736baa24353ff3e3ea85;p=kivitendo-erp.git diff --git a/scripts/installation_check.pl b/scripts/installation_check.pl index 1cebcb28e..520b4f1c2 100755 --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@ -29,11 +29,15 @@ GetOptions( ); # if nothing is requested check "required" -$check{r} = 1 unless defined $check{a} || - defined $check{l} || - defined $check{o} || - defined $check{d}; -my $default_run ='1' if $check{r}; # no parameter, therefore print a note after default run +my $default_run; +if (!defined $check{a} + && !defined $check{l} + && !defined $check{o} + && !defined $check{d}) { + $check{r} = 1; + $default_run ='1'; # no parameter, therefore print a note after default run +} + if ($check{a}) { foreach my $check (keys %check) { $check{$check} = 1 unless defined $check{$check}; @@ -62,7 +66,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); } @@ -126,7 +130,8 @@ sub check_module { my $line = "Looking for $module->{fullname}"; my ($res, $ver) = SL::InstallationCheck::module_available($module->{"name"}, $module->{version}); if ($res) { - print_line($line, $ver || 'no version', 'green'); + 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); } @@ -193,10 +198,7 @@ sub print_result { sub print_line { my ($text, $res, $color) = @_; - print $text, " ", ('.' x (78 - length($text) - length($res))); - print mycolor($res, $color); - print "\n"; - return; + print $text, " ", ('.' x (78 - length($text) - length($res))), " ", mycolor($res, $color), $/; } sub print_header {