diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-05-31 11:39:34 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-06-15 14:33:48 +0100 |
commit | a1ba8df233018d5d0724c6752c78a964146b01d6 (patch) | |
tree | 4cb9754552c600c0a2493bee4dca0f959dae0bbe /cpan | |
parent | be722aee897d208967b54b034afdb0d0e896523c (diff) | |
download | perl-a1ba8df233018d5d0724c6752c78a964146b01d6.tar.gz |
Update Archive-Tar to CPAN version 1.86
[DELTA]
* important changes in version 1.86 24/05/2012 (Mark Allen)
- don't use tell on IO::Zlib handles RT#64339
* important changes in version 1.84 02/03/2012 (HMBRAND)
- ptar now supports -T option [rt#75473]
- ptar now supports dashless options [rt#75475]
- auto-encode filenames marked as UTF-8 [rt#75474]
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Archive-Tar/bin/ptar | 23 | ||||
-rw-r--r-- | cpan/Archive-Tar/lib/Archive/Tar.pm | 19 | ||||
-rw-r--r-- | cpan/Archive-Tar/lib/Archive/Tar/Constant.pm | 2 | ||||
-rw-r--r-- | cpan/Archive-Tar/lib/Archive/Tar/File.pm | 2 |
4 files changed, 38 insertions, 8 deletions
diff --git a/cpan/Archive-Tar/bin/ptar b/cpan/Archive-Tar/bin/ptar index 14c09128fc..0eaffa7ccb 100644 --- a/cpan/Archive-Tar/bin/ptar +++ b/cpan/Archive-Tar/bin/ptar @@ -6,8 +6,13 @@ use Getopt::Std; use Archive::Tar; use Data::Dumper; +# Allow historic support for dashless bundled options +# tar cvf file.tar +# is valid (GNU) tar style +@ARGV && $ARGV[0] =~ m/^[DdcvzthxIC]+[fT]?$/ and + unshift @ARGV, map { "-$_" } split m// => shift @ARGV; my $opts = {}; -getopts('Ddcvzthxf:IC', $opts) or die usage(); +getopts('Ddcvzthxf:ICT:', $opts) or die usage(); ### show the help message ### die usage() if $opts->{h}; @@ -28,11 +33,21 @@ my $verbose = $opts->{v} ? 1 : 0; my $file = $opts->{f} ? $opts->{f} : 'default.tar'; my $tar = Archive::Tar->new(); - if( $opts->{c} ) { my @files; + my @src = @ARGV; + if( $opts->{T} ) { + if( $opts->{T} eq "-" ) { + chomp( @src = <STDIN> ); + } elsif( open my $fh, "<", $opts->{T} ) { + chomp( @src = <$fh> ); + } else { + die "$0: $opts->{T}: $!\n"; + } + } + find( sub { push @files, $File::Find::name; - print $File::Find::name.$/ if $verbose }, @ARGV ); + print $File::Find::name.$/ if $verbose }, @src ); if ($file eq '-') { use IO::Handle; @@ -88,6 +103,7 @@ sub usage { =head1 SYNOPSIS ptar -c [-v] [-z] [-C] [-f ARCHIVE_FILE | -] FILE FILE ... + ptar -c [-v] [-z] [-C] [-T index | -] [-f ARCHIVE_FILE | -] ptar -x [-v] [-z] [-f ARCHIVE_FILE | -] ptar -t [-z] [-f ARCHIVE_FILE | -] ptar -h @@ -102,6 +118,7 @@ sub usage { v Print filenames as they are added or extracted from ARCHIVE_FILE h Prints this help message C CPAN mode - drop 022 from permissions + T get names to create from file =head1 SEE ALSO diff --git a/cpan/Archive-Tar/lib/Archive/Tar.pm b/cpan/Archive-Tar/lib/Archive/Tar.pm index 4ed3ae0386..68867cb91d 100644 --- a/cpan/Archive-Tar/lib/Archive/Tar.pm +++ b/cpan/Archive-Tar/lib/Archive/Tar.pm @@ -31,7 +31,7 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD $DEBUG = 0; $WARN = 1; $FOLLOW_SYMLINK = 0; -$VERSION = "1.82"; +$VERSION = "1.86"; $CHOWN = 1; $CHMOD = 1; $SAME_PERMISSIONS = $> == 0 ? 1 : 0; @@ -335,8 +335,15 @@ sub _read_tar { LOOP: while( $handle->read( $chunk, HEAD ) ) { ### IO::Zlib doesn't support this yet - my $offset = eval { tell $handle } || 'unknown'; - $@ = ''; + my $offset; + if ( ref($handle) ne 'IO::Zlib' ) { + local $@; + $offset = eval { tell $handle } || 'unknown'; + $@ = ''; + } + else { + $offset = 'unknown'; + } unless( $read++ ) { my $gzip = GZIP_MAGIC_NUM; @@ -1451,6 +1458,12 @@ sub add_files { next; } + eval { + if( utf8::is_utf8( $file )) { + utf8::encode( $file ); + } + }; + unless( -e $file || -l $file ) { $self->_error( qq[No such file: '$file'] ); next; diff --git a/cpan/Archive-Tar/lib/Archive/Tar/Constant.pm b/cpan/Archive-Tar/lib/Archive/Tar/Constant.pm index 1bea5ce12d..7ea99ec023 100644 --- a/cpan/Archive-Tar/lib/Archive/Tar/Constant.pm +++ b/cpan/Archive-Tar/lib/Archive/Tar/Constant.pm @@ -3,7 +3,7 @@ package Archive::Tar::Constant; BEGIN { require Exporter; - $VERSION = '1.82'; + $VERSION = '1.86'; @ISA = qw[Exporter]; require Time::Local if $^O eq "MacOS"; diff --git a/cpan/Archive-Tar/lib/Archive/Tar/File.pm b/cpan/Archive-Tar/lib/Archive/Tar/File.pm index 9067de1086..83f109b071 100644 --- a/cpan/Archive-Tar/lib/Archive/Tar/File.pm +++ b/cpan/Archive-Tar/lib/Archive/Tar/File.pm @@ -13,7 +13,7 @@ use Archive::Tar::Constant; use vars qw[@ISA $VERSION]; #@ISA = qw[Archive::Tar]; -$VERSION = '1.82'; +$VERSION = '1.86'; ### set value to 1 to oct() it during the unpack ### |