-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
311 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use IO::Uncompress::Gunzip qw(gunzip $GunzipError); | ||
use Archive::Zip::SimpleZip qw($SimpleZipError); | ||
|
||
die "Usage: gz2zip.pl zipfilename gzfile1 gzfile2...\n" | ||
unless @ARGV >= 2 ; | ||
|
||
my $zipFile = shift ; | ||
my $zip = Archive::Zip::SimpleZip->new($zipFile) | ||
or die "Cannot create zip file '$zipFile': $SimpleZipError"; | ||
|
||
for my $gzFile (@ARGV) | ||
{ | ||
my $cleanName = $gzFile ; | ||
$cleanName =~ s/\.gz$//; | ||
|
||
print "Adding $cleanName\n" ; | ||
my $zipMember = $zip->openMember(Name => $cleanName) | ||
or die "Cannot openMember file '$cleanName': $SimpleZipError\n" ; | ||
|
||
gunzip $gzFile => $zipMember | ||
or die "Cannot gunzip file '$gzFile': $GunzipError $SimpleZipError\n" ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.