From: Sven Schöling Date: Mon, 16 Jan 2012 12:54:12 +0000 (+0100) Subject: Versionen im installcheck anzeigen. X-Git-Tag: release-2.7.0beta1~32^2~7^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4ab31a8f9fb7e7be456a9cb8d9cf9d95e6998427;p=kivitendo-erp.git Versionen im installcheck anzeigen. --- diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index e8670761c..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 { diff --git a/scripts/installation_check.pl b/scripts/installation_check.pl index 0f0dc202b..48a51fd4d 100755 --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@ -123,8 +123,13 @@ 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) { + print_line($line, $ver || 'no version', 'green'); + } else { + print_result($line, $res); + } + return if $res; @@ -178,8 +183,17 @@ sub mycolor { sub print_result { my ($test, $exit) = @_; - print $test, " ", ('.' x (72 - length $test)); - print $exit ? '.... '. mycolor('ok', 'green') : ' '. mycolor('NOT ok', 'red'); + 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))); + print mycolor($res, $color); print "\n"; return; }