import of rt 3.0.9
[freeside.git] / rt / sbin / rt-test-dependencies
index 637d33a..c1591b1 100644 (file)
@@ -36,10 +36,14 @@ my %args;
 my %deps;
 GetOptions(\%args,'install', 'with-MYSQL', 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE', 'with-ORACLE', 'with-FASTCGI', 'with-SPEEDYCGI', 'with-MODPERL1', 'with-MODPERL2' ,'with-DEV');
 
-if  (!keys %args) {
-help();
-exit(0);
+if (!keys %args) {
+    help();
+    exit(0);
+}
+if ($args{'with-MODPERL2'}) {
+    warn_modperl2();
 }
+
 $args{'with-MASON'} = 1;
 $args{'with-CORE'} = 1;
 $args{'with-DEV'} =1; 
@@ -49,10 +53,20 @@ if ($] < 5.007) {
 $args{'with-I18N-COMPAT'} = 1;
 }
 
+sub warn_modperl2 {
+    print <<'.';
+        NOTE: mod_perl 2.0 isn't quite ready for prime_time just yet;
+        Best Practical Solutions strongly recommends that sites use
+        Apache 1.3 or FastCGI. If you MUST use mod_perl 2.0 (or 1.99),
+        please read the mailing list archives before asking for help.
+.
+    sleep 5;
+}
+
 
 sub help {
 
-print <<'.'
+    print <<'.';
 
 By default, testdeps determine whether you have 
 installed all the perl modules RT needs to run.
@@ -81,18 +95,18 @@ sub _ {
 }
 
 $deps{'CORE'} = [ _( << '.') ];
-Digest::MD5
-DBI 1.18
+Digest::MD5 2.27
+DBI 1.37
 Test::Inline
 Class::ReturnValue 0.40
-DBIx::SearchBuilder 0.86
+DBIx::SearchBuilder 0.97
 Text::Template
 File::Spec 0.8
 HTML::Entities 
 Net::Domain
 Log::Dispatch 2.0
-Locale::Maketext 1.04
-Locale::Maketext::Lexicon 0.25
+Locale::Maketext 1.06
+Locale::Maketext::Lexicon 0.32
 Locale::Maketext::Fuzzy
 MIME::Entity 5.108
 Mail::Mailer 1.57
@@ -102,7 +116,8 @@ Time::ParseDate
 File::Temp
 Term::ReadKey
 Text::Autoformat
-Text::Quoted
+Text::Quoted 1.3
+Scalar::Util
 .
 
 $deps{'MASON'} = [ _( << '.') ];
@@ -113,9 +128,9 @@ HTML::Mason 1.16
 MLDBM
 Errno
 FreezeThaw
-Digest::MD5
+Digest::MD5 2.27
 CGI::Cookie 1.20
-Storable
+Storable 2.08
 Apache::Session 1.53
 .
 
@@ -138,25 +153,25 @@ WWW::Mechanize
 .
 
 $deps{'FASTCGI'} = [ _( << '.') ];
-CGI
+CGI 2.92
 FCGI
 CGI::Fast 
 .
 
 $deps{'SPEEDYCGI'} = [ _( << '.') ];
-CGI
+CGI 2.92
 CGI::SpeedyCGI
 .
 
 
 $deps{'MODPERL1'} = [ _( << '.') ];
-CGI
+CGI 2.92
 Apache::Request
-Apache::DBI
+Apache::DBI 0.92
 .
 
 $deps{'MODPERL2'} = [ _( << '.') ];
-CGI 2.89
+CGI 2.92
 Apache::DBI
 .
 
@@ -175,6 +190,23 @@ $deps{'POSTGRESQL'} = [ _( << '.') ];
 DBD::Pg
 .
 
+print "perl:\n";
+print "\t5.8.0";
+eval {require 5.008};
+if ($@) {
+print "...missing.\n";
+        eval {require 5.006001};
+        if ($@) {
+            print " RT is known to be non-functional on versions of perl older than 5.6.1. Please upgrade to 5.8.0 or newer";
+            die;
+        } else {
+            print " RT is not supported on perl 5.6.1\n";
+        }
+} else {
+        print "...found\n";
+
+}
+
 
 foreach my $type (keys %args)  {
 next unless ($type =~ /^with-(.*?)$/);
@@ -196,17 +228,17 @@ sub test_dep {
        my $module = shift;
        my $version = shift;
 
-         print "\t$module $version";
-        eval "use $module $version" ;
-        if ($@) {
-       my $error = $@;
-       $error =~ s/\n(.*)$//s;
-       print "...MISSING\n";
-               print "\t\t$error\n" if $error =~ /this is only/;
+       print "\t$module $version";
+       eval "use $module $version" ;
+       if ($@) {
+               my $error = $@;
+               $error =~ s/\n(.*)$//s;
+               print "...MISSING\n";
+                       print "\t\t$error\n" if $error =~ /this is only/;
 
-       return undef;
+               return undef;
        } else {
-       print "...found\n";
+               print "...found\n";
 return 1;
        }
 }