From 944651e46d54dff80324bb2bbbd71389ca1bd711 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 7 Mar 2017 11:51:40 -0800 Subject: [PATCH] Correct compiler directives WRT omitting Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 86 +++++++++++++++++------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 60798895c..7b010c1aa 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2995,58 +2995,70 @@ sub process_compiler_directive( $$$$ ) { } , ERROR => sub() { - directive_error( evaluate_expression( $expression , - $filename , - $linenumber , - 1 ) , - $filename , - $linenumber ) unless $omitting; + unless ( $omitting ) { + directive_error( evaluate_expression( $expression , + $filename , + $linenumber , + 1 ) , + $filename , + $linenumber ) unless $omitting; + } } , WARNING => sub() { - directive_warning( $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $filename , - $linenumber ) unless $omitting; + unless ( $omitting ) { + directive_warning( $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $filename , + $linenumber ) unless $omitting; + } } , INFO => sub() { - directive_info( $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $filename , - $linenumber ) unless $omitting; + unless ( $omitting ) { + directive_info( $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $filename , + $linenumber ) unless $omitting; + } } , 'WARNING!' => sub() { - directive_warning( ! $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $filename , - $linenumber ) unless $omitting; + unless ( $omitting ) { + directive_warning( ! $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $filename , + $linenumber ) unless $omitting; + } } , 'INFO!' => sub() { - directive_info( ! $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $filename , - $linenumber ) unless $omitting; + unless ( $omitting ) { + directive_info( ! $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $filename , + $linenumber ) unless $omitting; + } } , REQUIRE => sub() { - fatal_error "?REQUIRE may only be used within action files" unless $actparams{0}; - fatal_error "Unknown capability ($expression}" unless $capabilities{$expression}; - require_capability( $expression, "The $actparams{action} action", 's' ); + unless ( $omitting ) { + fatal_error "?REQUIRE may only be used within action files" unless $actparams{0}; + fatal_error "Unknown capability ($expression)" unless exists $capabilities{$expression}; + require_capability( $expression, "The $actparams{action} action", 's' ); + } } , );