Skip to content

Commit 98f3235

Browse files
committed
version 1.001
1 parent 82ff415 commit 98f3235

13 files changed

+197
-56
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*~
22
.*
33
*.bak
4+
*.old
45
*.swp
56
*.tar
67
*.tar.gz

Diff for: Changes

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGES
22
-------
33

4+
1.001 28 August 2024
5+
6+
* #20 Don't ship with Test::* modules
7+
Wed Aug 28 15:13:30 2024 +0100
8+
82ff415a949ce718ddfb9110214e788fc2d366da
9+
410
1.000 25 June 2022
511

612
* version 1.000

Diff for: META.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@
3434
},
3535
"runtime" : {
3636
"recommends" : {
37-
"IO::Compress::Lzma" : "2.201",
38-
"IO::Uncompress::UnLzma" : "2.201",
39-
"IO::Compress::Xz" : "2.201",
40-
"IO::Uncompress::UnXz" : "2.201",
41-
"IO::Compress::Zstd" : "2.201",
42-
"IO::Uncompress::UnZstd" : "2.201",
43-
"IO::Compress::Bzip2" : "2.201",
44-
"IO::Uncompress::Bunzip2" : "2.201"
37+
"IO::Compress::Lzma" : "2.213",
38+
"IO::Uncompress::UnLzma" : "2.213",
39+
"IO::Compress::Xz" : "2.213",
40+
"IO::Uncompress::UnXz" : "2.213",
41+
"IO::Compress::Zstd" : "2.213",
42+
"IO::Uncompress::UnZstd" : "2.213",
43+
"IO::Compress::Bzip2" : "2.213",
44+
"IO::Uncompress::Bunzip2" : "2.213"
4545
},
4646
"requires" : {
47-
"IO::Compress::Base" : "2.201",
48-
"IO::Uncompress::Base" : "2.201",
49-
"IO::Compress::Zip" : "2.201",
50-
"IO::Uncompress::Unzip" : "2.201",
51-
"IO::Compress::RawDeflate" : "2.201",
52-
"IO::Uncompress::RawInflate" : "2.201",
47+
"IO::Compress::Base" : "2.213",
48+
"IO::Uncompress::Base" : "2.213",
49+
"IO::Compress::Zip" : "2.213",
50+
"IO::Uncompress::Unzip" : "2.213",
51+
"IO::Compress::RawDeflate" : "2.213",
52+
"IO::Uncompress::RawInflate" : "2.213",
5353
"Perl::OSType" : "0"
5454
}
5555
}

Diff for: META.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ no_index:
2020
- t
2121
- private
2222
recommends:
23-
IO::Compress::Lzma: '2.201'
24-
IO::Uncompress::UnLzma: '2.201'
25-
IO::Compress::Xz: '2.201'
26-
IO::Uncompress::UnXz: '2.201'
27-
IO::Compress::Zstd: '2.201'
28-
IO::Uncompress::UnZstd: '2.201'
29-
IO::Compress::Bzip2: '2.201'
30-
IO::Uncompress::Bunzip2: '2.201'
23+
IO::Compress::Lzma: '2.213'
24+
IO::Uncompress::UnLzma: '2.213'
25+
IO::Compress::Xz: '2.213'
26+
IO::Uncompress::UnXz: '2.213'
27+
IO::Compress::Zstd: '2.213'
28+
IO::Uncompress::UnZstd: '2.213'
29+
IO::Compress::Bzip2: '2.213'
30+
IO::Uncompress::Bunzip2: '2.213'
3131
requires:
32-
IO::Compress::Base: '2.201'
33-
IO::Uncompress::Base: '2.201'
34-
IO::Compress::Zip: '2.201'
35-
IO::Uncompress::Unzip: '2.201'
36-
IO::Compress::RawDeflate: '2.201'
37-
IO::Uncompress::RawInflate: '2.201'
32+
IO::Compress::Base: '2.213'
33+
IO::Uncompress::Base: '2.213'
34+
IO::Compress::Zip: '2.213'
35+
IO::Uncompress::Unzip: '2.213'
36+
IO::Compress::RawDeflate: '2.213'
37+
IO::Uncompress::RawInflate: '2.213'
3838
Perl::OSType: '0'
3939
resources:
4040
bugtracker: https://github.com/pmqs/Archive-Zip-SimpleZip/issues

