]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/InstallationCheck.pm
Merge branch 'master' of git@vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / InstallationCheck.pm
index 70d6217db5ee0cc220ab268d23ba8a115f5e0ef0..3100ac67f0f5d4061ab65d4bdaebbb61ccc64381 100644 (file)
@@ -34,7 +34,9 @@ BEGIN {
   { name => "YAML",            version => '0.62',  url => "http://search.cpan.org/~ingy/",      debian => 'libyaml-perl' },
 );
 
   { name => "YAML",            version => '0.62',  url => "http://search.cpan.org/~ingy/",      debian => 'libyaml-perl' },
 );
 
-@optional_modules = ();
+@optional_modules = (
+  { name => "Digest::SHA",                         url => "http://search.cpan.org/~mshelor/",   debian => 'libdigest-sha-perl' },
+);
 
 @developer_modules = (
   { name => "Devel::REPL",                         url => "http://search.cpan.org/~doy/",       debian => 'libdevel-repl-perl' },
 
 @developer_modules = (
   { name => "Devel::REPL",                         url => "http://search.cpan.org/~doy/",       debian => 'libdevel-repl-perl' },
@@ -51,7 +53,13 @@ sub module_available {
   my $module  = $_[0];
   my $version = $_[1] || '' ;
 
   my $module  = $_[0];
   my $version = $_[1] || '' ;
 
-  return eval "use $module $version; 1";
+  my $got = eval "use $module $version; 1";
+
+  if ($got) {
+    return ($got, $module->VERSION);
+  } else {
+    return
+  }
 }
 
 sub check_kpsewhich {
 }
 
 sub check_kpsewhich {
@@ -71,6 +79,10 @@ sub template_dirs {
 
 sub classes_from_latex {
   my ($path, $class) = @_;
 
 sub classes_from_latex {
   my ($path, $class) = @_;
+  eval { use String::ShellQuote; 1 } or warn "can't load String::ShellQuote" && return;
+  $path  = shell_quote $path;
+  $class = shell_quote $class;
+
   open my $pipe, q#egrep -rs '^[\ \t]*# . "$class' $path". q# | sed 's/ //g' | awk -F '{' '{print $2}' | awk -F '}' '{print $1}' |#;
   my @cls = <$pipe>;
   close $pipe;
   open my $pipe, q#egrep -rs '^[\ \t]*# . "$class' $path". q# | sed 's/ //g' | awk -F '{' '{print $2}' | awk -F '}' '{print $1}' |#;
   my @cls = <$pipe>;
   close $pipe;