diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-05-27 15:20:05 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-05-27 15:20:05 -0700 |
commit | c5922713bc199600bc8c203155a4016c9d24cbbc (patch) | |
tree | 1b9ec8323fdab801c4ca6aaf74234bfe8f74c56c /rt/sbin | |
parent | 7c841dec307feed06ee532ac18e4114ef68243a8 (diff) |
rt 4.0.20 (RT#13852)
Diffstat (limited to 'rt/sbin')
-rw-r--r-- | rt/sbin/rt-server.fcgi.in | 1 | ||||
-rw-r--r-- | rt/sbin/rt-server.in | 1 | ||||
-rw-r--r-- | rt/sbin/rt-setup-fulltext-index.in | 10 | ||||
-rw-r--r-- | rt/sbin/rt-test-dependencies.in | 6 | ||||
-rw-r--r-- | rt/sbin/rt-validator.in | 4 | ||||
-rw-r--r-- | rt/sbin/standalone_httpd.in | 1 |
6 files changed, 18 insertions, 5 deletions
diff --git a/rt/sbin/rt-server.fcgi.in b/rt/sbin/rt-server.fcgi.in index 0d11f0124..5bd8f3ed2 100644 --- a/rt/sbin/rt-server.fcgi.in +++ b/rt/sbin/rt-server.fcgi.in @@ -138,6 +138,7 @@ EOF # we must disconnect DB before fork if ($RT::Handle) { + $RT::Handle->dbh->disconnect if $RT::Handle->dbh; $RT::Handle->dbh(undef); undef $RT::Handle; } diff --git a/rt/sbin/rt-server.in b/rt/sbin/rt-server.in index 0d11f0124..5bd8f3ed2 100644 --- a/rt/sbin/rt-server.in +++ b/rt/sbin/rt-server.in @@ -138,6 +138,7 @@ EOF # we must disconnect DB before fork if ($RT::Handle) { + $RT::Handle->dbh->disconnect if $RT::Handle->dbh; $RT::Handle->dbh(undef); undef $RT::Handle; } diff --git a/rt/sbin/rt-setup-fulltext-index.in b/rt/sbin/rt-setup-fulltext-index.in index ade728f8f..7a1ede816 100644 --- a/rt/sbin/rt-setup-fulltext-index.in +++ b/rt/sbin/rt-setup-fulltext-index.in @@ -146,10 +146,16 @@ if ( $DB{'type'} eq 'mysql' ) { default => $DEFAULT{'table'}, silent => !$OPT{'ask'}, ); - my $url = $OPT{'url'} || prompt( + + my $url = 'sphinx://localhost:3312/rt'; + my $version = ($dbh->selectrow_array("show variables like 'version'"))[1]; + $url = 'sphinx://127.0.0.1:3312/rt' + if $version and $version =~ /^(\d+\.\d+)/ and $1 >= 5.5; + + $url = $OPT{'url'} || prompt( message => "Enter URL of the sphinx search server; this should be of the form\n" . "sphinx://<server>:<port>/<index name>", - default => 'sphinx://localhost:3312/rt', + default => $url, silent => !$OPT{'ask'}, ); my $maxmatches = $OPT{'maxmatches'} || prompt( diff --git a/rt/sbin/rt-test-dependencies.in b/rt/sbin/rt-test-dependencies.in index 868105431..66215ad29 100644 --- a/rt/sbin/rt-test-dependencies.in +++ b/rt/sbin/rt-test-dependencies.in @@ -55,9 +55,13 @@ 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', @@ -417,7 +421,7 @@ foreach my $type (sort grep $args{$_}, keys %args) { } if ( $args{'install'} && keys %Missing_By_Type ) { - exec($0, @orig_argv, '--no-install'); + exec($script_path, @orig_argv, '--no-install'); } else { conclude(%Missing_By_Type); diff --git a/rt/sbin/rt-validator.in b/rt/sbin/rt-validator.in index 128e60af0..f0f1c59db 100644 --- a/rt/sbin/rt-validator.in +++ b/rt/sbin/rt-validator.in @@ -222,7 +222,7 @@ foreach my $table ( qw(Users Groups) ) { bind_values => [ $type ], action => sub { my $id = shift; - return unless my $a = prompt_action( ['Delete', 'create'], $msg ); + return unless my $a = prompt_action( ['Create', 'delete'], $msg ); if ( $a eq 'd' ) { delete_record( $table, $id ); @@ -1104,7 +1104,7 @@ sub prompt_action { my $token = shift || join ':', caller; return '' unless $opt{'resolve'}; - return '' if $opt{'force'}; + return lc substr $actions->[0], 0, 1 if $opt{'force'}; return $cached_answer{ $token } if exists $cached_answer{ $token }; print $msg, "\n"; diff --git a/rt/sbin/standalone_httpd.in b/rt/sbin/standalone_httpd.in index 0d11f0124..5bd8f3ed2 100644 --- a/rt/sbin/standalone_httpd.in +++ b/rt/sbin/standalone_httpd.in @@ -138,6 +138,7 @@ EOF # we must disconnect DB before fork if ($RT::Handle) { + $RT::Handle->dbh->disconnect if $RT::Handle->dbh; $RT::Handle->dbh(undef); undef $RT::Handle; } |