"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/09_roundtrip.t" between
Archive-Tar-2.32.tar.gz and Archive-Tar-2.34.tar.gz

About: Archive-Tar is a Perl module for creation and in-memory manipulation of tar files.

09_roundtrip.t  (Archive-Tar-2.32):09_roundtrip.t  (Archive-Tar-2.34)
skipping to change at line 46 skipping to change at line 46
# Some contain only files # Some contain only files
# Others contain both files and directories # Others contain both files and directories
my @file_only_archives = ( my @file_only_archives = (
[qw( src short bar.tar )], [qw( src short bar.tar )],
); );
push @file_only_archives, [qw( src short foo.tgz )] push @file_only_archives, [qw( src short foo.tgz )]
if Archive::Tar->has_zlib_support; if Archive::Tar->has_zlib_support;
push @file_only_archives, [qw( src short foo.tbz )] push @file_only_archives, [qw( src short foo.tbz )]
if Archive::Tar->has_bzip2_support; if Archive::Tar->has_bzip2_support;
push @file_only_archives, [qw( src short foo.txz )]
if Archive::Tar->has_xz_support;
@file_only_archives = map File::Spec->catfile(@$_), @file_only_archives; @file_only_archives = map File::Spec->catfile(@$_), @file_only_archives;
my @file_and_directory_archives = ( my @file_and_directory_archives = (
[qw( src long bar.tar )], [qw( src long bar.tar )],
[qw( src linktest linktest_with_dir.tar )], [qw( src linktest linktest_with_dir.tar )],
); );
push @file_and_directory_archives, [qw( src long foo.tgz )] push @file_and_directory_archives, [qw( src long foo.tgz )]
if Archive::Tar->has_zlib_support; if Archive::Tar->has_zlib_support;
push @file_and_directory_archives, [qw( src long foo.tbz )] push @file_and_directory_archives, [qw( src long foo.tbz )]
skipping to change at line 76 skipping to change at line 78
# create a new tarball with the same content as the old one # create a new tarball with the same content as the old one
my $old = Archive::Tar->new($archive_name); my $old = Archive::Tar->new($archive_name);
my $new = Archive::Tar->new(); my $new = Archive::Tar->new();
$new->add_files( $old->get_files ); $new->add_files( $old->get_files );
# save differently if compressed # save differently if compressed
my $ext = ( split /\./, $archive_name )[-1]; my $ext = ( split /\./, $archive_name )[-1];
my @compress = my @compress =
$ext =~ /t?gz$/ ? (COMPRESS_GZIP) $ext =~ /t?gz$/ ? (COMPRESS_GZIP)
: $ext =~ /(tbz|bz2?)$/ ? (COMPRESS_BZIP) : $ext =~ /(tbz|bz2?)$/ ? (COMPRESS_BZIP)
: $ext =~ /(t?xz)$/ ? (COMPRESS_XZ)
: (); : ();
my ( $fh, $filename ) = tempfile( UNLINK => 1 ); my ( $fh, $filename ) = tempfile( UNLINK => 1 );
$new->write( $filename, @compress ); $new->write( $filename, @compress );
# read the archive again from disk # read the archive again from disk
$new = Archive::Tar->new($filename); $new = Archive::Tar->new($filename);
# compare list of files # compare list of files
is_deeply( is_deeply(
 End of changes. 2 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)