Skip to content

Commit

Permalink
Update IO::Compress to CPAN 2.201
Browse files Browse the repository at this point in the history
From ChangeLog

  2.201 25 June 2022

      * Disable zib header tests
        Sat Jun 25 09:10:59 2022 +0100
        63eb5d37291b40dbf07d191a09b7876168008cd4

      * Version 2.201
        Sat Jun 25 09:00:42 2022 +0100
        af51310f68bb225d94eaa29b7f3d2bece1935dfd

      * doc update pmqs/IO-Compress#38
        Thu Jun 23 23:00:31 2022 +0100
        2002d4fd3b3a6f5de6c6c3dc5989cf42581c1758

      * Changes for zlib-ng
        Thu Jun 23 22:43:50 2022 +0100
        2bd52d2918823cc567c3e92dd3d15f87cb4ee8f8

      * Add perl 5.36
        Sun Jun 5 13:34:18 2022 +0100
        ede55370ed4c7eb3c66abc71bc25c7e4019b4c44

      * force streaming zip file when writing to stdout
      * pmqs/IO-Compress#42
        Sun Apr 24 19:43:19 2022 +0100
        b57a3f83f404f5a24242680de5b406cfcf5c03ac

      * read zip timestamp in localtime
        Sun Apr 24 13:11:58 2022 +0100
        0c838f43dc46f292714c82145c9add9932196b01

      * streamzip: tighten up version tests for failing windows tests
      * pmqs/IO-Compress#41
        Sun Apr 24 12:49:57 2022 +0100
        3497645228235ea12c4d559d6dedd4cef47fc94a

      * streamzip: update year
        Sun Apr 24 12:11:35 2022 +0100
        0ac0d1ef603d8854ffc35976196735b663764992

      * Use Time::Local instead of  POSIX::mktime
        Tue Apr 19 11:31:43 2022 +0100
        64a106f1119cbc7dec8db52dca016bb8baacf2d4
  • Loading branch information
atoomic authored and scottchiefbaker committed Nov 3, 2022
1 parent 5090839 commit da3145d
Show file tree
Hide file tree
Showing 34 changed files with 270 additions and 245 deletions.
5 changes: 3 additions & 2 deletions cpan/IO-Compress/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use strict ;
require 5.006 ;

$::VERSION = '2.106' ;
$::DEP_VERSION = '2.103';
$::VERSION = '2.201' ;
$::DEP_VERSION = '2.201';

use lib '.';
use private::MakeUtil;
Expand All @@ -29,6 +29,7 @@ WriteMakefile(
'Compress::Raw::Zlib' => $::DEP_VERSION,
'Scalar::Util' => 0,
'Encode' => 0,
'Time::Local' => 0,
$] >= 5.005 && $] < 5.006
? ('File::BSDGlob' => 0)
: () }
Expand Down
13 changes: 9 additions & 4 deletions cpan/IO-Compress/bin/streamzip
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use IO::Compress::Zip qw(zip

use Getopt::Long;

my $VERSION = '1.002';
my $VERSION = '1.00';

my $compression_method = ZIP_CM_DEFLATE;
my $stream = 0;
Expand Down Expand Up @@ -51,6 +51,10 @@ if ($compression_method == ZIP_CM_DEFLATE && defined $level)
push @extraOpts, (Level => $level)
}

# force streaming zip file when writing to stdout.
$stream = 1
if $zipfile eq '-';

zip '-' => $zipfile,
Name => $memberName,
Zip64 => $zip64,
Expand Down Expand Up @@ -107,7 +111,8 @@ Usage:
producer | streamzip [OPTIONS] | consumer
producer | streamzip [OPTIONS] -zipfile output.zip
Stream data from stdin, compress into a Zip container, and stream to stdout.
Stream data from stdin, compress into a Zip container, and either stream to stdout, or
write to a named file.
OPTIONS
Expand All @@ -131,7 +136,7 @@ OPTIONS
zstd Use LZMA compression [needs IO::Compress::Zstd]
-version Display version number [$VERSION]
Copyright (c) 2019-2021 Paul Marquess. All rights reserved.
Copyright (c) 2019-2022 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Expand Down Expand Up @@ -287,7 +292,7 @@ Paul Marquess F<[email protected]>.
=head1 COPYRIGHT
Copyright (c) 2019-2021 Paul Marquess. All rights reserved.
Copyright (c) 2019-2022 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
15 changes: 9 additions & 6 deletions cpan/IO-Compress/lib/Compress/Zlib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ use Carp ;
use IO::Handle ;
use Scalar::Util qw(dualvar);

