Index: testenv
===================================================================
--- testenv (revision 3880)
+++ testenv (working copy)
@@ -33,6 +33,7 @@
my $brokenTWikiCfg;
+my $brokenLocalSiteCfg;
BEGIN {
# Set default current working directory
@@ -49,7 +50,6 @@
unshift @INC, '../lib';
$setlibAvail = 0;
}
-
if( $OS ) {
$cfg{DetailedOS} = $detailedOS;
$cfg{OS} = $OS;
@@ -80,6 +80,14 @@
# Read the configuration file now in order to set locale;
# includes checking for broken syntax etc. Need 'require'
# to get the $!/$@ to work.
+ $brokenLocalSiteCfg = 0;
+ unless( eval 'require "LocalSite.cfg" ' ){ # Includes OS detection
+ # Capture the Perl error(s)
+ $brokenLocalSiteCfg = 1;
+ $brokenLocalSiteError =
+ ( $! ? "$!\n" : '') . # $! if not readable,
+ ( $@ ? "$@\n" : ''); # $@ if not compileable
+ }
$brokenTWikiCfg = 0;
unless( eval 'require "TWiki.cfg" ' ){ # Includes OS detection
# Capture the Perl error(s)
@@ -289,7 +297,18 @@
print $query->end_html();
exit;
}
+if ($brokenLocalSiteCfg) {
+ $brokenLocalSiteError =~ s!\n!
\n!sg; # Format properly
+ print $query->h3("Configuration error");
+ print "WARNING: ";
+ print "LocalSite.cfg is unreadable or has a configuration problem that is causing a Perl error - the following message(s) relate to TWiki.cfg and should help locate the problem.