]> wagnertech.de Git - mfinanz.git/blobdiff - scripts/installation_check.pl
Merge branch 'sepa-fixes-2320'
[mfinanz.git] / scripts / installation_check.pl
index a50d184d2863e06a91d2e05c5e34dae7b92fb1a0..3a69630ba04771747e0f32a87a5817d1279fcc7b 100755 (executable)
@@ -13,13 +13,34 @@ BEGIN {
   $master_templates = './templates/print/';
 }
 
+unless (eval { require Config::Std; 1 }){
+  print STDERR <<EOL ;
++------------------------------------------------------------------------------+
+  Perl Modul Config::Std could not be loaded.
+
+  Debian: you may install the needed *.deb package with:
+    apt-get install libconfig-std-perl
+
+  RPM: There is a rpm package "perl-Config-Std"
+
+  Suse: you may install the needed *.rpm package with:
+    zypper install perl-Config-Std
+
++------------------------------------------------------------------------------+
+EOL
+
+  exit 72;
+}
+
 use SL::InstallationCheck;
 use SL::LxOfficeConf;
 
+
 my %check;
 Getopt::Long::Configure ("bundling");
 GetOptions(
   "v|verbose"   => \ my $v,
+  "V|no-verbose"   => \ my $nv,
   "a|all"       => \ $check{a},
   "o|optional!" => \ $check{o},
   "d|devel!"    => \ $check{d},
@@ -29,6 +50,15 @@ GetOptions(
   "c|color!"    => \ ( my $c = 1 ),
 );
 
+# verbos is default
+if ( $v && $nv ){
+  $v = 1;
+}elsif ($nv){
+  undef $v;
+}else{
+  $v = 1;
+}
+
 # if nothing is requested check "required"
 my $default_run;
 if (!defined $check{a}
@@ -135,6 +165,7 @@ sub check_module {
   my ($module, %role) = @_;
 
   my $line = "Looking for $module->{fullname}";
+  $line   .= " (from $module->{dist_name})" if $module->{dist_name};
   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';
@@ -147,9 +178,9 @@ sub check_module {
   return if $res;
 
   my $needed_text =
-      $role{optional} ? 'It is OPTIONAL for Lx-Office but RECOMMENDED for improved functionality.'
-    : $role{required} ? 'It is NEEDED by Lx-Office and must be installed.'
-    : $role{devel}    ? 'It is OPTIONAL for Lx-Office and only useful for developers.'
+      $role{optional} ? 'It is OPTIONAL for kivitendo but RECOMMENDED for improved functionality.'
+    : $role{required} ? 'It is NEEDED by kivitendo and must be installed.'
+    : $role{devel}    ? 'It is OPTIONAL for kivitendo and only useful for developers.'
     :                   'It is not listed as a dependancy yet. Please tell this the developers.';
 
   my @source_texts = module_source_texts($module);
@@ -221,7 +252,7 @@ __END__
 
 =head1 NAME
 
-scripts/installation_check.pl - check Lx-Office dependancies
+scripts/installation_check.pl - check kivitendo dependancies
 
 =head1 SYNOPSIS
 
@@ -229,9 +260,9 @@ scripts/installation_check.pl - check Lx-Office dependancies
 
 =head1 DESCRIPTION
 
-Check dependencys. List all perl modules needed by Lx-Office, probes for them,
+Check dependencys. List all perl modules needed by kivitendo, probes for them,
 and warns if one is not available.  List all LaTeX document classes and
-packages needed by Lx-Office master templates, probes for them, and warns if
+packages needed by kivitendo master templates, probes for them, and warns if
 one is not available.
 
 
@@ -287,9 +318,13 @@ Probe for LaTeX documentclasses and packages in master templates.
 
 Don't probe for LaTeX document classes and packages in master templates. (Useful in combination with --all)
 
-=item C<-v. --verbose>
+=item C<-v, --verbose>
+
+Print additional info for missing dependancies (enabled by default)
+
+=item C<-V, --no-verbose>
 
-Print additional info for missing dependancies
+Disable verbosity
 
 =back