X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fsbin%2Frt-test-dependencies;h=99520aaa79dbec90f847f2f8a18f0390eca412b5;hb=ed1f84b4e8f626245995ecda5afcf83092c153b2;hp=f5eb584a31e744c77f5c0d5d1bac9cf60a9aabab;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4;p=freeside.git diff --git a/rt/sbin/rt-test-dependencies b/rt/sbin/rt-test-dependencies index f5eb584a3..99520aaa7 100755 --- a/rt/sbin/rt-test-dependencies +++ b/rt/sbin/rt-test-dependencies @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -52,13 +52,19 @@ # use strict; +use warnings; no warnings qw(numeric redefine); use Getopt::Long; +use Cwd qw(abs_path); my %args; my %deps; +my @orig_argv = @ARGV; +# Save our path because installers or tests can change cwd +my $script_path = abs_path($0); + GetOptions( \%args, 'v|verbose', - 'install', 'with-MYSQL', + 'install!', 'with-MYSQL', 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE', 'with-ORACLE', 'with-FASTCGI', 'with-MODPERL1', 'with-MODPERL2', @@ -74,6 +80,7 @@ GetOptions( 'with-DASHBOARDS', 'with-USERLOGO', 'with-SSL-MAILGATE', + 'with-HTML-DOC', 'download=s', 'repository=s', @@ -98,11 +105,12 @@ my %default = ( 'with-GPG' => 1, 'with-ICAL' => 1, 'with-SMTP' => 1, - 'with-GRAPHVIZ' => 0, + 'with-GRAPHVIZ' => 1, 'with-GD' => 0, 'with-DASHBOARDS' => 1, 'with-USERLOGO' => 1, 'with-SSL-MAILGATE' => 0, + 'with-HTML-DOC' => 0, ); $args{$_} = $default{$_} foreach grep !exists $args{$_}, keys %default; @@ -173,6 +181,12 @@ sub text_to_hash { return %hash; } +sub set_dep { + my ($name, $module, $version) = @_; + my %list = @{$deps{$name}}; + $list{$module} = ($version || ''); + $deps{$name} = [ %list ]; +} $deps{'CORE'} = [ text_to_hash( << '.') ]; Class::Accessor 0.34 @@ -189,6 +203,8 @@ File::ShareDir File::Spec 0.8 HTML::Quoted HTML::Scrubber 0.08 +HTML::TreeBuilder +HTML::FormatText Log::Dispatch 2.23 Sys::Syslog 0.16 Locale::Maketext 1.06 @@ -243,10 +259,10 @@ Plack 0.9971 Plack::Handler::Starlet CGI::Emulate::PSGI . +set_dep( PSGI => CGI => 4.00 ) if $] > 5.019003; + $deps{'MAILGATE'} = [ text_to_hash( << '.') ]; -HTML::TreeBuilder -HTML::FormatText Getopt::Long LWP::UserAgent Pod::Usage @@ -288,12 +304,14 @@ Test::Builder 0.90 # needed for is_passing Test::MockTime Log::Dispatch::Perl Test::WWW::Mechanize::PSGI -Plack::Middleware::Test::StashWarnings +Plack::Middleware::Test::StashWarnings 0.08 Test::LongString +Test::NoWarnings +Locale::PO . $deps{'FASTCGI'} = [ text_to_hash( << '.') ]; -FCGI +FCGI 0.74 FCGI::ProcManager . @@ -316,6 +334,7 @@ DBD::Oracle . $deps{'POSTGRESQL'} = [ text_to_hash( << '.') ]; +DBIx::SearchBuilder 1.66 DBD::Pg 1.43 . @@ -337,13 +356,14 @@ Net::SMTP . $deps{'DASHBOARDS'} = [ text_to_hash( << '.') ]; -HTML::RewriteAttributes 0.04 +HTML::RewriteAttributes 0.05 MIME::Types +URI 1.59 . $deps{'GRAPHVIZ'} = [ text_to_hash( << '.') ]; GraphViz -IPC::Run +IPC::Run 0.90 . $deps{'GD'} = [ text_to_hash( << '.') ]; @@ -356,8 +376,15 @@ $deps{'USERLOGO'} = [ text_to_hash( << '.') ]; Convert::Color . +$deps{'HTML-DOC'} = [ text_to_hash( <<'.') ]; +Pod::Simple 3.24 +HTML::Entities +. + my %AVOID = ( 'DBD::Oracle' => [qw(1.23)], + 'Email::Address' => [qw(1.893 1.894)], + 'Devel::StackTrace' => [qw(1.28 1.29)], ); if ($args{'download'}) { @@ -402,7 +429,12 @@ foreach my $type (sort grep $args{$_}, keys %args) { $Missing_By_Type{$type} = \%missing if keys %missing; } -conclude(%Missing_By_Type); +if ( $args{'install'} && keys %Missing_By_Type ) { + exec($script_path, @orig_argv, '--no-install'); +} +else { + conclude(%Missing_By_Type); +} sub test_deps { my @deps = @_; @@ -430,6 +462,7 @@ sub test_dep { print $module, ': ', $version || 0, "\n"; } else { + no warnings 'deprecated'; eval "use $module $version ()"; if ( my $error = $@ ) { return 0 unless wantarray;