aboutsummaryrefslogtreecommitdiffstats
path: root/Packdrakeng
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-28 16:05:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-28 16:05:15 +0000
commitff027a5d9ed817f912e4fedfdb9d05db840e688e (patch)
tree677bac690756cd19e477a37dc9aa9065cdfeb317 /Packdrakeng
parent4f5a7d13498f61d194919bbde3b4940bef69299e (diff)
downloadrpmtools-ff027a5d9ed817f912e4fedfdb9d05db840e688e.tar
rpmtools-ff027a5d9ed817f912e4fedfdb9d05db840e688e.tar.gz
rpmtools-ff027a5d9ed817f912e4fedfdb9d05db840e688e.tar.bz2
rpmtools-ff027a5d9ed817f912e4fedfdb9d05db840e688e.tar.xz
rpmtools-ff027a5d9ed817f912e4fedfdb9d05db840e688e.zip
Add version, fix typo
Diffstat (limited to 'Packdrakeng')
-rw-r--r--Packdrakeng/zlib.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/Packdrakeng/zlib.pm b/Packdrakeng/zlib.pm
index 48dabf5..d36ad35 100644
--- a/Packdrakeng/zlib.pm
+++ b/Packdrakeng/zlib.pm
@@ -14,9 +14,7 @@
##- along with this program; if not, write to the Free Software
##- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-##- $Id$
-
-##- This package provides functions to use Compress::Zlib instead of gzip.
+#- This package provides functions to use Compress::Zlib instead of gzip.
package Packdrakeng::zlib;
@@ -24,6 +22,8 @@ use strict;
use warnings;
use Compress::Zlib;
+(our $VERSION) = q($Id$) =~ /(\d+\.\d+)/;
+
my $gzip_header = pack("C" . Compress::Zlib::MIN_HDR_SIZE,
Compress::Zlib::MAGIC1, Compress::Zlib::MAGIC2,
Compress::Zlib::Z_DEFLATED(), 0,0,0,0,0,0, Compress::Zlib::OSCODE);
@@ -32,7 +32,7 @@ sub gzip_compress {
my ($pack, $sourcefh) = @_;
my ($insize, $outsize) = (0, 0); # aka uncompressed / compressed data length
- # If $sourcefh is not set, this mean we want a flush(), for end_block()
+ # If $sourcefh is not set, this means we want a flush(), for end_block()
# EOF, flush compress stream, adding crc
if (!defined($sourcefh)) {
if (defined($pack->{cstream_data}{object})) {
@@ -43,7 +43,7 @@ sub gzip_compress {
$pack->{cstream_data} = undef;
return(undef, $outsize);
}
-
+
if (!defined $pack->{cstream_data}{object}) {
# Writing gzip header file
$outsize += syswrite($pack->{handle}, $gzip_header);
@@ -53,9 +53,8 @@ sub gzip_compress {
-WindowBits => - MAX_WBITS(),
);
}
-
+
binmode $sourcefh;
-
while (my $lenght = sysread($sourcefh, my $buf, $pack->{bufsize})) {
$pack->{cstream_data}{crc} = crc32($buf, $pack->{cstream_data}{crc});
my ($cbuf, $status) = $pack->{cstream_data}{object}->deflate($buf);
@@ -160,7 +159,7 @@ sub gzip_uncompress {
}
$pack->{ustream_data}{read} += $l;
if ($pack->{ustream_data}{read} <= $fileinfo->{off}) { next }
-
+
my $bw;
if ($byteswritten + length($out) > $fileinfo->{size}) {
$bw = $fileinfo->{size} - $byteswritten;