diff options
author | Jos I. Boumans <jos@dwim.org> | 2009-03-05 17:24:05 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-03-05 17:24:05 +0100 |
commit | bef46b70a2ecc24f7978a352079836f3e02b53bd (patch) | |
tree | 44c2f687979594b263319441cc669f257aca1efc /lib | |
parent | 86840a9d37bad06010aafcf6aa5b64c692196f0d (diff) | |
download | perl-bef46b70a2ecc24f7978a352079836f3e02b53bd.tar.gz |
Update Archive::Tar to 1.46
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Archive/Tar.pm | 16 | ||||
-rw-r--r-- | lib/Archive/Tar/File.pm | 9 | ||||
-rw-r--r-- | lib/Archive/Tar/t/04_resolved_issues.t | 17 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/header/signed.tar.packed | 243 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/long/bar.tar.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/long/foo.tbz.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/long/foo.tgz.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/short/bar.tar.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/short/foo.tbz.packed | 2 | ||||
-rw-r--r-- | lib/Archive/Tar/t/src/short/foo.tgz.packed | 2 |
12 files changed, 283 insertions, 18 deletions
diff --git a/lib/Archive/Tar.pm b/lib/Archive/Tar.pm index db46367476..09dab10581 100644 --- a/lib/Archive/Tar.pm +++ b/lib/Archive/Tar.pm @@ -27,11 +27,11 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD ]; @ISA = qw[Exporter]; -@EXPORT = ( COMPRESS_GZIP, COMPRESS_BZIP ); +@EXPORT = qw[ COMPRESS_GZIP COMPRESS_BZIP ]; $DEBUG = 0; $WARN = 1; $FOLLOW_SYMLINK = 0; -$VERSION = "1.44"; +$VERSION = "1.46"; $CHOWN = 1; $CHMOD = 1; $DO_NOT_USE_PREFIX = 0; @@ -68,8 +68,8 @@ Archive::Tar - module for manipulations of tar archives $tar->rename('oldname', 'new/file/name'); $tar->write('files.tar'); # plain tar - $tar->write('files.tgz', COMPRESSED_GZIP); # gzip compressed - $tar->write('files.tbz', COMPRESSED_BZIP); # bzip2 compressed + $tar->write('files.tgz', COMPRESS_GZIP); # gzip compressed + $tar->write('files.tbz', COMPRESS_BZIP); # bzip2 compressed =head1 DESCRIPTION @@ -1073,10 +1073,10 @@ to be the C<gzip> compression level (between 1 and 9), but the use of constants is prefered: # write a gzip compressed file - $tar->write( 'out.tgz', COMPRESSION_GZIP ); + $tar->write( 'out.tgz', COMPRESS_GZIP ); # write a bzip compressed file - $tar->write( 'out.tbz', COMPRESSION_BZIP ); + $tar->write( 'out.tbz', COMPRESS_BZIP ); Note that when you pass in a filehandle, the compression argument is ignored, as all files are printed verbatim to your filehandle. @@ -1503,10 +1503,10 @@ to be the C<gzip> compression level (between 1 and 9), but the use of constants is prefered: # write a gzip compressed file - Archive::Tar->create_archive( 'out.tgz', COMPRESSION_GZIP, @filelist ); + Archive::Tar->create_archive( 'out.tgz', COMPRESS_GZIP, @filelist ); # write a bzip compressed file - Archive::Tar->create_archive( 'out.tbz', COMPRESSION_BZIP, @filelist ); + Archive::Tar->create_archive( 'out.tbz', COMPRESS_BZIP, @filelist ); Note that when you pass in a filehandle, the compression argument is ignored, as all files are printed verbatim to your filehandle. diff --git a/lib/Archive/Tar/File.pm b/lib/Archive/Tar/File.pm index ead236fdee..ee5e120be4 100644 --- a/lib/Archive/Tar/File.pm +++ b/lib/Archive/Tar/File.pm @@ -492,7 +492,14 @@ sub validate { ### don't know why this one is different from the one we /write/ ### substr ($raw, 148, 8) = " "; - return unpack ("%16C*", $raw) == $self->chksum ? 1 : 0; + + ### bug #43513: [PATCH] Accept wrong checksums from SunOS and HP-UX tar + ### like GNU tar does. See here for details: + ### http://www.gnu.org/software/tar/manual/tar.html#SEC139 + ### so we do both a signed AND unsigned validate. if one succeeds, that's + ### good enough + return ( (unpack ("%16C*", $raw) == $self->chksum) + or (unpack ("%16c*", $raw) == $self->chksum)) ? 1 : 0; } =head2 $bool = $file->has_content diff --git a/lib/Archive/Tar/t/04_resolved_issues.t b/lib/Archive/Tar/t/04_resolved_issues.t index eba271f8d2..89756cdeac 100644 --- a/lib/Archive/Tar/t/04_resolved_issues.t +++ b/lib/Archive/Tar/t/04_resolved_issues.t @@ -149,6 +149,21 @@ use_ok( $FileClass ); ### and clean up unless( $NO_UNLINK ) { 1 while unlink $out_file }; } - +} +### bug #43513: [PATCH] Accept wrong checksums from SunOS and HP-UX tar +### like GNU tar does. See here for details: +### http://www.gnu.org/software/tar/manual/tar.html#SEC139 +{ ok( 1, "Testing bug 43513" ); + + my $src = File::Spec->catfile( qw[src header signed.tar] ); + my $tar = $Class->new; + + isa_ok( $tar, $Class, " Object" ); + ok( $tar->read( $src ), " Read non-Posix file with signed Checksum" ); + + for my $file ( $tar->get_files ) { + ok( $file, " File object retrieved" ); + ok( $file->validate, " File validates" ); + } } diff --git a/lib/Archive/Tar/t/src/header/signed.tar.packed b/lib/Archive/Tar/t/src/header/signed.tar.packed new file mode 100644 index 0000000000..e8d5bc8dfe --- /dev/null +++ b/lib/Archive/Tar/t/src/header/signed.tar.packed @@ -0,0 +1,243 @@ +######################################################################### +This is a binary file that was packed with the 'uupacktool.pl' which +is included in the Perl distribution. + +To unpack this file use the following command: + + uupacktool.pl -u lib/Archive/Tar/t/src/header/signed.tar.packed lib/Archive/Tar/t/src/header/signed.tar + +To recreate it use the following command: + + uupacktool.pl -p lib/Archive/Tar/t/src/header/signed.tar lib/Archive/Tar/t/src/header/signed.tar.packed + +Created at Thu Mar 5 17:07:54 2009 +######################################################################### +__UU__ +MPZ3#I,.D```````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#8P,"``,3,S-#8W(``P,C,T,C`@`#`P,#`P,#`P,#`U +M(#$Q,34P,S(V-#(R(#`Q,#0V,2``,``````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!U<W1A<@`P,&YT>6YI +M````````````````````````````````````871K;W,````````````````` +M```````````````````P,#`P,#`@`#`P,#`P,"`````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````!T97-T"@`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +9```````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed b/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed index afaba77c6a..2cd09870cb 100644 --- a/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed +++ b/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed -Created at Tue Jan 20 14:58:16 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M;&EN:W1E<W0O;&EN:P`````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed b/lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed index 30cbed8986..50ecaebdc6 100644 --- a/lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed +++ b/lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed -Created at Tue Jan 20 14:58:16 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M;&EN:W1E<W0O;W)I9R\````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/long/bar.tar.packed b/lib/Archive/Tar/t/src/long/bar.tar.packed index 7eed4f8196..1379fee20f 100644 --- a/lib/Archive/Tar/t/src/long/bar.tar.packed +++ b/lib/Archive/Tar/t/src/long/bar.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/long/bar.tar lib/Archive/Tar/t/src/long/bar.tar.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M8P`````````````````````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/long/foo.tbz.packed b/lib/Archive/Tar/t/src/long/foo.tbz.packed index 418c0bc986..705f5bf744 100644 --- a/lib/Archive/Tar/t/src/long/foo.tbz.packed +++ b/lib/Archive/Tar/t/src/long/foo.tbz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tbz lib/Archive/Tar/t/src/long/foo.tbz.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M0EIH.3%!62936=873NT``9C_A._0`DA``_^`0`0)`._OGJ```40(,`%X9`8` diff --git a/lib/Archive/Tar/t/src/long/foo.tgz.packed b/lib/Archive/Tar/t/src/long/foo.tgz.packed index 05088ae47a..6de253c6b2 100644 --- a/lib/Archive/Tar/t/src/long/foo.tgz.packed +++ b/lib/Archive/Tar/t/src/long/foo.tgz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tgz lib/Archive/Tar/t/src/long/foo.tgz.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M'XL(`````````^W72VZ#,!`&8*]S"BY`F,$/MCT`ET")25`<D"A1Q.UKR*M1 diff --git a/lib/Archive/Tar/t/src/short/bar.tar.packed b/lib/Archive/Tar/t/src/short/bar.tar.packed index 5cad23543e..18399eb1db 100644 --- a/lib/Archive/Tar/t/src/short/bar.tar.packed +++ b/lib/Archive/Tar/t/src/short/bar.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/short/bar.tar lib/Archive/Tar/t/src/short/bar.tar.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M8P`````````````````````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/short/foo.tbz.packed b/lib/Archive/Tar/t/src/short/foo.tbz.packed index 3443d12935..ff0f7e4e56 100644 --- a/lib/Archive/Tar/t/src/short/foo.tbz.packed +++ b/lib/Archive/Tar/t/src/short/foo.tbz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tbz lib/Archive/Tar/t/src/short/foo.tbz.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M0EIH.3%!62936>GH,8X``)O[A.90`D!``'^```#O*1X```%`""``E(*JGDA# diff --git a/lib/Archive/Tar/t/src/short/foo.tgz.packed b/lib/Archive/Tar/t/src/short/foo.tgz.packed index ae190a779c..67af0ed06d 100644 --- a/lib/Archive/Tar/t/src/short/foo.tgz.packed +++ b/lib/Archive/Tar/t/src/short/foo.tgz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tgz lib/Archive/Tar/t/src/short/foo.tgz.packed -Created at Tue Jan 20 14:58:17 2009 +Created at Thu Mar 5 17:07:54 2009 ######################################################################### __UU__ M'XL(`````````^W300K",!"%X5GW%#G"3-JFYREJ080NJKU_A^A"$.RJ(\+_ |