From 8ca5af9f5a9d73ce234012ba51f6198239434553 Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 21 Mar 2007 19:46:44 +0000 Subject: [PATCH] Give the compiler it's own VERSION git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5614 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Chains.pm | 2 +- New/compiler.pl | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/New/Shorewall/Chains.pm b/New/Shorewall/Chains.pm index 930a74dbb..065a03aad 100644 --- a/New/Shorewall/Chains.pm +++ b/New/Shorewall/Chains.pm @@ -1254,7 +1254,7 @@ sub create_netfilter_load() { } emit '__EOF__'; - + emit ''; emit 'if [ $? != 0 ]; then'; emit ' fatal_error "iptables-restore Failed"'; emit "fi\n"; diff --git a/New/compiler.pl b/New/compiler.pl index 0631ff691..b6d4eb06f 100755 --- a/New/compiler.pl +++ b/New/compiler.pl @@ -59,12 +59,14 @@ use Shorewall::Rules; use Shorewall::Proc; use Shorewall::Proxyarp; +use constant { VERSION => '3.9.0-1' }; + sub generate_script_1 { copy find_file 'prog.header'; 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} ) { emit 'SHAREDIR=/usr/share/shorewall-lite'; @@ -128,7 +130,7 @@ sub generate_script_1 { emit '[ -n "${VERBOSE:=0}" ]'; emit '[ -n "${RESTOREFILE:=$RESTOREFILE}" ]'; emit '[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:%s:%s:"'; - emit "VERSION=\"$ENV{VERSION}\""; + emit( 'VERSION="' . VERSION . '"' ); emit "PATH=\"$config{PATH}\""; emit 'TERMINATOR=fatal_error'; @@ -564,11 +566,11 @@ sub compile_firewall( $ ) { 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}; - fatal_error "Shorewall $ENV{VERSION} requires Extended Multi-port Match Support" + fatal_error( 'Shorewall ' . VERSION . ' requires Extended Multi-port Match Support' ) 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}; fatal_error 'BRIDGING=Yes requires Physdev Match support in your Kernel and iptables' if $config{BRIDGING} && ! $capabilities{PHYSDEV_MATCH};