Diff for: Makefile.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use lib '.';
77
use private::MakeUtil;
88
use ExtUtils::MakeMaker 5.16 ;
99

10-
my $ParentVersion = 2.201 ;
10+
my $ParentVersion = 2.213 ;
1111

1212
# Check if th eother IO::Compress::* modules are installed.
1313
# If any are, add to PREREQ_PM.

Diff for: README

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
Archive-Zip-SimpleZip
33

4-
Version 1.000
4+
Version 1.001
55

6-
25 June 2022
6+
28 August 2024
77

8-
Copyright (c) 2012-2022 Paul Marquess. All rights reserved.
8+
Copyright (c) 2012-2024 Paul Marquess. All rights reserved.
99
This program is free software; you can redistribute it
1010
and/or modify it under the same terms as Perl itself.
1111

@@ -24,7 +24,7 @@ Before you can build Archive-Zip-SimpleZip you need to have the following
2424
installed on your system:
2525

2626
* Perl 5.006 or better.
27-
* IO::Compress version 2.201 or better.
27+
* IO::Compress version 2.213 or better.
2828

2929
BUILDING THE MODULE
3030
-------------------

Diff for: lib/Archive/Zip/SimpleUnzip.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use IO::File;
1010
use Carp;
1111
use Scalar::Util ();
1212

13-
use IO::Compress::Base::Common 2.201 qw(:Status);
14-
use IO::Compress::Zip::Constants 2.201 ;
15-
use IO::Uncompress::Unzip 2.201 ;
13+
use IO::Compress::Base::Common 2.213 qw(:Status);
14+
use IO::Compress::Zip::Constants 2.213 ;
15+
use IO::Uncompress::Unzip 2.213 ;
1616

1717

1818
require Exporter ;
@@ -1388,7 +1388,7 @@ See the Changes file.
13881388
13891389
=head1 COPYRIGHT AND LICENSE
13901390
1391-
Copyright (c) 2018-2022 Paul Marquess. All rights reserved.
1391+
Copyright (c) 2018-2024 Paul Marquess. All rights reserved.
13921392
13931393
This program is free software; you can redistribute it and/or
13941394
modify it under the same terms as Perl itself.

Diff for: lib/Archive/Zip/SimpleZip.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use warnings;
55

66
require 5.006;
77

8-
use IO::Compress::Zip 2.201 qw(:all);
9-
use IO::Compress::Base::Common 2.201 ();
10-
use IO::Compress::Adapter::Deflate 2.201 ;
8+
use IO::Compress::Zip 2.213 qw(:all);
9+
use IO::Compress::Base::Common 2.213 ();
10+
use IO::Compress::Adapter::Deflate 2.213 ;
1111

1212
use Fcntl ();
1313
use File::Spec ();
@@ -1851,7 +1851,7 @@ See the Changes file.
18511851
18521852
=head1 COPYRIGHT AND LICENSE
18531853
1854-
Copyright (c) 2012-2022 Paul Marquess. All rights reserved.
1854+
Copyright (c) 2012-2024 Paul Marquess. All rights reserved.
18551855
18561856
This program is free software; you can redistribute it and/or
18571857
modify it under the same terms as Perl itself.

Diff for: lib/Archive/Zip/StreamedUnzip.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use IO::File;
1010
use Carp;
1111
use Scalar::Util ();
1212

