Skip to content

Commit

Permalink
Item12180: Compact and clarify error messages
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@16253 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Dec 21, 2012
1 parent 1352389 commit 5e31b9e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions core/lib/Foswiki/Configure/Checkers/ScriptDir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,24 @@ Cannot open '$dir' for read ($!) - check it exists, and that permissions are cor
HERE
}
foreach my $script ( grep { -f "$dir/$_" && /^\w+(\.\w+)?$/ } readdir D ) {
my $err = '';

# If a script suffix is set, make sure all scripts have one
if ( $ext
&& $script !~ /$ext$/
&& $script !~ /\.cfg$/ )
{
$errs .= $this->WARN(<<HERE);
$script appears to be missing the configured script suffix - please check it.
$err .= <<HERE;
<li>is missing the configured script suffix ($ext).\n
HERE
}
if ( !$ext
&& $script =~ /(\..*)$/
&& $script !~ /\.cfg$/
&& $script !~ /\.fcgi$/ )
{
$errs .= $this->WARN(<<HERE);
$script appears to have a suffix ($1), no script suffix is configured - please check it.
$err .= <<HERE;
<li>has a suffix ($1), but no script suffix is configured.\n
HERE
}

Expand All @@ -67,11 +68,13 @@ HERE
&& $script !~ /\.cfg$/
&& !-x "$dir/$script" )
{
$errs .= $this->WARN(<<HERE);
$script might not be an executable script - please check it (and its
permissions) manually.
$err .= <<HERE;
<li>permissions do not include eXecute. It might not be an executable script.\n
HERE
}
if ($err) {
$errs .= $this->WARN("$script:<ul>$err</ul>");
}
}
closedir(D);
return $errs;
Expand Down

0 comments on commit 5e31b9e

Please sign in to comment.