Give the compiler it's own VERSION

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5614 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-21 19:46:44 +00:00
parent a00469db88
commit 8ca5af9f5a
2 changed files with 8 additions and 6 deletions

View File

@ -1254,7 +1254,7 @@ sub create_netfilter_load() {
} }
emit '__EOF__'; emit '__EOF__';
emit '';
emit 'if [ $? != 0 ]; then'; emit 'if [ $? != 0 ]; then';
emit ' fatal_error "iptables-restore Failed"'; emit ' fatal_error "iptables-restore Failed"';
emit "fi\n"; emit "fi\n";

View File

@ -59,12 +59,14 @@ use Shorewall::Rules;
use Shorewall::Proc; use Shorewall::Proc;
use Shorewall::Proxyarp; use Shorewall::Proxyarp;
use constant { VERSION => '3.9.0-1' };
sub generate_script_1 { sub generate_script_1 {
copy find_file 'prog.header'; copy find_file 'prog.header';
my $date = localtime; my $date = localtime;
emit "#\n# Compiled firewall script generated by Shorewall $ENV{VERSION} - $date\n#"; emit( "#\n# Compiled firewall script generated by Shorewall " . VERSION . " - $date\n#" );
if ( $ENV{EXPORT} ) { if ( $ENV{EXPORT} ) {
emit 'SHAREDIR=/usr/share/shorewall-lite'; emit 'SHAREDIR=/usr/share/shorewall-lite';
@ -128,7 +130,7 @@ sub generate_script_1 {
emit '[ -n "${VERBOSE:=0}" ]'; emit '[ -n "${VERBOSE:=0}" ]';
emit '[ -n "${RESTOREFILE:=$RESTOREFILE}" ]'; emit '[ -n "${RESTOREFILE:=$RESTOREFILE}" ]';
emit '[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:%s:%s:"'; emit '[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:%s:%s:"';
emit "VERSION=\"$ENV{VERSION}\""; emit( 'VERSION="' . VERSION . '"' );
emit "PATH=\"$config{PATH}\""; emit "PATH=\"$config{PATH}\"";
emit 'TERMINATOR=fatal_error'; emit 'TERMINATOR=fatal_error';
@ -564,11 +566,11 @@ sub compile_firewall( $ ) {
report_capabilities if $ENV{VERBOSE} > 1; report_capabilities if $ENV{VERBOSE} > 1;
fatal_error "Shorewall $ENV{VERSION} requires Conntrack Match Support" fatal_error( 'Shorewall ' . VERSION . ' requires Conntrack Match Support' )
unless $capabilities{CONNTRACK_MATCH}; unless $capabilities{CONNTRACK_MATCH};
fatal_error "Shorewall $ENV{VERSION} requires Extended Multi-port Match Support" fatal_error( 'Shorewall ' . VERSION . ' requires Extended Multi-port Match Support' )
unless $capabilities{XMULTIPORT}; unless $capabilities{XMULTIPORT};
fatal_error "Shorewall $ENV{VERSION} requires Address Type Match Support" fatal_error( 'Shorewall ' . VERSION . ' requires Address Type Match Support' )
unless $capabilities{ADDRTYPE}; unless $capabilities{ADDRTYPE};
fatal_error 'BRIDGING=Yes requires Physdev Match support in your Kernel and iptables' fatal_error 'BRIDGING=Yes requires Physdev Match support in your Kernel and iptables'
if $config{BRIDGING} && ! $capabilities{PHYSDEV_MATCH}; if $config{BRIDGING} && ! $capabilities{PHYSDEV_MATCH};