use IO::Compress::Base::Common 2.106 ;
use Compress::Raw::Zlib 2.103 ;
use IO::Compress::Gzip 2.106 ;
use IO::Uncompress::Gunzip 2.106 ;
use IO::Compress::Base::Common 2.201 ;
use Compress::Raw::Zlib 2.201 ;
use IO::Compress::Gzip 2.201 ;
use IO::Uncompress::Gunzip 2.201 ;

use strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);

$VERSION = '2.106';
$VERSION = '2.201';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -461,7 +461,7 @@ sub inflate

package Compress::Zlib ;

use IO::Compress::Gzip::Constants 2.106 ;
use IO::Compress::Gzip::Constants 2.201 ;

sub memGzip($)
{
Expand Down Expand Up @@ -1494,6 +1494,9 @@ C<[email protected]> and Mark Adler C<[email protected]>.
The primary site for the I<zlib> compression library is
L<http://www.zlib.org>.
The primary site for the I<zlib-ng> compression library is
L<https://github.com/zlib-ng/zlib-ng>.
The primary site for gzip is L<http://www.gzip.org>.
=head1 AUTHOR
Expand Down
6 changes: 3 additions & 3 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.106 qw(:Status);
use IO::Compress::Base::Common 2.201 qw(:Status);

use Compress::Raw::Bzip2 2.103 ;
use Compress::Raw::Bzip2 2.201 ;

our ($VERSION);
$VERSION = '2.106';
$VERSION = '2.201';

sub mkCompObject
{
Expand Down
29 changes: 26 additions & 3 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.106 qw(:Status);
use Compress::Raw::Zlib 2.103 qw( !crc32 !adler32 ) ;
use IO::Compress::Base::Common 2.201 qw(:Status);
use Compress::Raw::Zlib 2.201 qw( !crc32 !adler32 ) ;

require Exporter;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS);

$VERSION = '2.106';
$VERSION = '2.201';
@ISA = qw(Exporter);
@EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS;
%EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS;
Expand Down Expand Up @@ -40,6 +40,29 @@ sub mkCompObject
} ;
}

sub mkCompObject1
{
my $crc32 = shift ;
my $adler32 = shift ;
my $level = shift ;
my $strategy = shift ;

my ($def, $status) = Compress::Raw::Zlib::Deflate->new(
-AppendOutput => 1,
-CRC32 => $crc32,
-ADLER32 => $adler32,
-Level => $level,
-Strategy => $strategy,
-WindowBits => MAX_WBITS);

return (undef, "Cannot create Deflate object: $status", $status)
if $status != Z_OK;

return bless {'Def' => $def,
'Error' => '',
} ;
}

