Update Archive-Tar to CPAN version 1.80
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 13 Oct 2011 19:32:28 +0000 (20:32 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 13 Oct 2011 19:32:28 +0000 (20:32 +0100)
  [DELTA]

  * important changes in version 1.80 13/10/2011
  - patch from Rocky Bernstein to add file chown() method [rt#71221]

Porting/Maintainers.pl
cpan/Archive-Tar/lib/Archive/Tar.pm
cpan/Archive-Tar/lib/Archive/Tar/Constant.pm
cpan/Archive-Tar/lib/Archive/Tar/File.pm
cpan/Archive-Tar/t/04_resolved_issues.t
pod/perldelta.pod

index b7d6115..52bc502 100755 (executable)
@@ -209,7 +209,7 @@ use File::Glob qw(:case);
     'Archive::Tar' =>
        {
        'MAINTAINER'    => 'kane',
-       'DISTRIBUTION'  => 'BINGOS/Archive-Tar-1.78.tar.gz',
+       'DISTRIBUTION'  => 'BINGOS/Archive-Tar-1.80.tar.gz',
        'FILES'         => q[cpan/Archive-Tar],
        'EXCLUDED'      => [ qw(Makefile.PL) ],
        'UPSTREAM'      => 'cpan',
index e279b44..65efb71 100644 (file)
@@ -31,7 +31,7 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD
 $DEBUG                  = 0;
 $WARN                   = 1;
 $FOLLOW_SYMLINK         = 0;
-$VERSION                = "1.78";
+$VERSION                = "1.80";
 $CHOWN                  = 1;
 $CHMOD                  = 1;
 $SAME_PERMISSIONS       = $> == 0 ? 1 : 0;
@@ -70,6 +70,7 @@ Archive::Tar - module for manipulations of tar archives
     $tar->rename('oldname', 'new/file/name');
     $tar->chown('/', 'root');
     $tar->chown('/', 'root:root');
+    $tar->chmod('/tmp', '1777');
 
     $tar->write('files.tar');                   # plain tar
     $tar->write('files.tgz', COMPRESS_GZIP);    # gzip compressed
@@ -1084,6 +1085,25 @@ sub rename {
     return $entry->rename( $new );
 }
 
+=head2 $tar->chmod( $file, $mode )
+
+Change mode of $file to $mode.
+
+Returns true on success and false on failure.
+
+=cut
+
+sub chmod {
+    my $self = shift;
+    my $file = shift; return unless defined $file;
+    my $mode = shift; return unless defined $mode && $mode =~ /^[0-7]{1,4}$/;
+    my @args = ("$mode");
+
+    my $entry = $self->_find_entry( $file ) or return;
+    my $x = $entry->chmod( @args );
+    return $x;
+}
+
 =head2 $tar->chown( $file, $uname [, $gname] )
 
 Change owner $file to $uname and $gname.
index 7a25f33..a01963f 100644 (file)
@@ -3,7 +3,7 @@ package Archive::Tar::Constant;
 BEGIN {
     require Exporter;
 
-    $VERSION    = '1.78';
+    $VERSION    = '1.80';
     @ISA        = qw[Exporter];
 
     require Time::Local if $^O eq "MacOS";
index b700090..3b6e26d 100644 (file)
@@ -13,7 +13,7 @@ use Archive::Tar::Constant;
 
 use vars qw[@ISA $VERSION];
 #@ISA        = qw[Archive::Tar];
-$VERSION    = '1.78';
+$VERSION    = '1.80';
 
 ### set value to 1 to oct() it during the unpack ###
 my $tmpl = [
@@ -587,6 +587,22 @@ sub rename {
        return 1;
 }
 
+=head2 $bool = $file->chmod $mode)
+
+Change mode of $file to $mode. The mode can be a string or a number
+which is interpreted as octal whether or not a leading 0 is given.
+
+Returns true on success and false on failure.
+
+=cut
+
+sub chmod {
+    my $self  = shift;
+    my $mode = shift; return unless defined $mode && $mode =~ /^[0-7]{1,4}$/;
+    $self->{mode} = oct($mode);
+    return 1;
+}
+
 =head2 $bool = $file->chown( $user [, $group])
 
 Change owner of $file to $user. If a $group is given that is changed
index 7c4dd7c..45b7a91 100644 (file)
@@ -110,6 +110,10 @@ use_ok( $FileClass );
 
     ok( $tar->add_files( $in_file ),
                                 "       Added '$in_file'" );
+
+    ok( $tar->chmod( $in_file, '1777'),
+                                "       chmod 177 $in_file" );
+
     ok( $tar->chown( $in_file, 'root' ),
                                 "       chown to root" );
 
index 99aa5c4..4e24e25 100644 (file)
@@ -236,7 +236,7 @@ XXX
 
 =item *
 
-L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
+L<Archive::Tar> has been upgraded from version 1.78 to version 1.80.
 
 =item *
 
@@ -247,7 +247,7 @@ L<Digest> has been upgraded from version 1.16 to version 1.17.
 L<DynaLoader> has been upgraded from version 1.13 to 1.14.
 
 It stopped exporting its symbols with the ExtUtils::ParseXS changes in
-5.15.2.  Now it exports them once more.  
+5.15.2.  Now it exports them once more.
 
 =item *
 
@@ -266,6 +266,10 @@ module can 'jump' out of @INC
 
 =item *
 
+L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
+
+=item *
+
 L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80.
 
 Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt.