[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-168-g6b7a0c4
Jesse Vincent
jesse at bestpractical.com
Tue Oct 19 02:33:59 EDT 2010
The branch, 3.9-trunk has been updated
via 6b7a0c41f41bf36f0e4ce0e013c72bfbcc60c54e (commit)
via 5ec8f53e6c625146c50b3c6372300bdd6fdb6d05 (commit)
via 6807d01dbb5758662381d492f32d5c47f23f9806 (commit)
from 0fe7b3484749916faab3a2f5aef394bbfe729333 (commit)
Summary of changes:
configure.ac | 4 +-
etc/RT_Config.pm.in | 6 ++
lib/{RT.pm.in => RT.pm} | 142 +++++++++++++++++-----------------
lib/RT/Generated.pm.in | 33 ++++++++
share/html/Admin/Elements/QueueTabs | 4 +-
5 files changed, 114 insertions(+), 75 deletions(-)
rename lib/{RT.pm.in => RT.pm} (88%)
create mode 100644 lib/RT/Generated.pm.in
- Log -----------------------------------------------------------------
commit 6807d01dbb5758662381d492f32d5c47f23f9806
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Oct 19 14:48:09 2010 +0900
Refactor directory canonicalization out into a sub
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 23f2924..bf8ca2a 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2255,4 +2255,10 @@ This option is exists for backwards compatibility. Don't use it.
=cut
+=head1 DON'T MESS WITH THE STUFF BELOW
+
+=cut
+
+
+
1;
diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index 06b3a67..de79f45 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -92,33 +92,7 @@ our $MasonDataDir = '@MASON_DATA_PATH@';
# via the web interface)
our $MasonSessionDir = '@MASON_SESSION_PATH@';
-unless ( File::Spec->file_name_is_absolute($EtcPath) ) {
-
-# if BasePath exists and is absolute, we won't infer it from $INC{'RT.pm'}.
-# otherwise RT.pm will make src dir(where we configure RT) be the BasePath
-# instead of the --prefix one
- unless ( -d $BasePath && File::Spec->file_name_is_absolute($BasePath) ) {
- my $pm_path = ( File::Spec->splitpath( $INC{'RT.pm'} ) )[1];
-
- # need rel2abs here is to make sure path is absolute, since $INC{'RT.pm'}
- # is not always absolute
- $BasePath =
- File::Spec->rel2abs(
- File::Spec->catdir( $pm_path, File::Spec->updir ) );
- }
-
- $BasePath = Cwd::realpath( $BasePath );
-
- for my $path ( qw/EtcPath BinPath SbinPath VarPath LocalPath LocalEtcPath
- LocalLibPath LexiconPath LocalLexiconPath PluginPath
- LocalPluginPath MasonComponentRoot MasonLocalComponentRoot
- MasonDataDir MasonSessionDir/ ) {
- no strict 'refs';
- # just change relative ones
- $$path = File::Spec->catfile( $BasePath, $$path )
- unless File::Spec->file_name_is_absolute( $$path );
- }
-}
+CanonicalizePaths();
=head1 NAME
@@ -686,6 +660,41 @@ sub InstallMode {
return $_INSTALL_MODE;
}
+sub CanonicalizePaths {
+ unless ( File::Spec->file_name_is_absolute($EtcPath) ) {
+
+ # if BasePath exists and is absolute, we won't infer it from $INC{'RT.pm'}.
+ # otherwise RT.pm will make the source dir(where we configure RT) be the
+ # BasePath instead of the one specified by --prefix
+ unless ( -d $BasePath
+ && File::Spec->file_name_is_absolute($BasePath) )
+ {
+ my $pm_path = ( File::Spec->splitpath( $INC{'RT.pm'} ) )[1];
+
+ # need rel2abs here is to make sure path is absolute, since $INC{'RT.pm'}
+ # is not always absolute
+ $BasePath = File::Spec->rel2abs(
+ File::Spec->catdir( $pm_path, File::Spec->updir ) );
+ }
+
+ $BasePath = Cwd::realpath($BasePath);
+
+ for my $path (
+ qw/EtcPath BinPath SbinPath VarPath LocalPath LocalEtcPath
+ LocalLibPath LexiconPath LocalLexiconPath PluginPath
+ LocalPluginPath MasonComponentRoot MasonLocalComponentRoot
+ MasonDataDir MasonSessionDir/
+ )
+ {
+ no strict 'refs';
+
+ # just change relative ones
+ $$path = File::Spec->catfile( $BasePath, $$path )
+ unless File::Spec->file_name_is_absolute($$path);
+ }
+ }
+
+}
=head1 BUGS
commit 5ec8f53e6c625146c50b3c6372300bdd6fdb6d05
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Oct 19 15:10:03 2010 +0900
RT.pm is no longer a generated file, lib/RT/Generated.pm is
diff --git a/configure.ac b/configure.ac
index b908c3d..3981d16 100755
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ AC_REVISION($Revision$)dnl
dnl Setup autoconf
AC_PREREQ([2.53])
AC_INIT(RT, m4_esyscmd([( git describe --tags || cat ./.tag 2> /dev/null || echo "rt-3.9.EXPORTED" )| tr -d "\n"]), [rt-bugs at bestpractical.com])
-AC_CONFIG_SRCDIR([lib/RT.pm.in])
+AC_CONFIG_SRCDIR([lib/RT.pm])
dnl Extract RT version number components
AC_SUBST([rt_version_major],
@@ -422,7 +422,7 @@ dnl All other generated files
AC_CONFIG_FILES([
Makefile
etc/RT_Config.pm
- lib/RT.pm
+ lib/RT/Generated.pm
bin/mason_handler.svc
bin/webmux.pl
t/data/configs/apache2.2+mod_perl.conf
diff --git a/lib/RT.pm.in b/lib/RT.pm
similarity index 93%
rename from lib/RT.pm.in
rename to lib/RT.pm
index de79f45..c8c1df5 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm
@@ -57,43 +57,25 @@ use Cwd ();
use vars qw($Config $System $SystemUser $Nobody $Handle $Logger $_INSTALL_MODE);
-our $VERSION = '@RT_VERSION_MAJOR at .@RT_VERSION_MINOR at .@RT_VERSION_PATCH@';
-
- at DATABASE_ENV_PREF@
-
-our $BasePath = '@RT_PATH@';
-our $EtcPath = '@RT_ETC_PATH@';
-our $BinPath = '@RT_BIN_PATH@';
-our $SbinPath = '@RT_SBIN_PATH@';
-our $VarPath = '@RT_VAR_PATH@';
-our $LexiconPath = '@RT_LEXICON_PATH@';
-our $PluginPath = '@RT_PLUGIN_PATH@';
-our $LocalPath = '@RT_LOCAL_PATH@';
-our $LocalEtcPath = '@LOCAL_ETC_PATH@';
-our $LocalLibPath = '@LOCAL_LIB_PATH@';
-our $LocalLexiconPath = '@LOCAL_LEXICON_PATH@';
-our $LocalPluginPath = $LocalPath."/plugins";
-
-
-# $MasonComponentRoot is where your rt instance keeps its mason html files
-
-our $MasonComponentRoot = '@MASON_HTML_PATH@';
-
-# $MasonLocalComponentRoot is where your rt instance keeps its site-local
-# mason html files.
-
-our $MasonLocalComponentRoot = '@MASON_LOCAL_HTML_PATH@';
-
-# $MasonDataDir Where mason keeps its datafiles
-
-our $MasonDataDir = '@MASON_DATA_PATH@';
-
-# RT needs to put session data (for preserving state between connections
-# via the web interface)
-our $MasonSessionDir = '@MASON_SESSION_PATH@';
-
-CanonicalizePaths();
-
+use vars qw($BasePath
+ $EtcPath
+ $BinPath
+ $SbinPath
+ $VarPath
+ $LexiconPath
+ $PluginPath
+ $LocalPath
+ $LocalEtcPath
+ $LocalLibPath
+ $LocalLexiconPath
+ $LocalPluginPath
+ $MasonComponentRoot
+ $MasonLocalComponentRoot
+ $MasonDataDir
+ $MasonSessionDir);
+
+
+RT->LoadGeneratedData();
=head1 NAME
@@ -142,7 +124,7 @@ sub LoadConfig {
unless ( File::Spec->file_name_is_absolute( $gpgopts->{homedir} ) ) {
$gpgopts->{homedir} = File::Spec->catfile( $BasePath, $gpgopts->{homedir} );
}
-
+
return $Config;
}
@@ -163,7 +145,7 @@ sub Init {
ConnectToDatabase();
InitSystemObjects();
InitClasses();
- InitLogging();
+ InitLogging();
InitPlugins();
RT::I18N->Init;
RT->Config->PostLoadCheck;
@@ -205,7 +187,7 @@ sub InitLogging {
warning => 3,
error => 4, 'err' => 4,
critical => 5, crit => 5,
- alert => 6,
+ alert => 6,
emergency => 7, emerg => 7,
);
@@ -262,7 +244,7 @@ sub InitLogging {
no warnings;
my %p = @_;
return $p{'message'} unless $level_to_num{ $p{'level'} } >= $stack_from_level;
-
+
require Devel::StackTrace;
my $trace = Devel::StackTrace->new( ignore_class => [ 'Log::Dispatch', 'Log::Dispatch::Base' ] );
return $p{'message'} . $trace->as_string;
@@ -364,7 +346,7 @@ sub InitSignalHandlers {
sub CheckPerlRequirements {
if ($^V < 5.008003) {
- die sprintf "RT requires Perl v5.8.3 or newer. Your current Perl is v%vd\n", $^V;
+ die sprintf "RT requires Perl v5.8.3 or newer. Your current Perl is v%vd\n", $^V;
}
# use $error here so the following "die" can still affect the global $@
@@ -384,13 +366,13 @@ sub CheckPerlRequirements {
die <<"EOF";
RT requires the Scalar::Util module be built with support for the 'weaken'
-function.
+function.
-It is sometimes the case that operating system upgrades will replace
+It is sometimes the case that operating system upgrades will replace
a working Scalar::Util with a non-working one. If your system was working
correctly up until now, this is likely the cause of the problem.
-Please reinstall Scalar::Util, being careful to let it build with your C
+Please reinstall Scalar::Util, being careful to let it build with your C
compiler. Ususally this is as simple as running the following command as
root.
@@ -660,7 +642,16 @@ sub InstallMode {
return $_INSTALL_MODE;
}
-sub CanonicalizePaths {
+sub LoadGeneratedData {
+ my $class = shift;
+ my $pm_path = ( File::Spec->splitpath( $INC{'RT.pm'} ) )[1];
+
+ require "$pm_path/RT/Generated.pm" || die "Couldn't load RT::Generated: $@";
+ $class->CanonicalizeGeneratedPaths();
+}
+
+sub CanonicalizeGeneratedPaths {
+ my $class = shift;
unless ( File::Spec->file_name_is_absolute($EtcPath) ) {
# if BasePath exists and is absolute, we won't infer it from $INC{'RT.pm'}.
diff --git a/lib/RT/Generated.pm.in b/lib/RT/Generated.pm.in
new file mode 100644
index 0000000..809fc3e
--- /dev/null
+++ b/lib/RT/Generated.pm.in
@@ -0,0 +1,33 @@
+package RT;
+use warnings;
+use strict;
+
+our $VERSION = '@RT_VERSION_MAJOR at .@RT_VERSION_MINOR at .@RT_VERSION_PATCH@';
+
+ at DATABASE_ENV_PREF@
+
+$BasePath = '@RT_PATH@';
+$EtcPath = '@RT_ETC_PATH@';
+$BinPath = '@RT_BIN_PATH@';
+$SbinPath = '@RT_SBIN_PATH@';
+$VarPath = '@RT_VAR_PATH@';
+$LexiconPath = '@RT_LEXICON_PATH@';
+$PluginPath = '@RT_PLUGIN_PATH@';
+$LocalPath = '@RT_LOCAL_PATH@';
+$LocalEtcPath = '@LOCAL_ETC_PATH@';
+$LocalLibPath = '@LOCAL_LIB_PATH@';
+$LocalLexiconPath = '@LOCAL_LEXICON_PATH@';
+$LocalPluginPath = $LocalPath."/plugins";
+# $MasonComponentRoot is where your rt instance keeps its mason html files
+$MasonComponentRoot = '@MASON_HTML_PATH@';
+# $MasonLocalComponentRoot is where your rt instance keeps its site-local
+# mason html files.
+$MasonLocalComponentRoot = '@MASON_LOCAL_HTML_PATH@';
+# $MasonDataDir Where mason keeps its datafiles
+$MasonDataDir = '@MASON_DATA_PATH@';
+# RT needs to put session data (for preserving state between connections
+# via the web interface)
+$MasonSessionDir = '@MASON_SESSION_PATH@';
+
+
+1;
commit 6b7a0c41f41bf36f0e4ce0e013c72bfbcc60c54e
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Oct 19 15:21:24 2010 +0900
warnings avoidance
diff --git a/share/html/Admin/Elements/QueueTabs b/share/html/Admin/Elements/QueueTabs
index 610198f..88b62ee 100755
--- a/share/html/Admin/Elements/QueueTabs
+++ b/share/html/Admin/Elements/QueueTabs
@@ -117,7 +117,7 @@ foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) {
$QueueObj => undef
$id => undef
$subtabs => undef
-$current_subtab => undef
-$current_tab => undef
+$current_subtab => ''
+$current_tab => ''
$Title => undef
</%ARGS>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list