X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Finstallation_check.pl;h=2bec003cd76f4b05acad1c2250bf8520eeccdce8;hb=8adb211a4983c297ce4b9b6e59136ffb141a5421;hp=0f0dc202be12d2abb0e5281938ccb5cdb50b9232;hpb=e55f0ed4f13e7e2ad30fd925464378c499006513;p=kivitendo-erp.git diff --git a/scripts/installation_check.pl b/scripts/installation_check.pl index 0f0dc202b..2bec003cd 100755 --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@ -13,7 +13,28 @@ BEGIN { $master_templates = './templates/print/'; } +unless (eval { require Config::Std; 1 }){ + print STDERR < \ ( my $c = 1 ), ); -# if notihing is requested check "required" -$check{r} = 1 unless defined $check{a} || - defined $check{l} || - defined $check{o} || - defined $check{d}; +# if nothing is requested check "required" +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) { @@ -43,9 +68,16 @@ if ($check{a}) { $| = 1; +if (!SL::LxOfficeConf->read(undef, 'may fail')) { + print_header('Could not load the config file. If you have dependancies from any features enabled in the configuration these will still show up as optional because of this. Please rerun this script after installing the dependancies needed to load the cofiguration.') +} else { + SL::InstallationCheck::check_for_conditional_dependencies(); +} + 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'); @@ -61,7 +93,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); } @@ -123,8 +155,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; @@ -178,10 +216,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 {