Skip to content

Commit

Permalink
Item12180: Now that they're visible, make BasicSanity's messages cons…
Browse files Browse the repository at this point in the history
…istent and readable.

git-svn-id: http://svn.foswiki.org/trunk@15887 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Nov 4, 2012
1 parent 52a4c6b commit bfc1fbf
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions core/lib/Foswiki/Configure/Checkers/BasicSanity.pm
Expand Up @@ -79,47 +79,46 @@ sub check {
if ( !$this->{LocalSiteDotCfg} ) { if ( !$this->{LocalSiteDotCfg} ) {
$this->{errors}++; $this->{errors}++;
$result .= <<HERE; $result .= <<HERE;
Could not find where LocalSite.cfg is supposed to go. Could not find where <code>LocalSite.cfg</code> is supposed to go.
Edit your LocalLib.cfg and set \$twikiLibPath to point to the 'lib' directory <p>Edit <tt>LocalLib.cfg</tt> and set <tt>\$twikiLibPath</tt> to point to the 'lib' directory of your installation.
for your install. <p>Please correct this error before continuing.
Please correct this error before continuing.
HERE HERE
} }
elsif ( -e $this->{LocalSiteDotCfg} ) { elsif ( -e $this->{LocalSiteDotCfg} ) {
eval { Foswiki::Configure::Load::readConfig( 1, 1 ); }; # Don't expand or re-read Foswiki.spec. eval { Foswiki::Configure::Load::readConfig( 1, 1 ); }; # Don't expand or re-read Foswiki.spec.
if ($@) { if ($@) {
$this->{errors}++; $this->{errors}++;
$result .= <<HERE; $result .= <<HERE;
Existing configuration file has a problem Existing configuration file <tt>$this->{LocalSiteDotCfg}</tt> has a problem
that is causing a Perl error - the following message(s) was generated: that is causing a Perl error. The following message(s) was generated:
<pre>$@</pre> <pre>$@</pre>
<b>You can continue, but configure will not pick up any of the existing <p>You can continue, but configure will not pick up any of the existing
settings from this file and your previous configuration will be lost.</b> settings from this file and your previous configuration will be lost.</b>
Manually edit and correct your <tt>$this->{LocalSiteDotCfg}</tt> file if you <p>Manually edit and correct <tt>$this->{LocalSiteDotCfg}</tt> file if you
wish to preserve your prior configuration. wish to preserve the prior configuration.
HERE HERE
$this->{badLSC} = 1; $this->{badLSC} = 1;
} }
elsif ( !-w $this->{LocalSiteDotCfg} ) { elsif ( !-w $this->{LocalSiteDotCfg} ) {
$this->{errors}++; $this->{errors}++;
$result .= <<HERE; $result .= <<HERE;
Cannot write to existing configuration file Cannot write to existing configuration file.
$this->{LocalSiteDotCfg} is not writable. <p><tt>$this->{LocalSiteDotCfg}</tt> is not writable.
You can view the configuration, but you will not be able to save. <p>You can view the configuration, but you will not be able to save changes.
Check the file permissions. Please check the file and directory permissions.
HERE HERE
} }
elsif ( ( my $mess = $this->_checkCfg( \%Foswiki::cfg ) ) ) { elsif ( ( my $mess = $this->_checkCfg( \%Foswiki::cfg ) ) ) {
$this->{errors}++; $this->{errors}++;
$result .= <<HERE; $result .= <<HERE;
The existing configuration file The existing configuration file
$this->{LocalSiteDotCfg} doesn't seem to contain a good configuration <tt>$this->{LocalSiteDotCfg}</tt> doesn't seem to contain a good configuration
for Foswiki. The following problems were found:<br> for Foswiki. The following problems were found:<br>
$mess $mess
<b>You can continue, but configure will not pick up any of the existing <p><b>You can continue, but configure will not pick up any of the existing
settings from this file and your previous configuration will be lost.</b> settings from this file and the previous configuration will be lost.</b>
Manually edit and correct your <tt>$this->{LocalSiteDotCfg}</tt> file if you <p>Manually edit and correct <tt>$this->{LocalSiteDotCfg}</tt> file if you
wish to preserve your prior configuration. wish to preserve the prior configuration.
HERE HERE
} }


Expand All @@ -132,16 +131,16 @@ HERE
if ($errs) { if ($errs) {
$this->{errors}++; $this->{errors}++;
$result .= <<HERE; $result .= <<HERE;
Configuration file $this->{LocalSiteDotCfg} does not exist, and I cannot Configuration file <tt>$this->{LocalSiteDotCfg}</tt> does not exist, and I cannot
write a new configuration file due to these errors: write a new configuration file due to these errors:
<pre/>$errs<pre> <pre/>$errs<pre>
You can view the default configuration, but you will not be able to save. <p>You can view the default configuration, but you will not be able to save changes.
HERE HERE
$this->{badLSC} = 1; $this->{badLSC} = 1;
} }
else { else {
$result .= <<HERE; $result .= <<HERE;
Could not find existing configuration file <code>$this->{LocalSiteDotCfg}</code>. Could not find existing configuration file <tt>$this->{LocalSiteDotCfg}</tt>.
HERE HERE
$this->{badLSC} = 1; $this->{badLSC} = 1;
} }
Expand Down

0 comments on commit bfc1fbf

Please sign in to comment.