Skip to content

Commit

Permalink
Item12952: various bugs highlighted during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
crawford committed Aug 29, 2014
1 parent d8efdfa commit 6ace650
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
26 changes: 17 additions & 9 deletions core/lib/Foswiki/Configure/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,26 @@ $item is passed on to the checker's constructor.

sub loadChecker {
my ($item) = @_;
my $id;

ASSERT( $item && $item->{keys} ) if DEBUG;
if ( $item->{CHECKER} ) {

# Convert {key}{s} to key::s, removing illegal characters
# [-_\w] are legal. - => _.
my $id = $item->{keys};
# Checker override
$id = $item->{CHECKER};
}
else {
ASSERT( $item && $item->{keys} ) if DEBUG;

$id =~ s{\{([^\}]*)\}}{
my $lbl = $1;
$lbl =~ tr,-_a-zA-Z0-9\x00-\xff,__a-zA-Z0-9,d;
$lbl . '::'}ge
and substr( $id, -2 ) = '';
# Convert {key}{s} to key::s, removing illegal characters
# [-_\w] are legal. - => _.
$id = $item->{keys};

$id =~ s{\{([^\}]*)\}}{
my $lbl = $1;
$lbl =~ tr,-_a-zA-Z0-9\x00-\xff,__a-zA-Z0-9,d;
$lbl . '::'}ge
and substr( $id, -2 ) = '';
}

my $checkClass = 'Foswiki::Configure::Checkers::' . $id;
my @packages = Foswiki::Configure::FileUtil::findPackages($checkClass);
Expand Down
12 changes: 7 additions & 5 deletions core/lib/Foswiki/Configure/Checkers/ExtensionsRepositories.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ use strict;
use warnings;

require Foswiki::Configure::Checker;
our @ISA = ( 'Foswiki::Configure::Checker' );
our @ISA = ('Foswiki::Configure::Checker');

use Foswiki::Configure::Checkers::URL ();

# Checks the Extensions repository list.
# Syntax:
# list := repospec[;repospec...]
# repospec := name=(listurl,puburl[,username,password])
sub check_current_value {
my ($this, $reporter) = @_;
my ( $this, $reporter ) = @_;

my $keys = $this->{item}->{keys};

Expand All @@ -30,16 +32,16 @@ sub check_current_value {
while ( $replist =~ s/^\s*([^=;]+)=\(([^)]*)\)\s*// ) {
my ( $name, $value ) = ( $1, $2 );
if ( $value =~
/^([a-z]+:[^,]+),\s*([a-z]+:[^,]+)(?:,\s*([^,]*),\s*(.*))?$/ )
/^([a-z]+:[^,]+),\s*([a-z]+:[^,]+)(?:,\s*([^,]*),\s*(.*))?$/ )
{
push @list,
{
{
name => $name,
data => $1,
pub => $2,
user => $3,
pass => $4
};
};
}
else {
$reporter->ERROR("Syntax error in list at $value)$replist");
Expand Down
6 changes: 4 additions & 2 deletions core/lib/Foswiki/Configure/Pluggables/PLUGINS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ sub construct {
push(
@$settings,
Foswiki::Configure::Value->new(
'PLUGIN_ENABLED',
'BOOLEAN',
keys => "{Plugins}{$plugin}{Enabled}",
CHECKER => 'PLUGIN_MODULE',
default => '0', # Not enabled
EXPERT => $expert{$plugin}
)
);
push(
@$settings,
Foswiki::Configure::Value->new(
'PLUGIN_MODULE',
'STRING',
checker => 'PLUGIN_MODULE',
keys => "{Plugins}{$plugin}{Module}",
default => "'$modules{$plugin}'",
EXPERT => 1
Expand Down
1 change: 1 addition & 0 deletions core/lib/Foswiki/Configure/Value.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ use Foswiki::Configure::FileUtil ();
use constant ATTRSPEC => {
FEEDBACK => { parse_val => '_FEEDBACK' },
CHECK => { parse_val => '_CHECK' },
CHECKER => {},
MANDATORY => {},
MULTIPLE => {}, # Allow multiple select
HIDDEN => {},
Expand Down
1 change: 0 additions & 1 deletion core/lib/Foswiki/Contrib/core/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ lib/Foswiki/Configure/Checkers/OS.pm 0444
lib/Foswiki/Configure/Checkers/PasswordManager.pm 0444
lib/Foswiki/Configure/Checkers/PATH.pm 0444
lib/Foswiki/Configure/Checkers/PERL.pm 0444
lib/Foswiki/Configure/Checkers/PLUGIN_ENABLED.pm 0444
lib/Foswiki/Configure/Checkers/PLUGIN_MODULE.pm 0444
lib/Foswiki/Configure/Checkers/PluginsOrder.pm 0444
lib/Foswiki/Configure/Checkers/REGEX.pm 0444
Expand Down

0 comments on commit 6ace650

Please sign in to comment.