From 3c73035dcbdd5141987ef751d5172ddfd3d257ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 24 Aug 2010 11:39:24 +0200 Subject: [PATCH] =?utf8?q?installation=5Fcheck=20pr=C3=BCft=20jetzt=20auch?= =?utf8?q?=20auf=20Versionen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/InstallationCheck.pm | 41 ++++++++++++++++++----------------- scripts/installation_check.pl | 6 ++++- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index da419e982..52569a4eb 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -8,32 +8,33 @@ use vars qw(@required_modules @optional_modules); use strict; @required_modules = ( - { name => "Archive::Zip", url => "http://search.cpan.org/~adamk/" }, - { name => "Class::Accessor", url => "http://search.cpan.org/~kasei/" }, - { name => "CGI::Ajax", url => "http://search.cpan.org/~bct/" }, - { name => "DateTime", url => "http://search.cpan.org/~drolsky/" }, - { name => "DBI", url => "http://search.cpan.org/~timb/" }, - { name => "DBD::Pg", url => "http://search.cpan.org/~dbdpg/" }, - { name => "Email::Address", url => "http://search.cpan.org/~rjbs/" }, - { name => "FCGI", url => "http://search.cpan.org/~mstrout/" }, - { name => "IO::Wrap", url => "http://search.cpan.org/~dskoll/" }, - { name => "List::MoreUtils", url => "http://search.cpan.org/~vparseval/" }, - { name => "PDF::API2", url => "http://search.cpan.org/~areibens/" }, - { name => "Template", url => "http://search.cpan.org/~abw/" }, - { name => "Text::CSV_XS", url => "http://search.cpan.org/~hmbrand/" }, - { name => "Text::Iconv", url => "http://search.cpan.org/~mpiotr/" }, - { name => "URI", url => "http://search.cpan.org/~gaas/" }, - { name => "XML::Writer", url => "http://search.cpan.org/~josephw/" }, - { name => "YAML", url => "http://search.cpan.org/~ingy/" }, - { name => "parent", url => "http://search.cpan.org/dist/parent/" }, + { name => "parent", url => "http://search.cpan.org/~corion/" }, + { name => "Archive::Zip", url => "http://search.cpan.org/~adamk/" }, + { name => "Class::Accessor", url => "http://search.cpan.org/~kasei/" }, + { name => "CGI::Ajax", url => "http://search.cpan.org/~bct/" }, + { name => "DateTime", url => "http://search.cpan.org/~drolsky/" }, + { name => "DBI", url => "http://search.cpan.org/~timb/" }, + { name => "DBD::Pg", url => "http://search.cpan.org/~dbdpg/" }, + { name => "Email::Address", url => "http://search.cpan.org/~rjbs/" }, + { name => "FCGI", url => "http://search.cpan.org/~mstrout/" }, + { name => "IO::Wrap", url => "http://search.cpan.org/~dskoll/" }, + { name => "List::MoreUtils", url => "http://search.cpan.org/~vparseval/" }, + { name => "PDF::API2", url => "http://search.cpan.org/~areibens/" }, + { name => "Template", version => '2.18', url => "http://search.cpan.org/~abw/" }, + { name => "Text::CSV_XS", url => "http://search.cpan.org/~hmbrand/" }, + { name => "Text::Iconv", url => "http://search.cpan.org/~mpiotr/" }, + { name => "URI", url => "http://search.cpan.org/~gaas/" }, + { name => "XML::Writer", url => "http://search.cpan.org/~josephw/" }, + { name => "YAML", url => "http://search.cpan.org/~ingy/" }, ); @optional_modules = (); sub module_available { - my ($module) = @_; + my $module = $_[0]; + my $version = $_[1] || '' ; - if (!defined(eval("require $module;"))) { + if (!defined(eval("require $module $version;"))) { return 0; } else { return 1; diff --git a/scripts/installation_check.pl b/scripts/installation_check.pl index c7a7cdc5a..6eca87189 100755 --- a/scripts/installation_check.pl +++ b/scripts/installation_check.pl @@ -10,7 +10,11 @@ use SL::InstallationCheck; $| = 1; foreach my $module (@SL::InstallationCheck::required_modules) { - print("Looking for $module->{name}..."); + if ($module->{version}) { + print("Looking for $module->{name} $module->{version}..."); + } else { + print("Looking for $module->{name}..."); + } if (!SL::InstallationCheck::module_available($module->{"name"})) { print(" NOT found\n" . " The module '$module->{name}' is not available on your system.\n" . -- 2.20.1