X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/8024be0f4ce99c6062f8e1858ba991f271647cb7..f7866adf1844e79ada8df88c703b0ec9a39c5657:/SL/InstallationCheck.pm diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index 70d6217db..0d1ab8bd5 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -51,7 +51,13 @@ sub module_available { 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 { @@ -71,6 +77,10 @@ sub template_dirs { 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;