[Rt-commit] r7254 - in rt/branches/3.6-RELEASE: .
jesse at bestpractical.com
jesse at bestpractical.com
Thu Mar 15 18:52:22 EDT 2007
Author: jesse
Date: Thu Mar 15 18:52:21 2007
New Revision: 7254
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT.pm.in
Log:
r53492 at 124: jesse | 2007-03-15 18:52:01 -0400
* RT now complains when you try to start the application server with
either too-old a perl or a broken version of Scalar::Util.
Modified: rt/branches/3.6-RELEASE/lib/RT.pm.in
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT.pm.in (original)
+++ rt/branches/3.6-RELEASE/lib/RT.pm.in Thu Mar 15 18:52:21 2007
@@ -130,12 +130,21 @@
my $username = getpwuid($>);
my $group = getgrgid($();
- my $message = qq{Couldn't load RT config file %s as user $username / group $group.
-The file is owned by user %s and group %s.
-This usually means that the user/group your webserver is running as cannot read the file.
-Be careful not to make the permissions on this file too liberal, because it contains database
-passwords. You may need to put the webserver user in the appropriate group (%s) or change
-permissions be able to run succesfully};
+ my $message = <<EOF;
+
+RT couldn't load RT config file %s as:
+ user: $username
+ group: $group
+
+The file is owned by user %s and group %s.
+
+This usually means that the user/group your webserver is running
+as cannot read the file. Be careful not to make the permissions
+on this file too liberal, because it contains database passwords.
+You may need to put the webserver user in the appropriate group
+(%s) or change permissions be able to run succesfully.
+EOF
+
if ( -f "$SITE_CONFIG_FILE" ) {
eval { require $SITE_CONFIG_FILE };
@@ -173,6 +182,8 @@
sub Init {
+ CheckPerlRequirements();
+
#Get a database connection
ConnectToDatabase();
@@ -352,6 +363,40 @@
}
+
+sub CheckPerlRequirements {
+ if ($^V < 5.008003) {
+ die sprintf "RT requires Perl v5.8.3 or newer. Your current Perl is v%vd\n", $^V;
+ }
+
+ local ($@);
+ eval {
+ my $x = '';
+ my $y = \$x;
+ require Scalar::Util; Scalar::Util::weaken($y);
+ };
+ if ($@) {
+ die <<"EOF";
+
+RT requires the Scalar::Util module be built with support for the 'weaken'
+function.
+
+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
+compiler. Ususally this is as simple as running the following command as
+root.
+
+ perl -MCPAN -e'install Scalar::Util'
+
+EOF
+
+ }
+}
+
+
=head2 InitClasses
Load all modules that define base classes
More information about the Rt-commit
mailing list