From: Jan Büren Date: Mon, 16 Jan 2012 13:07:47 +0000 (+0100) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-2.7.0beta1~37^2~5 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/5cf44d1d8544fa3426e5fd80108187fefae30df9?ds=inline;hp=-c Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- 5cf44d1d8544fa3426e5fd80108187fefae30df9 diff --combined scripts/installation_check.pl index ba02252af,48a51fd4d..1cebcb28e --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@@ -28,12 -28,12 +28,12 @@@ GetOptions "c|color!" => \ ( my $c = 1 ), ); -# if notihing is requested check "required" +# 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 if ($check{a}) { foreach my $check (keys %check) { $check{$check} = 1 unless defined $check{$check}; @@@ -46,7 -46,6 +46,7 @@@ $| = 1 if ($check{r}) { print_header('Checking Required Modules'); check_module($_, required => 1) for @SL::InstallationCheck::required_modules; + print_header('Standard check for required modules done. See additional parameters for more checks (-- help)') if $default_run; } if ($check{o}) { print_header('Checking Optional Modules'); @@@ -124,8 -123,13 +124,13 @@@ 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) { + print_line($line, $ver || 'no version', 'green'); + } else { + print_result($line, $res); + } + return if $res; @@@ -179,8 -183,17 +184,17 @@@ sub mycolor sub print_result { my ($test, $exit) = @_; - print $test, " ", ('.' x (72 - length $test)); - print $exit ? '.... '. mycolor('ok', 'green') : ' '. mycolor('NOT ok', 'red'); + 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))); + print mycolor($res, $color); print "\n"; return; }