installation_check prüft jetzt auch auf Versionen.
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 24 Aug 2010 09:39:24 +0000 (11:39 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 2 Sep 2010 15:59:54 +0000 (17:59 +0200)
SL/InstallationCheck.pm
scripts/installation_check.pl

index da419e9..52569a4 100644 (file)
@@ -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;
index c7a7cdc..6eca871 100755 (executable)
@@ -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" .