From afb586fdbbcd144f0995ea8de76ca8f35b3d3f53 Mon Sep 17 00:00:00 2001 From: stan Date: Wed, 9 Jul 2003 08:24:09 +0000 Subject: [PATCH] Made archive method import runtime and not compiletime. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@618 e3e1d417-86f3-4887-817a-d78f3d33393f --- scripts/zmfilter.pl.z | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/zmfilter.pl.z b/scripts/zmfilter.pl.z index dfa504e05..097d14c19 100755 --- a/scripts/zmfilter.pl.z +++ b/scripts/zmfilter.pl.z @@ -69,11 +69,12 @@ if ( ZM_OPT_UPLOAD ) # or don't want to use that format if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" ) { - use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); + use Archive::Zip; + import Archive::Zip qw( :ERROR_CODES :CONSTANTS ); } else { - use Archive::Tar; + require Archive::Tar; } use Net::FTP; } @@ -403,17 +404,17 @@ sub uploadArchFile my $zip = Archive::Zip->new(); print( "Creating upload file '$arch_file'\n" ); - my $status = AZ_OK; + my $status = &AZ_OK; foreach my $image_file ( <*$arch_image_path> ) { print( "Adding $image_file\n" ); my $member = $zip->addFile( $image_file ); last unless ( $member ); - $member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?COMPRESSION_DEFLATED:COMPRESSION_STORED ); + $member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED ); } $status = $zip->writeToFileNamed( $arch_file ); - if ( $arch_error = ($status != AZ_OK) ) + if ( $arch_error = ($status != &AZ_OK) ) { print( "Zip error: $status\n " ); }