Try to avoid printing import banners unnecessarily

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-03-16 07:23:02 -07:00
parent 787cec4fe7
commit 16bbe780c7

View File

@ -1205,6 +1205,7 @@ sub copy1( $ ) {
#
sub copy2( $ ) {
assert( $script_enabled );
my $empty = 1;
if ( $script ) {
my $file = $_[0];
@ -1212,16 +1213,17 @@ sub copy2( $ ) {
open IF , $file or fatal_error "Unable to open $file: $!";
while ( <IF> ) {
last unless /^#/;
$empty = 0, last unless /^#/;
}
unless ( $empty ) {
print $script <<EOF;
################################################################################
# Functions imported from $file
################################################################################
EOF
print $script $_ if defined && ! /^\s*$/;
print $script $_ unless /^\s*$/;
while ( <IF> ) {
chomp;
@ -1251,7 +1253,7 @@ EOF
EOF
$lastlineblank = 0;
}
}
}
#