},
'Compress::Raw::Bzip2' => {
- 'DISTRIBUTION' => 'PMQS/Compress-Raw-Bzip2-2.096.tar.gz',
+ 'DISTRIBUTION' => 'PMQS/Compress-Raw-Bzip2-2.100.tar.gz',
'FILES' => q[cpan/Compress-Raw-Bzip2],
'EXCLUDED' => [
qr{^t/Test/},
#ParseCONFIG() ;
-UpDowngrade(getPerlFiles('MANIFEST'))
+UpDowngrade(getPerlFiles('MANIFEST'))
unless $ENV{PERL_CORE};
-WriteMakefile(
+WriteMakefile(
NAME => 'Compress::Raw::Bzip2',
VERSION_FROM => 'lib/Compress/Raw/Bzip2.pm',
INC => "-I$BZIP2_INCLUDE" ,
XS => { 'Bzip2.xs' => 'Bzip2.c'},
'clean' => { FILES => '*.c bzip2.h bzlib.h bzlib_private.h constants.h constants.xs' },
#'depend' => { 'Makefile' => 'config.in' },
- 'dist' => { COMPRESS => 'gzip',
+ 'dist' => { COMPRESS => 'gzip',
TARFLAGS => '-chvf',
SUFFIX => 'gz',
DIST_DEFAULT => 'MyTrebleCheck tardist',
? bzip2_files($BZIP2_LIB)
: (LIBS => [ "-L$BZIP2_LIB -lbz2 " ])
),
-
+
(
$] >= 5.005
? (ABSTRACT_FROM => 'lib/Compress/Raw/Bzip2.pm',
INSTALLDIRS => ($] > 5.010 && $] < 5.011 ? 'perl' : 'site'),
- ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
+ ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
? ( META_MERGE => {
-
+
"meta-spec" => { version => 2 },
no_index => {
},
resources => {
-
+
bugtracker => {
web => 'https://github.com/pmqs/Compress-Raw-Bzip2/issues'
},
type => 'git',
url => 'git://github.com/pmqs/Compress-Raw-Bzip2.git',
web => 'https://github.com/pmqs/Compress-Raw-Bzip2',
- },
+ },
},
- }
- )
+ }
+ )
: ()
- ),
+ ),
((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
- ('LICENSE' => 'perl') : ()),
+ ('LICENSE' => 'perl') : ()),
) ;
die "The following names are missing from \@EXPORT in Bzip2.pm\n" .
"\t$missing\n" ;
}
-
+
#push @names, {name => 'BZ_VERSION', type => 'PV' };
ExtUtils::Constant::WriteConstants(
NAMES => \@names,
C_FILE => 'constants.h',
XS_FILE => 'constants.xs',
-
+
);
-}
+}
else {
foreach my $name (qw( constants.h constants.xs ))
{
foreach my $file (@c_files, @h_files)
{ copy(catfile($dir, $file), '.') }
-
-
+
+
@h_files = map { catfile($dir, $_) } @h_files ;
my @o_files = map { "$_\$(OBJ_EXT)" } 'Bzip2', @c_files;
push @c_files, 'Bzip2.c' ;
'C' => [ @c_files ] ,
#'OBJECT' => qq[ @o_files ],
'OBJECT' => q[ $(O_FILES) ],
-
+
) ;
}
-
-
-
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.096';
-$XS_VERSION = $VERSION;
+$VERSION = '2.100';
+$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@ISA = qw(Exporter);
require XSLoader;
XSLoader::load('Compress::Raw::Bzip2', $XS_VERSION);
1;
-}
+}
or do {
require DynaLoader;
local @ISA = qw(DynaLoader);
- bootstrap Compress::Raw::Bzip2 $XS_VERSION ;
+ bootstrap Compress::Raw::Bzip2 $XS_VERSION ;
};
#sub Compress::Raw::Bzip2::new
my ($bz, $status) = new Compress::Raw::Bzip2 [OPTS]
or die "Cannot create bzip2 object: $bzerno\n";
-
+
$status = $bz->bzdeflate($input, $output);
$status = $bz->bzflush($output);
$status = $bz->bzclose($output);
my ($bz, $status) = new Compress::Raw::Bunzip2 [OPTS]
or die "Cannot create bunzip2 object: $bzerno\n";
-
+
$status = $bz->bzinflate($input, $output);
my $version = Compress::Raw::Bzip2::bzlibversion();
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2020 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2021 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.
-
return $path;
}
-sub MY::postamble
+sub MY::postamble
{
return ''
if $ENV{PERL_CORE} ;
my @files = getPerlFiles('MANIFEST');
- # Note: Once you remove all the layers of shell/makefile escaping
+ # Note: Once you remove all the layers of shell/makefile escaping
# the regular expression below reads
#
# /^\s*local\s*\(\s*\$^W\s*\)/
foreach (@files) {
#if (-l $_ )
{ doUpDown($our_sub, $warn_sub, $_) }
- #else
+ #else
#{ doUpDownViaCopy($our_sub, $warn_sub, $_) }
}
local ($^I) = ($^O eq 'VMS') ? "_bak" : ".bak";
local (@ARGV) = shift;
-
+
while (<>)
{
print, last if /^__(END|DATA)__/ ;
push @keep, $_;
last ;
}
-
+
&{ $our_sub }() if $our_sub ;
&{ $warn_sub }() if $warn_sub ;
push @keep, $_;
Compress::Zlib
);
-
+
my @broken = ();
foreach my $module ( grep { ! $thisModule{$_} } @modules)
my $hasVersion = getInstalledVersion($module);
# No need to upgrade if the module isn't installed at all
- next
+ next
if ! defined $hasVersion;
# If already have C::Z version 1, then an upgrade to any of the
# IO::Compress modules will not break it.
- next
+ next
if $module eq 'Compress::Zlib' && $hasVersion < 2;
if ($hasVersion < $version)
{
no strict 'refs';
$version = ${ $module . "::VERSION" };
- $version = 0
+ $version = 0
}
-
+
return $version;
}
package MakeUtil ;
1;
-
-
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- my $VERSION = '2.096';
+ my $VERSION = '2.100';
my @NAMES = qw(
-
+
);
my @OPT = qw(
-
+
);
plan tests => 1 + @NAMES + @OPT + $extra ;
eval " require $name " ;
if ($@)
{
- ok 1, "$name not available"
+ ok 1, "$name not available"
}
- else
+ else
{
my $ver = eval("\$${name}::VERSION");
- is $ver, $VERSION, "$name version should be $VERSION"
+ is $ver, $VERSION, "$name version should be $VERSION"
or diag "$name version is $ver, need $VERSION" ;
- }
+ }
}
-
-}
+}
use Test::More ;
use CompTestUtils;
-BEGIN
-{
+BEGIN
+{
# use Test::NoWarnings, if available
my $extra = 0 ;
$extra = 1
plan tests => 88 + $extra ;
- use_ok('Compress::Raw::Bzip2') ;
+ use_ok('Compress::Raw::Bzip2') ;
}
my $hello = "I am a HAL 9000 computer" x 2001;
my $tmp = $hello ;
-my ($err, $x, $X, $status);
+my ($err, $x, $X, $status);
ok( ($x, $err) = new Compress::Raw::Bzip2 (1));
ok $x ;
ok $GOT eq $hello;
}
-
+
sub getOut { my $x = ''; return \$x }
for my $bufsize (1, 2, 3, 13, 4096, 1024*10)
));
ok $k ;
cmp_ok $err, '==', BZ_OK, " status is BZ_OK" ;
-
+
is $k->total_in_lo32(), 0, " total_in_lo32 == 0" ;
is $k->total_out_lo32(), 0, " total_out_lo32 == 0" ;
my $GOT = getOut();
last if $status != BZ_OK;
$deltaOK = 0 if length($GOT) - $prev > $bufsize;
}
-
+
ok $deltaOK, " Output Delta never > $bufsize";
cmp_ok $looped, '>=', 1, " looped $looped";
is length($tmp), 0, " length of input buffer is zero";
{
my $obj = shift ;
my $input = shift;
-
+
my $data ;
1 while $obj->bzinflate($input, $data) != BZ_STREAM_END ;
return \$data ;
{
title "regression test";
-
- my ($err, $x, $X, $status);
-
+
+ my ($err, $x, $X, $status);
+
ok( ($x, $err) = new Compress::Raw::Bzip2 (1));
ok $x ;
cmp_ok $err, '==', BZ_OK, " status is BZ_OK" ;
my $line2 = "second line\n" ;
my $text = $line1 . $line2 ;
my $tmp = $text;
-
+
my $out ;
$status = $x->bzdeflate($tmp, $out) ;
cmp_ok $status, '==', BZ_RUN_OK, " status is BZ_RUN_OK" ;
-
+
cmp_ok $x->bzclose($out), '==', BZ_STREAM_END, " bzclose returned BZ_STREAM_END" ;
my $k;
#LimitOutput => 1
));
-
+
my $c = getit($k, $out);
is $$c, $text;
-
-
-}
+
+}
use Test::More ;
use CompTestUtils;
-BEGIN
-{
+BEGIN
+{
# use Test::NoWarnings, if available
my $extra = 0 ;
$extra = 1
use_ok('Compress::Raw::Bzip2', 2) ;
}
-
+
my $hello = <<EOM ;
my $hello = *hello;
$hello = *hello;
- my ($err, $x, $X, $status);
-
+ my ($err, $x, $X, $status);
+
ok( ($x, $err) = new Compress::Raw::Bzip2(0), "Create bzdeflate object" );
ok $x, "Compress::Raw::Bzip2 ok" ;
cmp_ok $err, '==', BZ_OK, "status is BZ_OK" ;
-
+
is $x->uncompressedBytes(), 0, "uncompressedBytes() == 0" ;
is $x->compressedBytes(), 0, "compressedBytes() == 0" ;
$Answer = *Answer;
$status = $x->bzdeflate($hello, $Answer) ;
cmp_ok $status, '==', BZ_RUN_OK, "bzdeflate returned BZ_RUN_OK" ;
-
+
$X = *X;
cmp_ok $x->bzflush($X), '==', BZ_RUN_OK, "bzflush returned BZ_RUN_OK" ;
$Answer .= $X ;
-
+
is $x->uncompressedBytes(), length $hello, "uncompressedBytes ok" ;
is $x->compressedBytes(), length $Answer, "compressedBytes ok" ;
-
+
$X = *X;
cmp_ok $x->bzclose($X), '==', BZ_STREAM_END, "bzclose returned BZ_STREAM_END";
$Answer .= $X ;
my @Answer = split('', $Answer) ;
-
+
my $k;
ok(($k, $err) = new Compress::Raw::Bunzip2(0, 0));
ok $k, "Compress::Raw::Bunzip2 ok" ;
cmp_ok $err, '==', BZ_OK, "status is BZ_OK" ;
-
+
is $k->compressedBytes(), 0, "compressedBytes() == 0" ;
is $k->uncompressedBytes(), 0, "uncompressedBytes() == 0" ;
my $GOT = *GOT;
$GOT = *GOT;
my $Z;
$status = $k->bzinflate($Answer, $GOT) ;
-
-
+
+
cmp_ok $status, '==', BZ_STREAM_END, "Got BZ_STREAM_END" ;
is $GOT, $hello, "uncompressed data matches ok" ;
is $k->compressedBytes(), length $Answer, "compressedBytes ok" ;
is $k->uncompressedBytes(), length $hello , "uncompressedBytes ok";
}
-
-
#use lib qw(t t/compress);
use Carp ;
-#use Test::More ;
+#use Test::More ;
sub title
{
- #diag "" ;
+ #diag "" ;
ok(1, $_[0]) ;
#diag "" ;
}
}
BEGIN {
- eval {
+ eval {
require File::Temp;
} ;
our ($index);
$index = '00000';
-
+
sub new
{
my $self = shift ;
$index = '00000';
our ($useTempFile);
our ($useTempDir);
-
+
sub new
{
my $self = shift ;
# autogenerate the name if none supplied
$_ = "tmpdir" . $$ . "X" . $index ++ . ".tmp" ;
}
- foreach (@_)
- {
+ foreach (@_)
+ {
rmtree $_, {verbose => 0, safe => 1}
- if -d $_;
- mkdir $_, 0777
+ if -d $_;
+ mkdir $_, 0777
}
bless [ @_ ], $self ;
}
if (! $useTempFile)
{
my $self = shift ;
- foreach (@$self)
- {
+ foreach (@$self)
+ {
rmtree $_, {verbose => 0, safe => 1}
- if -d $_ ;
+ if -d $_ ;
}
}
}
{
my $pos = tell($f);
seek($f, 0,0);
- @strings = <$f> ;
+ @strings = <$f> ;
seek($f, 0, $pos);
}
else
{
- open (F, "<$f")
+ open (F, "<$f")
or croak "Cannot open $f: $!\n" ;
binmode F;
- @strings = <F> ;
+ @strings = <F> ;
close F ;
}
{
my($filename, @strings) = @_ ;
1 while unlink $filename ;
- open (F, ">$filename")
+ open (F, ">$filename")
or croak "Cannot open $filename: $!\n" ;
binmode F;
foreach (@strings) {
my ($uncomp) = "" ;
my $line = "" ;
- my $fil = gzopen($filename, "rb")
+ my $fil = gzopen($filename, "rb")
or croak "Cannopt open '$filename': $Compress::Zlib::gzerrno" ;
- $uncomp .= $line
+ $uncomp .= $line
while $fil->gzread($line) > 0;
$fil->gzclose ;
some text
EOM
- ok my $x = new IO::Compress::Gzip $name, %opts
+ ok my $x = new IO::Compress::Gzip $name, %opts
or diag "GzipError is $IO::Compress::Gzip::GzipError" ;
ok $x->write($string) ;
ok $x->close ;
}
my $out = '';
- my $o = new IO::Uncompress::AnyUncompress \$data,
- Append => 1,
- Transparent => 0,
+ my $o = new IO::Uncompress::AnyUncompress \$data,
+ Append => 1,
+ Transparent => 0,
RawInflate => 1,
UnLzma => 1,
@opts
}
my $out = '';
- my $o = new IO::Uncompress::AnyUncompress \$data,
- MultiStream => 1,
- Append => 1,
- Transparent => 0,
+ my $o = new IO::Uncompress::AnyUncompress \$data,
+ MultiStream => 1,
+ Append => 1,
+ Transparent => 0,
RawInflate => 1,
UnLzma => 1,
@opts
else if (sv_derived_from($arg, \"${ntype}\")) {
IV tmp = SvIV(getInnerObject($arg)) ;
$var = INT2PTR($type, tmp);
-
}
else
croak(\"$var is not of type ${ntype}\")
T_PV
sv_setpv((SV*)$arg, $var);
-
-
-