Hello community,
here is the log from the commit of package perl-Archive-Zip
checked in at Fri Sep 12 18:07:18 CEST 2008.
--------
--- perl-Archive-Zip/perl-Archive-Zip.changes 2007-11-12 10:03:05.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Archive-Zip/perl-Archive-Zip.changes 2008-09-10 17:22:31.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Sep 10 16:57:12 CEST 2008 - anicka@suse.cz
+
+- update to 1.24
+ * Blatantly pander to CPANTS by adding use strict to a deprecated
+ module
+ * Add an explicit load of FileHandle since in some circumstances,
+ calling GLOB->print() failed.
+ * bugfixes
+
+-------------------------------------------------------------------
Old:
----
Archive-Zip-1.23.tar.bz2
New:
----
Archive-Zip-1.24.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Archive-Zip.spec ++++++
--- /var/tmp/diff_new_pack.u30116/_old 2008-09-12 18:06:45.000000000 +0200
+++ /var/tmp/diff_new_pack.u30116/_new 2008-09-12 18:06:45.000000000 +0200
@@ -1,19 +1,27 @@
#
-# spec file for package perl-Archive-Zip (Version 1.23)
+# spec file for package perl-Archive-Zip (Version 1.24)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
+
Name: perl-Archive-Zip
Url: http://cpan.org/modules/by-module/Archive/
BuildRequires: perl-Compress-Zlib zip
-Version: 1.23
+Version: 1.24
Release: 1
Requires: perl = %{perl_version}
AutoReqProv: on
@@ -62,21 +70,29 @@
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT
+
%changelog
-* Fri Nov 09 2007 - anicka@suse.cz
+* Wed Sep 10 2008 anicka@suse.cz
+- update to 1.24
+ * Blatantly pander to CPANTS by adding use strict to a deprecated
+ module
+ * Add an explicit load of FileHandle since in some circumstances,
+ calling GLOB->print() failed.
+ * bugfixes
+* Fri Nov 09 2007 anicka@suse.cz
- update to 1.23
* Temporarily skilling some failing tests on Win32 in the
interests of toolchain sanity. (until we work out the
real problem here)
* Fixing platform compatibility bugs in the new regression tests
from 1.21.
-* Thu Nov 01 2007 - anicka@suse.cz
+* Thu Nov 01 2007 anicka@suse.cz
- update to 1.21
* Tidying up copyright formatting a bit.
* Disable the GPBF_HAS_DATA_DESCRIPTOR_MASK bit when
auto-switching directory storage to STORED
* bugfixes, test fixes
-* Mon Jun 11 2007 - anicka@suse.cz
+* Mon Jun 11 2007 anicka@suse.cz
- update to 1.20
* Removing dependency on File::Which due to public outburst
of flaming
@@ -85,9 +101,9 @@
of build_requires.
* Removing the docs directory.
- remove perl-File-Which from BuildRequires
-* Wed Dec 20 2006 - anicka@suse.cz
+* Wed Dec 20 2006 anicka@suse.cz
- add perl-File-Which to BuildRequires and enable tests again
-* Thu Dec 14 2006 - anicka@suse.cz
+* Thu Dec 14 2006 anicka@suse.cz
- update to 1.18
* Seperated the classes from the main file into seperate packages.
* Merged the Zip.pod into the main Zip.pm file.
@@ -109,33 +125,33 @@
* Added a BUGS section to the docs
* Moved crc32 to bin/crc32 in line with package layout conventions
- disable tests because they depend on File::Which
-* Wed Jan 25 2006 - mls@suse.de
+* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
-* Mon Jul 11 2005 - schubi@suse.de
+* Mon Jul 11 2005 schubi@suse.de
- update to version 1.16
-* Fri Apr 15 2005 - schubi@suse.de
+* Fri Apr 15 2005 schubi@suse.de
- update to most recent version 1.14
-* Thu Feb 26 2004 - choeger@suse.de
+* Thu Feb 26 2004 choeger@suse.de
- update to most recent version 1.09
-* Sun Jan 11 2004 - adrian@suse.de
+* Sun Jan 11 2004 adrian@suse.de
- build as user
-* Fri Aug 22 2003 - mjancar@suse.cz
+* Fri Aug 22 2003 mjancar@suse.cz
- require the perl version we build with
-* Thu Jul 17 2003 - choeger@suse.de
+* Thu Jul 17 2003 choeger@suse.de
- use install_vendor and new %%perl_process_packlist macro
-* Tue Jun 17 2003 - choeger@suse.de
+* Tue Jun 17 2003 choeger@suse.de
- updated filelist
-* Sun May 25 2003 - ro@suse.de
+* Mon May 26 2003 ro@suse.de
- remove unpackaged files from buildroot
-* Sat Feb 08 2003 - link@suse.de
+* Sat Feb 08 2003 link@suse.de
- updated to 1.05
-* Fri Jul 12 2002 - link@suse.de
+* Sat Jul 13 2002 link@suse.de
- some tweaks of the spec file
-* Fri Jul 12 2002 - link@suse.de
+* Fri Jul 12 2002 link@suse.de
- updated to 1.01
-* Tue May 07 2002 - link@suse.de
+* Wed May 08 2002 link@suse.de
- updated to 1.00
-* Thu Aug 16 2001 - ro@suse.de
+* Thu Aug 16 2001 ro@suse.de
- removed bogus Obsoletes
-* Fri Apr 06 2001 - link@suse.de
+* Fri Apr 06 2001 link@suse.de
- first package, v0.11
++++++ Archive-Zip-1.23.tar.bz2 -> Archive-Zip-1.24.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/Changes new/Archive-Zip-1.24/Changes
--- old/Archive-Zip-1.23/Changes 2007-11-07 14:02:22.000000000 +0100
+++ new/Archive-Zip-1.24/Changes 2008-08-24 01:33:53.000000000 +0200
@@ -1,4 +1,39 @@
-Revision history for Perl extension Archive::Zip
+Revision history for Perl extension Archive-Zip
+
+1.24 Sun 23 Aug 2008 - Adam Kennedy
+ - Blatantly pander to CPANTS by adding use strict to a deprecated module
+ - Add an explicit load of FileHandle since in some circumstances,
+ calling GLOB->print() failed.
+ - Fixed http://rt.cpan.org/Public/Bug/Display.html?id=25925 :
+ - Archive-Zip wrote faulty .zip files when $\ was set (such as when running
+ using perl -l).
+ - Incorporated a heavily modified version of ECARROLL's test file.
+ - Thanks for ECARROLL for reporting it, and helping with the investigation.
+ - The fix was to convert all $fh->print(@data) to $self->_print($fh, @data)
+ where the _print() method localizes $\ to undef.
+ - Fixed http://rt.cpan.org/Ticket/Display.html?id=14132 :
+ - Incorrect file permissions after extraction.
+ - Archive-Zip did not set the file permissions correctly in
+ extractToFileNamed().
+ - Added t/10_chmod.t and t/data/chmod.zip. Changed
+ lib/Archive/Zip/Member.pm.
+ - Reported by ak2 and jlv (Thanks!)
+ - SHLOMIF wrote the test script.
+ - (SHLOMIF)
+ - Removed a double "required module" from the Archive::Zip POD.
+ - Fixed http://rt.cpan.org/Ticket/Display.html?id=24557 ("documentation
+ improvement"):
+ - mentioned Archive::Zip::MemberRead in a few places.
+ - TODO:
+ - 1. Add a method to Archive::Zip to get a ::MemberRead from an
+ archive member using -> notation. (?)
+ - 2. In the POD of ::MemberRead - replace the indirect object
+ call.
+ - Changed the POD of ::MemberRead:
+ - replaced the indirect object construction with $PKG->new().
+ - Fixed http://rt.cpan.org/Public/Bug/Display.html?id=34103 :
+ - changed the example to read unless ( .. == AZ_OK) instead of
+ unless ( != AZ_OK), which was incorrect.
1.23 Thu 8 Nov 2007 - Adam Kennedy
- Temporarily skilling some failing tests on Win32 in the
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/Archive.pm new/Archive-Zip-1.24/lib/Archive/Zip/Archive.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/Archive.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/Archive.pm 2008-08-24 01:33:54.000000000 +0200
@@ -13,7 +13,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw( Archive::Zip );
}
@@ -362,7 +362,7 @@
sub _writeEndOfCentralDirectory {
my ( $self, $fh ) = @_;
- $fh->print(END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING)
+ $self->_print($fh, END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING)
or return _ioError('writing EOCD Signature');
my $zipfileCommentLength = length( $self->zipfileComment() );
@@ -376,10 +376,10 @@
$self->_writeCentralDirectoryOffset(),
$zipfileCommentLength
);
- $fh->print($header)
+ $self->_print($fh, $header)
or return _ioError('writing EOCD header');
if ($zipfileCommentLength) {
- $fh->print( $self->zipfileComment() )
+ $self->_print($fh, $self->zipfileComment() )
or return _ioError('writing zipfile comment');
}
return AZ_OK;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/BufferedFileHandle.pm new/Archive-Zip-1.24/lib/Archive/Zip/BufferedFileHandle.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/BufferedFileHandle.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/BufferedFileHandle.pm 2008-08-24 01:33:54.000000000 +0200
@@ -13,7 +13,7 @@
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
$VERSION = eval $VERSION;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/DirectoryMember.pm new/Archive-Zip-1.24/lib/Archive/Zip/DirectoryMember.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/DirectoryMember.pm 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/DirectoryMember.pm 2008-08-24 01:33:54.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw( Archive::Zip::Member );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/FileMember.pm new/Archive-Zip-1.24/lib/Archive/Zip/FileMember.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/FileMember.pm 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/FileMember.pm 2008-08-24 01:33:54.000000000 +0200
@@ -4,7 +4,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw ( Archive::Zip::Member );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/Member.pm new/Archive-Zip-1.24/lib/Archive/Zip/Member.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/Member.pm 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/Member.pm 2008-08-24 01:33:54.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw( Archive::Zip );
}
@@ -198,6 +198,7 @@
# TODO: map MS-DOS perms too (RHSA?)
}
+
# Convert ZIP permissions into Unix ones
#
# This was taken from Info-ZIP group's portable UnZip
@@ -389,6 +390,8 @@
return _ioError("Can't open file $name for write") unless $status;
my $retval = $self->extractToFileHandle($fh);
$fh->close();
+ chmod ($self->unixFileAttributes(), $name)
+ or return _error("Can't chmod() ${name}: $!");
utime( $self->lastModTime(), $self->lastModTime(), $name );
return $retval;
}
@@ -512,7 +515,7 @@
my $fh = shift;
my $signatureData = pack( SIGNATURE_FORMAT, LOCAL_FILE_HEADER_SIGNATURE );
- $fh->print($signatureData)
+ $self->_print($fh, $signatureData)
or return _ioError("writing local header signature");
my $header = pack(
@@ -528,13 +531,13 @@
length( $self->localExtraField() )
);
- $fh->print($header) or return _ioError("writing local header");
+ $self->_print($fh, $header) or return _ioError("writing local header");
if ( $self->fileName() ) {
- $fh->print( $self->fileName() )
+ $self->_print($fh, $self->fileName() )
or return _ioError("writing local header filename");
}
if ( $self->localExtraField() ) {
- $fh->print( $self->localExtraField() )
+ $self->_print($fh, $self->localExtraField() )
or return _ioError("writing local extra field");
}
@@ -547,7 +550,7 @@
my $sigData =
pack( SIGNATURE_FORMAT, CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE );
- $fh->print($sigData)
+ $self->_print($fh, $sigData)
or return _ioError("writing central directory header signature");
my $fileNameLength = length( $self->fileName() );
@@ -574,18 +577,18 @@
$self->writeLocalHeaderRelativeOffset()
);
- $fh->print($header)
+ $self->_print($fh, $header)
or return _ioError("writing central directory header");
if ($fileNameLength) {
- $fh->print( $self->fileName() )
+ $self->_print($fh, $self->fileName() )
or return _ioError("writing central directory header signature");
}
if ($extraFieldLength) {
- $fh->print( $self->cdExtraField() )
+ $self->_print($fh, $self->cdExtraField() )
or return _ioError("writing central directory extra field");
}
if ($fileCommentLength) {
- $fh->print( $self->fileComment() )
+ $self->_print($fh, $self->fileComment() )
or return _ioError("writing central directory file comment");
}
@@ -608,7 +611,7 @@
$self->uncompressedSize()
);
- $fh->print($header)
+ $self->_print($fh, $header)
or return _ioError("writing data descriptor");
return AZ_OK;
}
@@ -638,7 +641,7 @@
length( $self->localExtraField() )
);
- $fh->print($header)
+ $self->_print($fh, $header)
or return _ioError("re-writing local header");
$fh->seek( $here, IO::Seekable::SEEK_SET )
or return _ioError("seeking after rewrite of local header");
@@ -933,7 +936,7 @@
return $status if ( $status != AZ_OK and $status != AZ_STREAM_END );
if ( length($$outRef) > 0 ) {
- $writeFh->print($$outRef)
+ $self->_print($writeFh, $$outRef)
or return _ioError("write error during copy");
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/MemberRead.pm new/Archive-Zip-1.24/lib/Archive/Zip/MemberRead.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/MemberRead.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/MemberRead.pm 2008-08-24 01:33:54.000000000 +0200
@@ -10,8 +10,8 @@
use Archive::Zip;
use Archive::Zip::MemberRead;
- $zip = new Archive::Zip("file.zip");
- $fh = new Archive::Zip::MemberRead($zip, "subdir/abc.txt");
+ $zip = Archive::Zip->new("file.zip");
+ $fh = Archive::Zip::MemberRead->new($zip, "subdir/abc.txt");
while (defined($line = $fh->getline()))
{
print $fh->input_line_number . "#: $line\n";
@@ -40,7 +40,7 @@
my $nl;
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
$VERSION = eval $VERSION;
# Requirement for newline conversion. Should check for e.g., DOS and OS/2 as well, but am too lazy.
$nl = $^O eq 'MSWin32' ? "\r\n" : "\n";
@@ -279,7 +279,7 @@
Simulates a normal C system call.
Returns the no. of bytes read. C<undef> on error, 0 on eof, I:
- $fh = new Archive::Zip::MemberRead($zip, "sreeji/secrets.bin");
+ $fh = Archive::Zip::MemberRead->new($zip, "sreeji/secrets.bin");
while (1)
{
$read = $fh->read($buffer, 1024);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/MockFileHandle.pm new/Archive-Zip-1.24/lib/Archive/Zip/MockFileHandle.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/MockFileHandle.pm 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/MockFileHandle.pm 2008-08-24 01:33:54.000000000 +0200
@@ -10,7 +10,7 @@
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
$VERSION = eval $VERSION;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/NewFileMember.pm new/Archive-Zip-1.24/lib/Archive/Zip/NewFileMember.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/NewFileMember.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/NewFileMember.pm 2008-08-24 01:33:54.000000000 +0200
@@ -4,7 +4,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw ( Archive::Zip::FileMember );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/StringMember.pm new/Archive-Zip-1.24/lib/Archive/Zip/StringMember.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/StringMember.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/StringMember.pm 2008-08-24 01:33:54.000000000 +0200
@@ -4,7 +4,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw( Archive::Zip::Member );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/Tree.pm new/Archive-Zip-1.24/lib/Archive/Zip/Tree.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/Tree.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/Tree.pm 2008-08-24 01:33:54.000000000 +0200
@@ -1,10 +1,13 @@
-use Archive::Zip;
+package Archive::Zip::Tree;
+use strict;
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
}
+use Archive::Zip;
+
warn(
"Archive::Zip::Tree is deprecated; its methods have been moved into Archive::Zip."
) if $^W;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip/ZipFileMember.pm new/Archive-Zip-1.24/lib/Archive/Zip/ZipFileMember.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip/ZipFileMember.pm 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip/ZipFileMember.pm 2008-08-24 01:33:54.000000000 +0200
@@ -4,7 +4,7 @@
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
@ISA = qw ( Archive::Zip::FileMember );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/lib/Archive/Zip.pm new/Archive-Zip-1.24/lib/Archive/Zip.pm
--- old/Archive-Zip-1.23/lib/Archive/Zip.pm 2007-11-07 14:02:23.000000000 +0100
+++ new/Archive-Zip-1.24/lib/Archive/Zip.pm 2008-08-24 01:33:54.000000000 +0200
@@ -11,10 +11,11 @@
use Compress::Zlib ();
use File::Spec ();
use File::Temp ();
+use FileHandle ();
use vars qw( $VERSION @ISA );
BEGIN {
- $VERSION = '1.23';
+ $VERSION = '1.24';
require Exporter;
@ISA = qw( Exporter );
@@ -264,10 +265,12 @@
sub _ISA ($$) {
# Can't rely on Scalar::Util, so use the next best way
+ local $@;
!! eval { ref $_[0] and $_[0]->isa($_[1]) };
}
sub _CAN ($$) {
+ local $@;
!! eval { ref $_[0] and $_[0]->can($_[1]) };
}
@@ -390,6 +393,17 @@
) ? 1 : 0;
}
+# Print to the filehandle, while making sure the pesky Perl special global
+# variables don't interfere.
+sub _print
+{
+ my ($self, $fh, @data) = @_;
+
+ local $\;
+
+ return $fh->print(@data);
+}
+
# Return an opened IO::Handle
# my ( $status, fh ) = _newFileHandle( 'fileName', 'w' );
# Can take a filename, file handle, or ref to GLOB
@@ -404,13 +418,13 @@
if ( _ISA($fd, 'IO::Scalar') or _ISA($fd, 'IO::String') ) {
$handle = $fd;
} elsif ( _ISA($fd, 'IO::Handle') or ref($fd) eq 'GLOB' ) {
- $handle = IO::File->new();
+ $handle = IO::File->new;
$status = $handle->fdopen( $fd, @_ );
} else {
$handle = $fd;
}
} else {
- $handle = IO::File->new();
+ $handle = IO::File->new;
$status = $handle->open( $fd, @_ );
}
@@ -590,6 +604,9 @@
This module uses the LCompress::Zlib library to read and write the
compressed streams inside the files.
+One can use LArchive::Zip::MemberRead to read the zip file archive members
+as if they were files.
+
=head2 File Naming
Regardless of what your local file system uses for file naming, names in a
@@ -1210,7 +1227,7 @@
some operating systems, though.
my $fh = IO::File->new( 'someFile.zip', 'w' );
- unless ( $zip->writeToFileHandle( $fh ) != AZ_OK ) {
+ unless ( $zip->writeToFileHandle( $fh ) == AZ_OK ) {
# error handling
}
@@ -1936,8 +1953,6 @@
LFile::Spec
-LFile::Spec
-
LIO::File
LIO::Seekable
@@ -2009,17 +2024,20 @@
=head1 COPYRIGHT
-Copyright 2000 - 2004 Ned Konz.
+Some parts copyright 2006 - 2008 Adam Kennedy.
Some parts copyright 2005 Steve Peters.
-Some parts copyright 2006 - 2007 Adam Kennedy.
+Original work copyright 2000 - 2004 Ned Konz.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 SEE ALSO
+Look at LArchive::Zip::MemberRead which is a wrapper that allows one to
+read Zip archive members as if they were files.
+
LCompress::Zlib, LArchive::Tar, LArchive::Extract
There is a Japanese translation of this
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/Makefile.PL new/Archive-Zip-1.24/Makefile.PL
--- old/Archive-Zip-1.23/Makefile.PL 2007-11-07 14:02:22.000000000 +0100
+++ new/Archive-Zip-1.24/Makefile.PL 2008-08-24 01:33:53.000000000 +0200
@@ -12,7 +12,6 @@
EXE_FILES => [ 'bin/crc32' ],
PREREQ_PM => {
'Compress::Zlib' => '1.14',
- 'Carp' => 0,
# 'Data::Dumper' => 0, # examples/zipinfo.pl
'File::Path' => 0,
'File::Find' => 0,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/MANIFEST new/Archive-Zip-1.24/MANIFEST
--- old/Archive-Zip-1.23/MANIFEST 2007-11-07 14:02:49.000000000 +0100
+++ new/Archive-Zip-1.24/MANIFEST 2008-08-24 01:34:45.000000000 +0200
@@ -43,9 +43,13 @@
t/06_update.t
t/07_filenames_of_0.t
t/08_readmember_record_sep.t
+t/09_output_record_sep.t
+t/10_chmod.t
+t/97_meta.t
t/98_pod.t
t/99_pmv.t
t/badjpeg/expected.jpg
t/badjpeg/source.zip
t/common.pl
+t/data/chmod.zip
META.yml Module meta-data (added by MakeMaker)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/META.yml new/Archive-Zip-1.24/META.yml
--- old/Archive-Zip-1.23/META.yml 2007-11-07 14:02:49.000000000 +0100
+++ new/Archive-Zip-1.24/META.yml 2008-08-24 01:34:45.000000000 +0200
@@ -1,12 +1,13 @@
--- #YAML:1.0
name: Archive-Zip
-version: 1.23
+version: 1.24
abstract: Provide an interface to ZIP archive files.
license: perl
-generated_by: ExtUtils::MakeMaker version 6.32
+author:
+ - Ned Konz
+generated_by: ExtUtils::MakeMaker version 6.44
distribution_type: module
requires:
- Carp: 0
Compress::Zlib: 1.14
File::Basename: 0
File::Copy: 0
@@ -20,7 +21,5 @@
Test::More: 0.42
Time::Local: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-author:
- - Ned Konz
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/README new/Archive-Zip-1.24/README
--- old/Archive-Zip-1.23/README 2007-11-07 14:02:22.000000000 +0100
+++ new/Archive-Zip-1.24/README 2008-08-24 01:33:53.000000000 +0200
@@ -52,6 +52,9 @@
This module uses the Compress::Zlib library to read and write the
compressed streams inside the files.
+ One can use Archive::Zip::MemberRead to read the zip file archive
+ members as if they were files.
+
File Naming
Regardless of what your local file system uses for file naming, names in
a Zip file are in Unix format (*forward* slashes (/) separating
@@ -535,7 +538,7 @@
returns true. This could fail on some operating systems, though.
my $fh = IO::File->new( 'someFile.zip', 'w' );
- unless ( $zip->writeToFileHandle( $fh ) != AZ_OK ) {
+ unless ( $zip->writeToFileHandle( $fh ) == AZ_OK ) {
# error handling
}
@@ -1081,8 +1084,6 @@
File::Spec
- File::Spec
-
IO::File
IO::Seekable
@@ -1147,16 +1148,19 @@
Originally by Ned Konz .
COPYRIGHT
- Copyright 2000 - 2004 Ned Konz.
+ Some parts copyright 2006 - 2008 Adam Kennedy.
Some parts copyright 2005 Steve Peters.
- Some parts copyright 2006 - 2007 Adam Kennedy.
+ Original work copyright 2000 - 2004 Ned Konz.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
+ Look at Archive::Zip::MemberRead which is a wrapper that allows one to
+ read Zip archive members as if they were files.
+
Compress::Zlib, Archive::Tar, Archive::Extract
There is a Japanese translation of this document at
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/t/09_output_record_sep.t new/Archive-Zip-1.24/t/09_output_record_sep.t
--- old/Archive-Zip-1.23/t/09_output_record_sep.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Archive-Zip-1.24/t/09_output_record_sep.t 2008-08-24 01:33:55.000000000 +0200
@@ -0,0 +1,157 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Archive::Zip qw( :ERROR_CODES );
+use Digest::MD5;
+use Test::More tests => 6;
+use Carp;
+use File::Spec;
+use File::Spec::Unix;
+
+# TEST:$n=0
+
+my $expected_fn = File::Spec->catfile(
+ File::Spec->curdir(), "t", "badjpeg", "expected.jpg"
+);
+my $expected_zip = File::Spec::Unix->catfile(
+ File::Spec::Unix->curdir(), "t", "badjpeg", "expected.jpg",
+);
+
+my $got_fn = "got.jpg";
+
+my $archive_fn = "out.zip";
+
+
+my ( $before, $after );
+
+sub slurp_file
+{
+ my $filename = shift;
+
+ open ( my $fh, '<', $filename)
+ or die 'Can not open file';
+
+ my $contents;
+ binmode( $fh );
+ {
+ local $/;
+ $contents = <$fh>;
+ }
+ close $fh;
+
+ return $contents;
+}
+
+sub binary_is
+{
+ my ($got, $expected, $msg) = @_;
+
+ local $Test::Builder::Level = $Test::Builder::Level+1;
+
+ my $verdict = ($got eq $expected);
+
+ ok ($verdict, $msg);
+
+ if (!$verdict)
+ {
+ my $len;
+ if (length($got) > length($expected))
+ {
+ $len = length($expected);
+ diag("got is longer than expected");
+ }
+ elsif (length($got) < length($expected))
+ {
+ $len = length($got);
+ diag("expected is longer than got");
+ }
+ else
+ {
+ $len = length($got);
+ }
+
+ BYTE_LOOP:
+ for my $byte_idx (0 .. ($len-1))
+ {
+ my $got_byte = substr($got, $byte_idx, 1);
+ my $expected_byte = substr($expected, $byte_idx, 1);
+ if ($got_byte ne $expected_byte)
+ {
+ diag(
+ sprintf(
+ "Byte %i differ: got == 0x%.2x, expected == 0x%.2x",
+ $byte_idx, ord($got_byte), ord($expected_byte)
+ )
+ );
+ last BYTE_LOOP;
+ }
+ }
+ }
+}
+
+sub run_tests
+{
+ my $id = shift;
+
+ my $msg_it = sub {
+ my $msg_raw = shift;
+ return "$id - $msg_raw";
+ };
+
+ # Read the contents of the good file into the variable.
+ $before = slurp_file($expected_fn);
+
+ # Zip the file.
+ {
+ my $zip = Archive::Zip->new();
+ $zip->addFile( $expected_fn );
+ $zip->extractMember( $expected_zip, $got_fn );
+ $after = slurp_file($got_fn);
+
+ unlink $got_fn;
+
+ # TEST:$n=$n+1
+ binary_is(
+ $after, $before,
+ $msg_it->("Content of file after extraction"),
+ );
+
+ my $status = $zip->writeToFileNamed( $archive_fn );
+ # TEST:$n=$n+1
+ cmp_ok( $status, '==', AZ_OK, $msg_it->('Zip was written fine') );
+ }
+
+ # Read back the file from the archive.
+ {
+ my $zip2;
+ $zip2 = Archive::Zip->new( $archive_fn );
+
+ $zip2->extractMember( $expected_zip, $got_fn );
+
+ $after = slurp_file( $got_fn );
+
+ unlink $got_fn;
+ unlink $archive_fn;
+
+ # TEST:$n=$n+1
+ binary_is(
+ $after, $before,
+ $msg_it->('Read back the file from the archive'),
+ );
+ }
+}
+
+
+# Run the tests once with $\ undef.
+run_tests("Normal");
+# Run them once while setting $\.
+{
+ local $\ = "\n";
+ run_tests(q{$\ is \n});
+}
+
+# TEST*$n*2
+
+1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/t/10_chmod.t new/Archive-Zip-1.24/t/10_chmod.t
--- old/Archive-Zip-1.23/t/10_chmod.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Archive-Zip-1.24/t/10_chmod.t 2008-08-24 01:33:55.000000000 +0200
@@ -0,0 +1,80 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use File::Spec;
+use File::Path;
+
+use Archive::Zip;
+
+sub get_perm
+{
+ my $filename = shift;
+
+ return (((stat($filename))[2]) & 07777);
+}
+
+sub test_if_chmod_is_working
+{
+ my $test_dir = File::Spec->catdir(
+ File::Spec->curdir(), "testdir", "chtest"
+ );
+
+ my $test_file = File::Spec->catfile($test_dir, "test.file");
+
+ mkdir($test_dir, 0755);
+
+ open my $out, ">", $test_file;
+ print {$out} "Foobar.";
+ close($out);
+
+ my $test_perm = sub {
+ my $perm = shift;
+
+ chmod ($perm, $test_file);
+
+ return (get_perm($test_file) == $perm);
+ };
+
+ my $verdict = $test_perm->(0444) && $test_perm->(0666);
+
+ # Clean up
+ rmtree($test_dir);
+
+ return $verdict;
+}
+
+if (!test_if_chmod_is_working())
+{
+ plan skip_all => "chmod() is not working on this machine.";
+}
+else
+{
+ plan tests => 1;
+}
+
+my $zip = Archive::Zip->new();
+
+$zip->read(File::Spec->catfile(File::Spec->curdir(), "t", "data", "chmod.zip"));
+
+my $test_dir =
+ File::Spec->catdir(
+ File::Spec->curdir(), "testdir", "chtest"
+ );
+
+mkdir($test_dir, 0777);
+
+my $test_file = File::Spec->catfile($test_dir, "test_file");
+
+$zip->memberNamed("test_dir/test_file")->extractToFileNamed($test_file);
+
+# TEST
+is (get_perm($test_file),
+ 0444,
+ "File permission is OK."
+);
+
+# Clean up.
+rmtree($test_dir);
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/t/97_meta.t new/Archive-Zip-1.24/t/97_meta.t
--- old/Archive-Zip-1.23/t/97_meta.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Archive-Zip-1.24/t/97_meta.t 2008-08-24 01:33:55.000000000 +0200
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+# Test that our META.yml file matches the current specification.
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my $MODULE = 'Test::CPAN::Meta 0.12';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+}
+
+meta_yaml_ok();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/t/98_pod.t new/Archive-Zip-1.24/t/98_pod.t
--- old/Archive-Zip-1.23/t/98_pod.t 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/t/98_pod.t 2008-08-24 01:33:55.000000000 +0200
@@ -1,67 +1,32 @@
#!/usr/bin/perl
+# Test that the syntax of our POD documentation is valid
+
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
-use Test::More;
-
-# Skip if doing a regular install
-unless ( $ENV{AUTOMATED_TESTING} ) {
- plan( skip_all => "Author tests not required for installation" );
-}
-
-# Load the testing modules if we can
-eval "use Test::Pod 1.00";
-if ( $@ ) {
- plan( skip_all => "Test::Pod not available for testing" );
-}
-
-all_pod_files_ok();
-exit(0);
-
+my @MODULES = (
+ 'Pod::Simple 3.07',
+ 'Test::Pod 1.26',
+);
-
-
-#####################################################################
-# WARNING: INSANE BLACK MAGIC
-#####################################################################
-
-# Hack Pod::Simple::BlackBox to ignore the Test::Inline
-# "Extended Begin" syntax.
-# For example, "=begin has more than one word errors"
-my $begin;
-if ( $Test::Pod::VERSION ) {
- $begin = \&Pod::Simple::BlackBox::_ponder_begin;
-}
-sub mybegin {
- my $para = $_[1];
- my $content = join ' ', splice @$para, 2;
- $content =~ s/^\s+//s;
- $content =~ s/\s+$//s;
- my @words = split /\s+/, $content;
- if ( $words[0] =~ /^test(?:ing)?\z/s ) {
- foreach ( 2 .. $#$para ) {
- $para->[$_] = '';
- }
- $para->[2] = $words[0];
- }
-
- # Continue as normal
- push @$para, @words;
- return &$begin(@_);
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
}
-SCOPE: {
- local $^W = 0;
- if ( $Test::Pod::VERSION ) {
- *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+ eval "use $MODULE";
+ if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
}
}
-#####################################################################
-# END BLACK MAGIC
-#####################################################################
-
+all_pod_files_ok();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Archive-Zip-1.23/t/99_pmv.t new/Archive-Zip-1.24/t/99_pmv.t
--- old/Archive-Zip-1.23/t/99_pmv.t 2007-11-07 14:02:24.000000000 +0100
+++ new/Archive-Zip-1.24/t/99_pmv.t 2008-08-24 01:33:54.000000000 +0200
@@ -1,22 +1,27 @@
#!/usr/bin/perl
+# Test that our declared minimum Perl version matches our syntax
+
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
-use Test::More;
-# Skip if doing a regular install
-unless ( $ENV{AUTOMATED_TESTING} ) {
+my $MODULE = 'Test::MinimumVersion 0.008';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
plan( skip_all => "Author tests not required for installation" );
}
-# Can we run the version tests
-eval "use Test::MinimumVersion 0.007;";
+# Load the testing module
+eval "use $MODULE";
if ( $@ ) {
- plan( skip_all => "Test::MinimumVersion not available" );
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
}
-# Test minimum version
all_minimum_version_from_metayml_ok();
Files old/Archive-Zip-1.23/t/data/chmod.zip and new/Archive-Zip-1.24/t/data/chmod.zip differ
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org