Skip to content

Commit

Permalink
Item13954: fix spurious error message. Was cosmetic, as analysis surm…
Browse files Browse the repository at this point in the history
…ised.
  • Loading branch information
cdot committed Apr 27, 2017
1 parent 7c88a07 commit a564f13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions core/lib/Foswiki/Configure/LoadSpec.pm
Expand Up @@ -235,15 +235,17 @@ sub _getValueObject {

=begin TML
---++ StaticMethod parse($file, $root, $reporter)
---++ StaticMethod parse($file, $root, $reporter [, $cant_enhance])
Parse the config declaration file and add it to a root node for the
configuration it describes
Parse the config declaration $file and add it to a $root node for the
configuration it describes. If $cant_enhance, don't report ENHANCE
failures (which may be due to a missing root spec; which is OK when
installing a package)
=cut

sub parse {
my ( $file, $root, $reporter ) = @_;
my ( $file, $root, $reporter, $cant_enhance ) = @_;
my $fh;

unless ( open( $fh, '<', $file ) ) {
Expand Down Expand Up @@ -297,8 +299,9 @@ sub parse {

# Enhance an existing value
$open = $root->getValueObject($2);
$reporter->ERROR("$context: No such value $2")
unless $open;
unless ( $open || $cant_enhance ) {
$reporter->ERROR("$context: No such value $2");
}
$isEnhancing = $open ? 1 : 0;
$reporter->NOTE("\tEnhancing $open->{keys}")
if TRACE && $open;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Configure/Package.pm
Expand Up @@ -1026,7 +1026,7 @@ sub _install {

# Pick up all Config.spec's
if ( $file =~ m/\/Config.spec$/ && !$this->option('SIMULATE') ) {
Foswiki::Configure::LoadSpec::parse( $target, $spec, $reporter );
Foswiki::Configure::LoadSpec::parse( $target, $spec, $reporter, 1 );
if ($rootspec) {

# Also load it into the rootspec, so the caller has
Expand Down

0 comments on commit a564f13

Please sign in to comment.