X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_zipCreate;h=74c4bf453887493be20389db841b1d175b6154f2;hp=36a1e300cd06dc3dbdb9bfa189ba4e9d09f26ae2;hb=1a2fa2c2a1e0db12dc788216d9f3ba73301a131f;hpb=9175f9157f0d54b50ebf11d2036c20f50ffc6d9d diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index 36a1e30..74c4bf4 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_zipCreate: create a zip archive of an existing dump @@ -33,7 +33,7 @@ # Based on Backup_tarCreate by Craig Barratt # # COPYRIGHT -# Copyright (C) 2002 Craig Barratt and Guillaume Filion +# Copyright (C) 2002-2003 Craig Barratt and Guillaume Filion # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,13 +51,14 @@ # #======================================================================== # -# Version 2.0.0_CVS, released 3 Feb 2003. +# Version 2.1.0beta1, released 9 Apr 2004. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; +no utf8; use lib "/usr/local/BackupPC/lib"; use Archive::Zip qw(:ERROR_CODES); use File::Path; @@ -75,9 +76,8 @@ my $BinDir = $bpc->BinDir(); my %Conf = $bpc->Conf(); my %opts; -getopts("th:n:p:r:s:c:", \%opts); -if ( @ARGV < 1 ) { +if ( !getopts("th:n:p:r:s:c:", \%opts) || @ARGV < 1 ) { print(STDERR "usage: $0 [-t] [-h host] [-n dumpNum] [-s shareName]" . " [-r pathRemove] [-p pathAdd] [-c compressionLevel]" . " files/directories...\n"); @@ -133,6 +133,7 @@ my $fh = new IO::Handle; $fh->fdopen(fileno(STDOUT),"w"); my $zipfh = Archive::Zip->new(); +binmode(STDOUT); foreach my $dir ( @ARGV ) { archiveWrite($zipfh, $dir); }