sub compr
{
my $self = shift ;
Expand Down
4 changes: 2 additions & 2 deletions cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use strict;
use warnings;
use bytes;

use IO::Compress::Base::Common 2.106 qw(:Status);
use IO::Compress::Base::Common 2.201 qw(:Status);
our ($VERSION);

$VERSION = '2.106';
$VERSION = '2.201';

sub mkCompObject
{
Expand Down
4 changes: 2 additions & 2 deletions cpan/IO-Compress/lib/IO/Compress/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 5.006 ;
use strict ;
use warnings;

use IO::Compress::Base::Common 2.106 ;
use IO::Compress::Base::Common 2.201 ;

use IO::File (); ;
use Scalar::Util ();
Expand All @@ -20,7 +20,7 @@ use Symbol();
our (@ISA, $VERSION);
@ISA = qw(IO::File Exporter);

$VERSION = '2.106';
$VERSION = '2.201';

#Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16.

Expand Down
2 changes: 1 addition & 1 deletion cpan/IO-Compress/lib/IO/Compress/Base/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use File::GlobMapper;
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
@ISA = qw(Exporter);
$VERSION = '2.106';
$VERSION = '2.201';

@EXPORT = qw( isaFilehandle isaFilename isaScalar
whatIsInput whatIsOutput
Expand Down
10 changes: 5 additions & 5 deletions cpan/IO-Compress/lib/IO/Compress/Bzip2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ use warnings;
use bytes;
require Exporter ;

use IO::Compress::Base 2.106 ;
use IO::Compress::Base 2.201 ;

use IO::Compress::Base::Common 2.106 qw();
use IO::Compress::Adapter::Bzip2 2.106 ;
use IO::Compress::Base::Common 2.201 qw();
use IO::Compress::Adapter::Bzip2 2.201 ;



our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error);

$VERSION = '2.106';
$VERSION = '2.201';
$Bzip2Error = '';

@ISA = qw(IO::Compress::Base Exporter);
Expand Down Expand Up @@ -51,7 +51,7 @@ sub getExtraParams
{
my $self = shift ;

use IO::Compress::Base::Common 2.106 qw(:Parse);
use IO::Compress::Base::Common 2.201 qw(:Parse);

return (
'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1],
Expand Down
106 changes: 23 additions & 83 deletions cpan/IO-Compress/lib/IO/Compress/Deflate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ use bytes;

require Exporter ;

use IO::Compress::RawDeflate 2.106 ();
use IO::Compress::Adapter::Deflate 2.106 ;
use IO::Compress::RawDeflate 2.201 ();
use IO::Compress::Adapter::Deflate 2.201 ;

use IO::Compress::Zlib::Constants 2.106 ;
use IO::Compress::Base::Common 2.106 qw();
use IO::Compress::Zlib::Constants 2.201 ;
use IO::Compress::Base::Common 2.201 qw();


our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError);

$VERSION = '2.106';
$VERSION = '2.201';
$DeflateError = '';

@ISA = qw(IO::Compress::RawDeflate Exporter);
Expand All @@ -42,105 +42,42 @@ sub deflate
return $obj->_def(@_);
}


sub bitmask($$$$)
{
my $into = shift ;
my $value = shift ;
my $offset = shift ;
my $mask = shift ;

return $into | (($value & $mask) << $offset ) ;
}

sub mkDeflateHdr($$$;$)
{
my $method = shift ;
my $cinfo = shift;
my $level = shift;
my $fdict_adler = shift ;

my $cmf = 0;
my $flg = 0;
my $fdict = 0;
$fdict = 1 if defined $fdict_adler;

$cmf = bitmask($cmf, $method, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS);
$cmf = bitmask($cmf, $cinfo, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS);

$flg = bitmask($flg, $fdict, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS);
$flg = bitmask($flg, $level, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS);

my $fcheck = 31 - ($cmf * 256 + $flg) % 31 ;
$flg = bitmask($flg, $fcheck, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS);

my $hdr = pack("CC", $cmf, $flg) ;
$hdr .= pack("N", $fdict_adler) if $fdict ;

return $hdr;
}

sub mkHeader
sub mkComp
{
my $self = shift ;
my $param = shift ;
my $got = shift ;

my $level = $param->getValue('level');
my $strategy = $param->getValue('strategy');
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject1(
$got->getValue('crc32'),
$got->getValue('adler32'),
$got->getValue('level'),
$got->getValue('strategy')
);

my $lflag ;
$level = 6
if $level == Z_DEFAULT_COMPRESSION ;
return $self->saveErrorString(undef, $errstr, $errno)
if ! defined $obj;

if (ZLIB_VERNUM >= 0x1210)
{
if ($strategy >= Z_HUFFMAN_ONLY || $level < 2)
{ $lflag = ZLIB_FLG_LEVEL_FASTEST }
elsif ($level < 6)
{ $lflag = ZLIB_FLG_LEVEL_FAST }
elsif ($level == 6)
{ $lflag = ZLIB_FLG_LEVEL_DEFAULT }
else
{ $lflag = ZLIB_FLG_LEVEL_SLOWEST }
}
else
{
$lflag = ($level - 1) >> 1 ;
$lflag = 3 if $lflag > 3 ;
}

#my $wbits = (MAX_WBITS - 8) << 4 ;
my $wbits = 7;
mkDeflateHdr(ZLIB_CMF_CM_DEFLATED, $wbits, $lflag);
return $obj;
}

sub ckParams

sub mkHeader
{
my $self = shift ;
my $got = shift;

$got->setValue('adler32' => 1);
return 1 ;
return '';
}


sub mkTrailer
{
my $self = shift ;
return pack("N", *$self->{Compress}->adler32()) ;
return '';
}

sub mkFinalTrailer
{
return '';
}

#sub newHeader
#{
# my $self = shift ;
# return *$self->{Header};
#}

sub getExtraParams
{
my $self = shift ;
Expand Down Expand Up @@ -940,6 +877,9 @@ C<[email protected]> and Mark Adler C<[email protected]>.
The primary site for the I<zlib> compression library is
L<http://www.zlib.org>.
The primary site for the I<zlib-ng> compression library is
L<https://github.com/zlib-ng/zlib-ng>.
The primary site for gzip is L<http://www.gzip.org>.
=head1 AUTHOR
Expand Down
Loading

0 comments on commit da3145d

Please sign in to comment.