"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Archive/Tar.pm" between
Archive-Tar-2.36.tar.gz and Archive-Tar-2.38.tar.gz

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

Tar.pm  (Archive-Tar-2.36):Tar.pm  (Archive-Tar-2.38)
skipping to change at line 34 skipping to change at line 34
use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD
$DO_NOT_USE_PREFIX $HAS_PERLIO $HAS_IO_STRING $SAME_PERMISSIONS $DO_NOT_USE_PREFIX $HAS_PERLIO $HAS_IO_STRING $SAME_PERMISSIONS
$INSECURE_EXTRACT_MODE $ZERO_PAD_NUMBERS @ISA @EXPORT $RESOLVE_SYMLI NK $INSECURE_EXTRACT_MODE $ZERO_PAD_NUMBERS @ISA @EXPORT $RESOLVE_SYMLI NK
]; ];
@ISA = qw[Exporter]; @ISA = qw[Exporter];
@EXPORT = qw[ COMPRESS_GZIP COMPRESS_BZIP COMPRESS_XZ ]; @EXPORT = qw[ COMPRESS_GZIP COMPRESS_BZIP COMPRESS_XZ ];
$DEBUG = 0; $DEBUG = 0;
$WARN = 1; $WARN = 1;
$FOLLOW_SYMLINK = 0; $FOLLOW_SYMLINK = 0;
$VERSION = "2.36"; $VERSION = "2.38";
$CHOWN = 1; $CHOWN = 1;
$CHMOD = 1; $CHMOD = 1;
$SAME_PERMISSIONS = $> == 0 ? 1 : 0; $SAME_PERMISSIONS = $> == 0 ? 1 : 0;
$DO_NOT_USE_PREFIX = 0; $DO_NOT_USE_PREFIX = 0;
$INSECURE_EXTRACT_MODE = 0; $INSECURE_EXTRACT_MODE = 0;
$ZERO_PAD_NUMBERS = 0; $ZERO_PAD_NUMBERS = 0;
$RESOLVE_SYMLINK = $ENV{'PERL5_AT_RESOLVE_SYMLINK'} || 'speed'; $RESOLVE_SYMLINK = $ENV{'PERL5_AT_RESOLVE_SYMLINK'} || 'speed';
BEGIN { BEGIN {
use Config; use Config;
$HAS_PERLIO = $Config::Config{useperlio}; $HAS_PERLIO = $Config::Config{useperlio};
### try and load IO::String anyway, so you can dynamically ### try and load IO::String anyway, so you can dynamically
### switch between perlio and IO::String ### switch between perlio and IO::String
$HAS_IO_STRING = eval { $HAS_IO_STRING = eval {
require IO::String; require IO::String;
import IO::String; IO::String->import;
1; 1;
} || 0; } || 0;
} }
=head1 NAME =head1 NAME
Archive::Tar - module for manipulations of tar archives Archive::Tar - module for manipulations of tar archives
=head1 SYNOPSIS =head1 SYNOPSIS
skipping to change at line 920 skipping to change at line 920
### only update the timestamp if it's not a symlink; that will change the ### only update the timestamp if it's not a symlink; that will change the
### timestamp of the original. This addresses bug #33669: Could not update ### timestamp of the original. This addresses bug #33669: Could not update
### timestamp warning on symlinks ### timestamp warning on symlinks
if( not -l $full ) { if( not -l $full ) {
utime time, $entry->mtime - TIME_OFFSET, $full or utime time, $entry->mtime - TIME_OFFSET, $full or
$self->_error( qq[Could not update timestamp] ); $self->_error( qq[Could not update timestamp] );
} }
if( $CHOWN && CAN_CHOWN->() and not -l $full ) { if( $CHOWN && CAN_CHOWN->() and not -l $full ) {
chown $entry->uid, $entry->gid, $full or CORE::chown( $entry->uid, $entry->gid, $full ) or
$self->_error( qq[Could not set uid/gid on '$full'] ); $self->_error( qq[Could not set uid/gid on '$full'] );
} }
### only chmod if we're allowed to, but never chmod symlinks, since they'll ### only chmod if we're allowed to, but never chmod symlinks, since they'll
### change the perms on the file they're linking too... ### change the perms on the file they're linking too...
if( $CHMOD and not -l $full ) { if( $CHMOD and not -l $full ) {
my $mode = $entry->mode; my $mode = $entry->mode;
unless ($SAME_PERMISSIONS) { unless ($SAME_PERMISSIONS) {
$mode &= ~(oct(7000) | umask); $mode &= ~(oct(7000) | umask);
} }
chmod $mode, $full or CORE::chmod( $mode, $full ) or
$self->_error( qq[Could not chown '$full' to ] . $entry->mode ); $self->_error( qq[Could not chown '$full' to ] . $entry->mode );
} }
return 1; return 1;
} }
sub _make_special_file { sub _make_special_file {
my $self = shift; my $self = shift;
my $entry = shift or return; my $entry = shift or return;
my $file = shift; return unless defined $file; my $file = shift; return unless defined $file;
skipping to change at line 2282 skipping to change at line 2282
open F, "gunzip -c $filename |"; open F, "gunzip -c $filename |";
my $tar = Archive::Tar->new(*F); my $tar = Archive::Tar->new(*F);
... ...
Similarly, if the C<compress> program is available, you can use this to Similarly, if the C<compress> program is available, you can use this to
write a C<.tar.Z> file write a C<.tar.Z> file
use Archive::Tar; use Archive::Tar;
use IO::File; use IO::File;
my $fh = new IO::File "| compress -c >$filename"; my $fh = IO::File->new( "| compress -c >$filename" );
my $tar = Archive::Tar->new(); my $tar = Archive::Tar->new();
... ...
$tar->write($fh); $tar->write($fh);
$fh->close ; $fh->close ;
=item How do I handle Unicode strings? =item How do I handle Unicode strings?
C<Archive::Tar> uses byte semantics for any files it reads from or writes C<Archive::Tar> uses byte semantics for any files it reads from or writes
to disk. This is not a problem if you only deal with files and never to disk. This is not a problem if you only deal with files and never
look at their content or work solely with byte strings. But if you use look at their content or work solely with byte strings. But if you use
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

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