Fix initialization problem

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6521 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-06-12 02:03:26 +00:00
parent 840f2414bd
commit 1cadf721ae
2 changed files with 13 additions and 7 deletions

View File

@ -99,7 +99,11 @@ Other changes in Shorewall 4.0.0 Beta 5.
configuration is compiled into the named file.
Compilation errors cause the compiler to raise an exception via
die.
die.
Important: Currently, the 'compiler' function may only
be called once in a process. I'll work on removing that
restriction but that isn't a high priority for me.
Migration Considerations:

View File

@ -25,7 +25,6 @@
#
use strict;
use lib '/usr/share/shorewall-perl';
use Shorewall::Compiler;
use Getopt::Long;
sub usage() {
@ -37,7 +36,7 @@ sub usage() {
#
Getopt::Long::Configure ('bundling');
my ( $export , $shorewall_dir, $verbose, $timestamp ) = qw( 0 '' '' '' );
my ( $export , $shorewall_dir, $verbose, $timestamp ) = ( 0, '', '', '' );
my $result = GetOptions('export' => \$export,
'e' => \$export,
@ -50,10 +49,13 @@ my $result = GetOptions('export' => \$export,
usage unless $result && @ARGV < 2;
eval {
configure( $export, $shorewall_dir, $verbose, $timestamp );
compiler $ARGV[0];
};
{
eval {
use Shorewall::Compiler;
configure( $export, $shorewall_dir, $verbose, $timestamp );
compiler $ARGV[0];
};
}
if ( $@ ) {
print STDERR $@;