From 0dc4cd7937f7a398f7d0c5b489308e20d6e8f238 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 9 Jan 2011 12:14:48 -0800 Subject: [PATCH] Don't quote param values unnecessarily; add a comment to the emitted params --- Shorewall/Perl/Shorewall/Config.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index c876bd473..c37eb4043 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -98,12 +98,12 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script pop_open push_params pop_params - export_params read_a_line validate_level which qt ensure_config_path + export_params get_configuration require_capability have_capability @@ -3040,6 +3040,8 @@ sub export_params() { FW => 1, CONFDIR => 1 ); + my $count = 0; + while ( my ( $param, $value ) = each %params ) { next if $exclude{$param}; # @@ -3048,9 +3050,17 @@ sub export_params() { if ( exists $ENV{$param} && defined $ENV{$param} ) { next if $value eq $ENV{$param}; } - - emit "$param='$value'"; + + emit "#\n# From the params file\n#" unless $count++; + + if ( $value =~ /\s/ ) { + emit "$param='$value'"; + } else { + emit "$param=$value"; + } } + + emit '' if $count; } #