Rationalize VERSION

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5664 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-24 18:11:32 +00:00
parent b7d0299a6d
commit 5890e5ddb5
2 changed files with 18 additions and 19 deletions

View File

@ -32,6 +32,15 @@ our @EXPORT = qw(find_file get_configuration report_capabilities propagateconfig
our @EXPORT_OK = ();
our @VERSION = 1.00;
#
# Misc Globals
#
our %env = ( SHAREDIR => '/usr/share/shorewall' ,
CONFDIR => '/etc/shorewall',
LOGPARMS => '',
VERSION => '3.9.0-1',
);
#
# From shorewall.conf file
#
@ -123,14 +132,6 @@ my @propagateconfig = qw/ CLEAR_TC DISABLE_IPV6 ADMINISABSENTMINDED IP_FORWARDIN
my @propagateenv = qw/ LOGLIMIT LOGTAGONLY LOGRULENUMBERS /;
# Misc Globals
#
our %env = ( SHAREDIR => '/usr/share/shorewall' ,
CONFDIR => '/etc/shorewall',
LOGPARMS => '',
VERSION => '3.9.0',
);
#
# From parsing the capabilities file
#
@ -375,11 +376,11 @@ sub get_configuration() {
default_yes_no 'RFC1918_STRICT' , '';
default_yes_no 'SAVE_IPSETS' , '';
warning_message 'SAVE_IPSETS=Yes is not supported by Shorewall4 ' . VERSION if $config{SAVE_IPSETS};
warning_message 'SAVE_IPSETS=Yes is not supported by Shorewall4 ' . $env{VERSION} if $config{SAVE_IPSETS};
default_yes_no 'MAPOLDACTIONS' , '';
warning_message 'MAPOLDACTIONS=Yes is not supported by Shorewall4 ' . VERSION if $config{MAPOLDACTIONS};
warning_message 'MAPOLDACTIONS=Yes is not supported by Shorewall4 ' . $env{VERSION} if $config{MAPOLDACTIONS};
default_yes_no 'FASTACCEPT' , '';
default_yes_no 'IMPLICIT_CONTINUE' , '';
@ -570,7 +571,7 @@ sub generate_aux_config() {
create_temp_aux_config;
emit( "#\n# Shorewall auxiliary configuration file created by Shorewall4 version " . VERSION . ' - ' . localtime . "\n#" );
emit( "#\n# Shorewall auxiliary configuration file created by Shorewall4 version " . $env{VERSION} . ' - ' . ( localtime ) . "\n#" );
for my $option qw(VERBOSITY LOGFILE LOGFORMAT IPTABLES PATH SHOREWALL_SHELL SUBSYSLOCK RESTOREFILE SAVE_IPSETS) {
conditionally_add_option $option;

View File

@ -59,14 +59,12 @@ use Shorewall::Rules;
use Shorewall::Proc;
use Shorewall::Proxyarp;
use constant { VERSION => '3.9.0-1' };
sub generate_script_1 {
copy '/usr/share/shorewall4/prog.header';
my $date = localtime;
emit( "#\n# Compiled firewall script generated by Shorewall " . VERSION . " - $date\n#" );
emit( "#\n# Compiled firewall script generated by Shorewall " . $env{VERSION} . " - $date\n#" );
if ( $ENV{EXPORT} ) {
emit 'SHAREDIR=/usr/share/shorewall-lite';
@ -131,7 +129,7 @@ sub generate_script_1 {
emit '[ -n "${VERBOSE:=0}" ]';
emit '[ -n "${RESTOREFILE:=$RESTOREFILE}" ]';
emit '[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:%s:%s:"';
emit( 'VERSION="' . VERSION . '"' );
emit( 'VERSION="' . $env{VERSION} . '"' );
emit "PATH=\"$config{PATH}\"";
emit 'TERMINATOR=fatal_error';
@ -595,13 +593,13 @@ sub compile_firewall( $ ) {
report_capabilities if $ENV{VERBOSE} > 1;
fatal_error( 'Shorewall4 ' . VERSION . ' requires Conntrack Match Support' )
fatal_error( 'Shorewall4 ' . $env{VERSION} . ' requires Conntrack Match Support' )
unless $capabilities{CONNTRACK_MATCH};
fatal_error( 'Shorewall4 ' . VERSION . ' requires Extended Multi-port Match Support' )
fatal_error( 'Shorewall4 ' . $env{VERSION} . ' requires Extended Multi-port Match Support' )
unless $capabilities{XMULTIPORT};
fatal_error( 'Shorewall4 ' . VERSION . ' requires Address Type Match Support' )
fatal_error( 'Shorewall4 ' . $env{VERSION} . ' requires Address Type Match Support' )
unless $capabilities{ADDRTYPE};
fatal_error 'BRIDGING=Yes is not supported by the ' . VERSION . ' Perl-based compiler'
fatal_error 'BRIDGING=Yes is not supported by the ' . $env{VERSION} . ' Perl-based compiler'
if $config{BRIDGING};
fatal_error 'MACLIST_TTL requires the Recent Match capability which is not present in your Kernel and/or iptables'
if $config{MACLIST_TTL} && ! $capabilities{RECENT_MATCH};