]> wagnertech.de Git - mfinanz.git/blobdiff - scripts/installation_check.pl
Neues Recht "admin" für Administration aus Useraccounts heraus
[mfinanz.git] / scripts / installation_check.pl
index 48a51fd4d43c1c33d5811072c0c4047073d6521e..03b0ae57445b72a9736795e830e72b6e25eefbe0 100755 (executable)
@@ -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,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');
@@ -61,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);
   }
@@ -125,7 +126,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);
   }
@@ -192,10 +194,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 {