diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index d008aa227..ddc3f983f 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -523,8 +523,8 @@ EOF # sub compiler { - my ( $scriptfilename, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity, $preview, $confess , $upgrade , $annotate ) = - ( '', '', -1, '', 0, '', '', -1, 0, 0, 0, 0, ); + my ( $scriptfilename, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity, $preview, $confess , $update , $annotate ) = + ( '', '', -1, '', 0, '', '', -1, 0, 0, 0, 0, ); $export = 0; $test = 0; @@ -558,7 +558,7 @@ sub compiler { test => { store => \$test }, preview => { store => \$preview, validate=> \&validate_boolean } , confess => { store => \$confess, validate=> \&validate_boolean } , - upgrade => { store => \$upgrade, validate=> \&validate_boolean } , + update => { store => \$update, validate=> \&validate_boolean } , annotate => { store => \$annotate, validate=> \&validate_boolean } , ); # @@ -891,9 +891,9 @@ sub compiler { } # - # Upgrade the configuration file if requested + # Update the configuration file if requested # - upgrade_config_file( $annotate ) if $upgrade; + update_config_file( $annotate ) if $update; if ( $family == F_IPV4 ) { progress_message3 "Shorewall configuration verified"; diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 0f667f8da..96b5a374a 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -121,7 +121,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script run_user_exit1 run_user_exit2 generate_aux_config - upgrade_config_file + update_config_file $product $Product @@ -209,7 +209,7 @@ our %globals; # our %config; # -# Raw values from shorewall.conf - used to upgrade the config file +# Raw values from shorewall.conf - used to update the config file # my %rawconfig; # @@ -3792,9 +3792,9 @@ sub generate_aux_config() { } # -# Upgrade the configuration file +# Update the configuration file # -sub upgrade_config_file( $ ) { +sub update_config_file( $ ) { my $annotate = shift; my $fn = $annotate ? "$globals{SHAREDIR}/configfiles/${product}.conf.annotated" : "$globals{SHAREDIR}/configfiles/${product}.conf"; @@ -3813,9 +3813,9 @@ sub upgrade_config_file( $ ) { my ( $template, $output ); open $template, '<' , $fn or fatal_error "Unable to open $fn: $!"; - unless ( open $output, '>', "$configfile.upgraded" ) { + unless ( open $output, '>', "$configfile.updated" ) { close $template; - fatal_error "Unable to open $configfile.upgraded for output: $!"; + fatal_error "Unable to open $configfile.updated for output: $!"; } while ( <$template> ) { @@ -3904,11 +3904,11 @@ sub upgrade_config_file( $ ) { close $output; - fatal_error "Can't rename $configfile to $configfile.bak: $!" unless rename $configfile, "$configfile.bak"; - fatal_error "Can't rename $configfile.upgraded to $configfile: $!" unless rename "$configfile.upgraded", $configfile; + fatal_error "Can't rename $configfile to $configfile.bak: $!" unless rename $configfile, "$configfile.bak"; + fatal_error "Can't rename $configfile.updated to $configfile: $!" unless rename "$configfile.updated", $configfile; - progress_message3 "Configuration file $configfile upgraded - old file renamed $configfile.bak"; + progress_message3 "Configuration file $configfile updated - old file renamed $configfile.bak"; } else { fatal_error "$fn does not exist"; } diff --git a/Shorewall/Perl/compiler.pl b/Shorewall/Perl/compiler.pl index eba63b933..0e599eb92 100755 --- a/Shorewall/Perl/compiler.pl +++ b/Shorewall/Perl/compiler.pl @@ -62,7 +62,7 @@ sub usage( $ ) { [ --preview ] [ --family={4|6} ] [ --annotate ] - [ --upgrade ] + [ --updatee ] '; exit shift @_; @@ -85,7 +85,7 @@ my $test = 0; my $family = 4; # F_IPV4 my $preview = 0; my $annotate = 0; -my $upgrade = 0; +my $update = 0; Getopt::Long::Configure ('bundling'); @@ -113,8 +113,8 @@ my $result = GetOptions('h' => \$help, 'confess' => \$confess, 'a' => \$annotate, 'annotate' => \$annotate, - 'u' => \$upgrade, - 'upgrade' => \$upgrade, + 'u' => \$update, + 'update' => \$update, ); usage(1) unless $result && @ARGV < 2; @@ -133,6 +133,6 @@ compiler( script => $ARGV[0] || '', preview => $preview, family => $family, confess => $confess, - upgrade => $upgrade, + update => $update, annotate => $annotate, ); diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 043ca8721..01380e724 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -1,6 +1,6 @@ Changes in Shorewall 4.4.21 Beta 2 -1) Implement the 'upgrade' command. +1) Implement the 'update' command. Changes in Shorewall 4.4.21 Beta 1 diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index beb744ace..d385239b6 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -80,9 +80,9 @@ None. DROP_DEFAULT=Drop(-,DROP) -4) An 'upgrade' command has been added that validates the - configuration and then upgrades the shorewall.conf - (shorewall6.conf) file. The upgraded file will set any new options +4) An 'update' command has been added that validates the + configuration and then updates the shorewall.conf + (shorewall6.conf) file. The updated file will set any new options with their default values and will move any deprecated options with non-default values to a 'deprecated options' section at the end of the file. Each such deprecated option will generate a warning @@ -91,8 +91,8 @@ None. Your original shorewall.conf (shorewall6.conf) file will be saved as shorewall.conf.bak (shorewall6.conf.bak). - The 'upgrade' command accepts the same options as 'check' plus an - '-a' option that causes the upgraded file to be annotated with + The 'update' command accepts the same options as 'check' plus an + '-a' option that causes the updated file to be annotated with documentation. ---------------------------------------------------------------------------- diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 80d72ae07..1e4f6f1d4 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -397,7 +397,7 @@ compiler() { [ "$g_debugging" = trace ] && options="$options --debug" [ -n "$g_refreshchains" ] && options="$options --refresh=$g_refreshchains" [ -n "$g_confess" ] && options="$options --confess" - [ -n "$g_upgrade" ] && options="$options --upgrade" + [ -n "$g_updatee" ] && options="$options --update" [ -n "$g_annotate" ] && options="$options --annotate" if [ -n "$PERL" ]; then @@ -1455,7 +1455,7 @@ usage() # $1 = exit status echo " version [ -a ]" echo " safe-start [ ]" echo " safe-restart [ ]" - echo " upgrade [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ ]" + echo " update [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ ]" echo exit $1 } @@ -1538,7 +1538,7 @@ g_debug= g_export= g_refreshchains=:none: g_confess= -g_upgrade= +g_update= g_annotate= # @@ -1746,10 +1746,10 @@ case "$COMMAND" in shift check_command $@ ;; - upgrade) + update) get_config Yes shift - g_upgrade=Yes + g_update=Yes check_command $@ ;; show|list) diff --git a/Shorewall6/shorewall6 b/Shorewall6/shorewall6 index caace929d..ba5426515 100755 --- a/Shorewall6/shorewall6 +++ b/Shorewall6/shorewall6 @@ -397,7 +397,7 @@ compiler() { [ "$g_debugging" = trace ] && options="$options --debug" [ -n "$g_refreshchains" ] && options="$options --refresh=$g_refreshchains" [ -n "$g_confess" ] && options="$options --confess" - [ -n "$g_upgrade" ] && options="$options --upgrade" + [ -n "$g_update" ] && options="$options --update" [ -n "$g_annotate" ] && options="$options --annotate" [ -x $pc ] || startup_error "Shorewall6 requires the shorewall package which is not installed" @@ -1451,7 +1451,7 @@ usage() # $1 = exit status echo " version [ -a ]" echo " safe-start [ ]" echo " safe-restart [ ]" - echo " upgrade [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ ]" + echo " update [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ ]" echo exit $1 } @@ -1534,7 +1534,7 @@ g_debug= g_export= g_refreshchains=:none: g_confess= -g_upgrade= +g_update= g_annotate= # @@ -1742,10 +1742,10 @@ case "$COMMAND" in shift check_command $@ ;; - upgrade) + update) get_config Yes shift - g_upgrade=Yes + g_updatee=Yes check_command $@ ;; show|list) diff --git a/manpages/shorewall.xml b/manpages/shorewall.xml index d3aa338b6..2dbdc4053 100644 --- a/manpages/shorewall.xml +++ b/manpages/shorewall.xml @@ -626,7 +626,7 @@ -options - + @@ -762,19 +762,6 @@ The option was added in Shorewall 4.4.20 and causes a Perl stack trace to be included with each compiler-generated error and warning message. - - The option was added in Shorewall 4.4.21 - and causes the compiler to upgrade - /etc/shorewall/shorewall.conf. The upgrade will - add new options with their default values and will move deprecated - options with non-defaults to a deprecated options section at the - bottom of the file.Your existing shorewall.conf - file is renamed shorewall.conf.bak. - - The option was added in Shorewall 4.4.21 - and is only meaningful when used with . It causes - the upgraded shorewall.conf file to be - annotated with documentation. @@ -1561,19 +1548,19 @@ - upgrade + update Added in Shorewall 4.4.21 and causes the compiler to validate - the configuration and then upgrade - /etc/shorewall/shorewall.conf. The upgrade will + the configuration and then update + /etc/shorewall/shorewall.conf. The update will add new options with their default values and will move deprecated options with non-defaults to a deprecated options section at the bottom of the file. Your existing shorewall.conf file is renamed shorewall.conf.bak. - The option causes the upgraded + The option causes the updated shorewall.conf file to be annotated with documentation. diff --git a/manpages6/shorewall6.xml b/manpages6/shorewall6.xml index 9ff738ae8..7c2beb505 100644 --- a/manpages6/shorewall6.xml +++ b/manpages6/shorewall6.xml @@ -511,7 +511,7 @@ -options - + @@ -1302,19 +1302,19 @@ - upgrade + update Added in Shorewall 4.4.21 and causes the compiler to validate - the configuration and then upgrade - /etc/shorewall6/shorewall6.conf. The upgrade + the configuration and then update + /etc/shorewall6/shorewall6.conf. The update will add new options with their default values and will move deprecated options with non-defaults to a deprecated options section at the bottom of the file. Your existing shorewall6.conf file is renamed shorewall6.conf.bak. - The option causes the upgraded + The option causes the updated shorewall6.conf file to be annotated with documentation.