Archive-Tar-Wrapper
view release on metacpan or search on metacpan
0.22 2015-03-08
- (ms) Added tar_gnu_write_options option suggested by Csaba Major with
tests and docs.
0.21 2014-10-16
- (ms) [rt.cpan.org 87536] Setting default umask to get predictable test
results regardless of local umask settings.
0.20 2014-09-29
- (ms) Ignore errors on chown/chgrp when files from different owners/groups
are copied into a tarball, accept the limitation that they'll be
owned by the script user unless we're running as superuser.
0.19 2014-02-16
- (ms) RsrchBoy added support for bzip2-compressed tarfiles.
0.18 2013-07-15
- (ms) Moved to tmpdir() in t/002Mult.t because some smoke testers don't
like writing into t/data.
lib/Archive/Tar/Wrapper.pm view on Meta::CPAN
# perms will be fixed further down
mkpath( $target, 0, oct(755) ) unless -d $target;
}
else {
copy $path_or_stringref, $target
or LOGDIE "Can't copy $path_or_stringref to $target ($!)";
}
if ( defined $uid ) {
chown $uid, -1, $target
or LOGDIE "Can't chown $target uid to $uid ($!)";
}
if ( defined $gid ) {
chown -1, $gid, $target
or LOGDIE "Can't chown $target gid to $gid ($!)";
}
if ( defined $perm ) {
chmod $perm, $target
or LOGDIE "Can't chmod $target to $perm ($!)";
}
if ( not defined $uid
and not defined $gid
and not defined $perm
lib/Archive/Tar/Wrapper.pm view on Meta::CPAN
sub perm_get {
my ($filename) = @_;
my @stats = ( stat $filename )[ 2, 4, 5 ]
or LOGDIE "Cannot stat $filename ($!)";
return \@stats;
}
sub perm_set {
my ( $filename, $perms ) = @_;
chown( $perms->[1], $perms->[2], $filename );
chmod( $perms->[0] & oct(777), $filename )
or LOGDIE "Cannot chmod $filename ($!)";
return 1;
}
sub remove {
my ( $self, $rel_path ) = @_;
my $target = File::Spec->catfile( $self->{tardir}, $rel_path );
rmtree($target) or LOGDIE "Can't rmtree $target: $!";
return 1;
( run in 1.730 second using v1.01-cache-2.11-cpan-71847e10f99 )