[Rt-commit] r19953 - in rt/3.999/trunk: lib lib/RT

sartak at bestpractical.com sartak at bestpractical.com
Mon Jun 8 16:49:52 EDT 2009


Author: sartak
Date: Mon Jun  8 16:49:51 2009
New Revision: 19953

Modified:
   rt/3.999/trunk/lib/RT.pm
   rt/3.999/trunk/lib/RT/EmailParser.pm
   rt/3.999/trunk/lib/RT/Shredder.pm
   rt/3.999/trunk/sbin/rt-setup-database
   rt/3.999/trunk/sbin/rt-setup-fulltext-index

Log:
RT->var_path

Modified: rt/3.999/trunk/lib/RT.pm
==============================================================================
--- rt/3.999/trunk/lib/RT.pm	(original)
+++ rt/3.999/trunk/lib/RT.pm	Mon Jun  8 16:49:51 2009
@@ -62,7 +62,6 @@
 our $VERSION = '3.999.0';
 
 our $BASE_PATH        = Jifty::Util->app_root;
-our $VarPath          = $BASE_PATH . '/var';
 our $LocalPath        = $BASE_PATH . '/local';
 our $LocalPluginPath  = $LocalPath . "/plugins";
 
@@ -402,6 +401,14 @@
 
 sub etc_path { Jifty::Util->app_root . '/etc' }
 
+=head2 var_path
+
+The root of F</var> (internal book-keeping)
+
+=cut
+
+sub var_path { Jifty::Util->app_root . '/var' }
+
 =head1 BUGS
 
 Please report them to C<rt-bugs at bestpractical.com>, if you know what's

Modified: rt/3.999/trunk/lib/RT/EmailParser.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/EmailParser.pm	(original)
+++ rt/3.999/trunk/lib/RT/EmailParser.pm	Mon Jun  8 16:49:51 2009
@@ -417,19 +417,21 @@
     my $self   = shift;
     my $parser = shift;
 
-    # Set up output directory for files; we use $RT::VarPath instead
+    my $var_path = RT->var_path;
+
+    # Set up output directory for files; we use RT->var_path instead
     # of File::Spec->tmpdir (e.g., /tmp) beacuse it isn't always
     # writable.
     my $tmpdir;
-    if ( -w $RT::VarPath ) {
-        $tmpdir = File::Temp::tempdir( DIR => $RT::VarPath, CLEANUP => 1 );
+    if ( -w $var_path ) {
+        $tmpdir = File::Temp::tempdir( DIR => $var_path, CLEANUP => 1 );
     }
     elsif ( -w File::Spec->tmpdir ) {
         $tmpdir = File::Temp::tempdir( TMPDIR => 1, CLEANUP => 1 );
     }
     else {
         Jifty->log->fatal(
-"Neither the RT var directory ($RT::VarPath) nor the system tmpdir (@{[File::Spec->tmpdir]}) are writable; falling back to in-memory parsing!"
+"Neither the RT var directory ($var_path) nor the system tmpdir (@{[File::Spec->tmpdir]}) are writable; falling back to in-memory parsing!"
         );
     }
 

Modified: rt/3.999/trunk/lib/RT/Shredder.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Shredder.pm	(original)
+++ rt/3.999/trunk/lib/RT/Shredder.pm	Mon Jun  8 16:49:51 2009
@@ -701,7 +701,7 @@
 
 sub storage_path {
     return scalar( RT->config->get('shredder_storage_path') )
-        || File::Spec->catdir( $RT::VarPath, qw(data RT-Shredder) );
+        || File::Spec->catdir( RT->var_path, qw(data RT-Shredder) );
 }
 
 my %active_dump_state = ();

Modified: rt/3.999/trunk/sbin/rt-setup-database
==============================================================================
--- rt/3.999/trunk/sbin/rt-setup-database	(original)
+++ rt/3.999/trunk/sbin/rt-setup-database	Mon Jun  8 16:49:51 2009
@@ -116,7 +116,7 @@
 
 
 if ( $db_type eq 'SQLite' && !File::Spec->file_name_is_absolute($db_name) ) {
-    $db_name = File::Spec->catfile($RT::VarPath, $db_name);
+    $db_name = File::Spec->catfile(RT->var_path, $db_name);
     RT->config->set( databasename => $db_name );
 }
 

Modified: rt/3.999/trunk/sbin/rt-setup-fulltext-index
==============================================================================
--- rt/3.999/trunk/sbin/rt-setup-fulltext-index	(original)
+++ rt/3.999/trunk/sbin/rt-setup-fulltext-index	Mon Jun  8 16:49:51 2009
@@ -123,6 +123,8 @@
     my $port  = $urlo->port;
     my $index = $urlo->path;
 
+    my $var_path = RT->var_path;
+
     my %sphinx_conf = ();
     $sphinx_conf{'host'} = RT->config->get('DatabaseHost');
     $sphinx_conf{'db'}   = RT->config->get('DatabaseName');
@@ -152,7 +154,7 @@
 
 index $index {
     source                  = rt
-    path                    = $RT::VarPath/sphinx/index
+    path                    = $var_path/sphinx/index
     docinfo                 = extern
     charset_type            = utf-8
 }
@@ -163,11 +165,11 @@
 
 searchd {
     port                    = $port
-    log                     = $RT::VarPath/sphinx/searchd.log
-    query_log               = $RT::VarPath/sphinx/query.log
+    log                     = $var_path/sphinx/searchd.log
+    query_log               = $var_path/sphinx/query.log
     read_timeout            = 5
     max_children            = 30
-    pid_file                = $RT::VarPath/sphinx/searchd.pid
+    pid_file                = $var_path/sphinx/searchd.pid
     max_matches             = 1000
     seamless_rotate         = 1
     preopen_indexes         = 0


More information about the Rt-commit mailing list