diff --git a/New/compiler.pl b/New/compiler.pl index a747456cc..cb358a2ea 100755 --- a/New/compiler.pl +++ b/New/compiler.pl @@ -428,19 +428,10 @@ sub default_yes_no ( $$ ) { # # Write the argument to the object file with the current indentation. # -# Since emacs doesn't understand Perl's rendition of 'here documents', we -# use multi-line quoting instead. To make multi-line emit calls look better, -# we delete a leading newline and add one to the end. -# sub emit ( $ ) { my $line = $_[0]; - $line =~ s/^\n//; - - if ( $indent || $line ) { - $line =~ s/^/$indent/; - $line =~ s/\n(.)/\n$indent$1/g; - } + $line =~ s/^/$indent/ if $indent && $line; print $object "$line\n"; } @@ -5418,6 +5409,9 @@ sub do_initialize() { initialize_chain_table; } +sub compile_stop_firewall() { +} + sub compile_firewall( $ ) { my $objectfile = $_[0]; @@ -5444,13 +5438,30 @@ sub compile_firewall( $ ) { my $date = localtime; - emit " -# -# Compiled firewall script generated by Shorewall $env{VERSION} - $date -#"; + emit "#\n# Compiled firewall script generated by Shorewall $env{VERSION} - $date\n#"; + + if ( $ENV{EXPORT} ) { + emit 'SHAREDIR=/usr/share/shorewall-lite'; + emit 'CONFDIR=/etc/shorewall-lite'; + emit 'VARDIR=/var/lib/shorewall-lite'; + + indent "$env{SHAREDIR}/lib.base"; + + emit '################################################################################'; + emit '# End of /usr/share/shorewall/lib.base'; + emit '################################################################################'; + } else { + emit 'SHAREDIR=/usr/share/shorewall'; + emit 'CONFDIR=/etc/shorewall'; + emit "VARDIR=/var/lib/shorewall\n"; + emit '. /usr/share/shoreall-lite/lib.base'; + } + } + # + # Compile the program to stop the firewall + # + compile_stop_firewall; - } - # # Process the zones file. #