13-
use IO::Compress::Base::Common 2.201 qw(:Status);
14-
use IO::Compress::Zip::Constants 2.201 ;
15-
use IO::Uncompress::Unzip 2.201 ;
13+
use IO::Compress::Base::Common 2.213 qw(:Status);
14+
use IO::Compress::Zip::Constants 2.213 ;
15+
use IO::Uncompress::Unzip 2.213 ;
1616

1717

1818
require Exporter ;
@@ -767,7 +767,7 @@ See the Changes file.
767767
768768
=head1 COPYRIGHT AND LICENSE
769769
770-
Copyright (c) 2019-2022 Paul Marquess. All rights reserved.
770+
Copyright (c) 2019-2024 Paul Marquess. All rights reserved.
771771
772772
This program is free software; you can redistribute it and/or
773773
modify it under the same terms as Perl itself.

Diff for: t/000prereq.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BEGIN
1919
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
2020

2121

22-
my $VERSION = '2.201';
22+
my $VERSION = '2.213';
2323
my @NAMES = qw(
2424
IO::Compress::Zip
2525
IO::Uncompress::Unzip

Diff for: t/002examples.t

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
use lib qw(t t/compress);
2+
3+
use strict;
4+
use warnings;
5+
6+
use Test::More ;
7+
use CompTestUtils;
8+
9+
BEGIN
10+
{
11+
# use Test::NoWarnings, if available
12+
my $extra = 0 ;
13+
$extra = 1
14+
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
15+
16+
plan tests => 24 + $extra ;
17+
18+
use_ok('Archive::Zip::SimpleZip', qw($SimpleZipError)) ;
19+
use_ok('IO::Compress::Gzip', qw(gzip $GzipError)) ;
20+
use_ok('IO::Uncompress::Gunzip', qw(gunzip $GunzipError)) ;
21+
use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ;
22+
}
23+
24+
25+
my $Inc = join " ", map qq["-I$_"] => @INC;
26+
$Inc = '"-MExtUtils::testlib"'
27+
if eval " require ExtUtils::testlib; " ;
28+
29+
my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
30+
$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
31+
32+
$Perl = "$Perl $Inc -w" ;
33+
#$Perl .= " -Mblib " ;
34+
my $examples = "./examples/";
35+
36+
sub runScript
37+
{
38+
my $command = shift ;
39+
my $expected = shift ;
40+
41+
my $lex = new LexFile my $stderr ;
42+
43+
my $cmd = "$command 2>$stderr";
44+
my $stdout = `$cmd` ;
45+
46+
my $aok = 1 ;
47+
48+
$aok &= is $?, 0, " exit status is 0" ;
49+
50+
$aok &= is readFile($stderr), '', " no stderr" ;
51+
52+
$aok &= is $stdout, $expected, " expected content is ok"
53+
if defined $expected ;
54+
55+
if (! $aok) {
56+
diag "Command line: $cmd";
57+
my ($file, $line) = (caller)[1,2];
58+
diag "Test called from $file, line $line";
59+
}
60+
61+
1 while unlink $stderr;
62+
}
63+
64+
sub getContent
65+
{
66+
my $filename = shift;
67+
68+
my $u = new IO::Uncompress::Unzip $filename, Append => 1, @_
69+
or die "Cannot open $filename: $UnzipError";
70+
71+
isa_ok $u, "IO::Uncompress::Unzip";
72+
73+
my @content;
74+
my $status ;
75+
76+
for ($status = 1; $status > 0 ; $status = $u->nextStream())
77+
{
78+
die "xxx" if ! defined $u;
79+
my %info = %{ $u->getHeaderInfo() } ;
80+
my $name = $u->getHeaderInfo()->{Name};
81+
#warn "Processing member $name\n" ;
82+
83+
my $buff = '';
84+
1 while ($status = $u->read($buff)) ;
85+
$info{Payload} = $buff;
86+
87+
#push @content, [$name, $buff];
88+
push @content, \%info;
89+
last unless $status == 0;
90+
}
91+
92+
die "Error processing $filename: $status $!\n"
93+
if $status < 0 ;
94+
95+
return @content;
96+
}
97+
98+
sub canonFile
99+
{
100+
IO::Compress::Zip::canonicalName($_[0], 0);
101+
}
102+
103+
104+
{
105+
# gz2zip
106+
###########
107+
title "gz2zip" ;
108+
109+
my $lex = new LexFile my $gz1, my $gz2, my $gz3, my $zipfile;
110+
111+
ok gzip(\"gzip 1" => $gz1), " gzip 1 ok";
112+
ok gzip(\"gzip 2" => $gz2), " gzip 2 ok";
113+
ok gzip(\"gzip 3" => $gz3), " gzip 3 ok";
114+
115+
my $data ;
116+
ok gunzip($gz1 => \$data), " gunzip 1 ok" ;
117+
is $data, "gzip 1", " 1 data ok" ;
118+
ok gunzip($gz2 => \$data), " gunzip 2 ok" ;
119+
is $data, "gzip 2", " 2 data ok" ;
120+
ok gunzip($gz3 => \$data), " gunzip 3 ok" ;
121+
is $data, "gzip 3", " 3 data ok" ;
122+
123+
runScript "$Perl ${examples}/gz2zip.pl $zipfile $gz1 $gz2 $gz3" ;
124+
125+
my @got = getContent($zipfile);
126+
is @got, 3, " three entries in $zipfile";
127+
is $got[0]{Name}, canonFile($gz1), " member1 Name ok";
128+
is $got[0]{Payload}, "gzip 1", " member1 Payload ok";
129+
is $got[1]{Name}, canonFile($gz2), " member1 Name ok";
130+
is $got[1]{Payload}, "gzip 2", " member2 Payload ok";
131+
is $got[2]{Name}, canonFile($gz3), " member3 Name ok";
132+
is $got[2]{Payload}, "gzip 3", " member3 Payload ok";
133+
134+
}

Diff for: t/010main-unzip.t

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ BEGIN {
3535

3636
}
3737

38-
eval ' use IO::Uncompress::Bunzip2 2.201 ;';
39-
eval ' use IO::Uncompress::RawInflate 2.201 ;';
40-
eval ' use IO::Uncompress::UnLzma 2.201 ;';
41-
eval ' use IO::Uncompress::UnXz 2.201 ;';
42-
eval ' use IO::Uncompress::UnZstd 2.201 ;';
38+
eval ' use IO::Uncompress::Bunzip2 2.213 ;';
39+
eval ' use IO::Uncompress::RawInflate 2.213 ;';
40+
eval ' use IO::Uncompress::UnLzma 2.213 ;';
41+
eval ' use IO::Uncompress::UnXz 2.213 ;';
42+
eval ' use IO::Uncompress::UnZstd 2.213 ;';
4343

4444
my %methodNames;
4545

Diff for: t/020main-unzip-stream.t

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ BEGIN {
3737
}
3838

3939

40-
eval ' use IO::Uncompress::Bunzip2 2.201 ;';
41-
eval ' use IO::Uncompress::RawInflate 2.201 ;';
42-
eval ' use IO::Uncompress::UnLzma 2.201 ;';
43-
eval ' use IO::Uncompress::UnXz 2.201 ;';
44-
eval ' use IO::Uncompress::UnZstd 2.201 ;';
40+
eval ' use IO::Uncompress::Bunzip2 2.213 ;';
41+
eval ' use IO::Uncompress::RawInflate 2.213 ;';
42+
eval ' use IO::Uncompress::UnLzma 2.213 ;';
43+
eval ' use IO::Uncompress::UnXz 2.213 ;';
44+
eval ' use IO::Uncompress::UnZstd 2.213 ;';
4545

4646
my %methodNames;
4747

0 commit comments

Comments
 (0)