diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-23 21:46:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-23 21:46:20 +0000 |
commit | 300c1eb6d37d46078d448d6d58938d5a80cd68ff (patch) | |
tree | 23a0a8b9f8f5460b405119c4d3c163d2d488ca5e /Master/tlpkg/tlperl/lib/Archive | |
parent | ed55d86b7c5e18f6eccce80a1fb1423ca40a23b5 (diff) |
(tl)perl 5.18.2 for windows from siep
git-svn-id: svn://tug.org/texlive/trunk@33648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Archive')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Archive/Extract.pm | 27 | ||||
-rw-r--r-- | Master/tlpkg/tlperl/lib/Archive/Tar.pm | 27 | ||||
-rw-r--r-- | Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm | 2 | ||||
-rw-r--r-- | Master/tlpkg/tlperl/lib/Archive/Tar/File.pm | 2 |
4 files changed, 42 insertions, 16 deletions
diff --git a/Master/tlpkg/tlperl/lib/Archive/Extract.pm b/Master/tlpkg/tlperl/lib/Archive/Extract.pm index 4a0727f6eeb..ae3af3edf82 100644 --- a/Master/tlpkg/tlperl/lib/Archive/Extract.pm +++ b/Master/tlpkg/tlperl/lib/Archive/Extract.pm @@ -1,4 +1,5 @@ package Archive::Extract; +use if $] > 5.017, 'deprecate'; use strict; @@ -16,7 +17,9 @@ use Locale::Maketext::Simple Style => 'gettext'; ### solaris has silly /bin/tar output ### use constant ON_SOLARIS => $^O eq 'solaris' ? 1 : 0; use constant ON_NETBSD => $^O eq 'netbsd' ? 1 : 0; -use constant ON_FREEBSD => $^O eq 'freebsd' ? 1 : 0; +use constant ON_OPENBSD => $^O eq 'openbsd' ? 1 : 0; +use constant ON_FREEBSD => $^O =~ m!^(free|midnight)bsd$! ? 1 : 0; +use constant ON_LINUX => $^O eq 'linux' ? 1 : 0; use constant FILE_EXISTS => sub { -e $_[0] ? 1 : 0 }; ### VMS may require quoting upper case command options @@ -45,7 +48,7 @@ use vars qw[$VERSION $PREFER_BIN $PROGRAMS $WARN $DEBUG $_ALLOW_BIN $_ALLOW_PURE_PERL $_ALLOW_TAR_ITER ]; -$VERSION = '0.58'; +$VERSION = '0.68'; $PREFER_BIN = 0; $WARN = 1; $DEBUG = 0; @@ -126,12 +129,22 @@ See the C<HOW IT WORKS> section further down for details. ### see what /bin/programs are available ### $PROGRAMS = {}; -for my $pgm (qw[tar unzip gzip bunzip2 uncompress unlzma unxz]) { +CMD: for my $pgm (qw[tar unzip gzip bunzip2 uncompress unlzma unxz]) { if ( $pgm eq 'unzip' and ( ON_NETBSD or ON_FREEBSD ) ) { local $IPC::Cmd::INSTANCES = 1; - my @possibles = can_run($pgm); ($PROGRAMS->{$pgm}) = grep { ON_NETBSD ? m!/usr/pkg/! : m!/usr/local! } can_run($pgm); - next; + next CMD; + } + if ( $pgm eq 'unzip' and ON_LINUX ) { + # Check if 'unzip' is busybox masquerading + local $IPC::Cmd::INSTANCES = 1; + my $opt = ON_VMS ? '"-Z"' : '-Z'; + ($PROGRAMS->{$pgm}) = grep { scalar run(command=> [ $_, $opt, '-1' ]) } can_run($pgm); + next CMD; + } + if ( $pgm eq 'tar' and ON_OPENBSD || ON_SOLARIS ) { + # try gtar first + next CMD if $PROGRAMS->{$pgm} = can_run('gtar'); } $PROGRAMS->{$pgm} = can_run($pgm); } @@ -647,7 +660,7 @@ sub have_old_bunzip2 { ### check for /bin/tar ### ### check for /bin/gzip if we need it ### ### if any of the binaries are not available, return NA - { my $diag = not $self->bin_tar ? + { my $diag = !$self->bin_tar ? loc("No '%1' program found", '/bin/tar') : $self->is_tgz && !$self->bin_gzip ? loc("No '%1' program found", '/bin/gzip') : @@ -1655,7 +1668,7 @@ thread safe. See C<rt.cpan.org> bug C<#45671> for details. =head1 BUG REPORTS -Please report bugs or other issues to E<lt>bug-archive-extract@rt.cpan.org<gt>. +Please report bugs or other issues to E<lt>bug-archive-extract@rt.cpan.orgE<gt>. =head1 AUTHOR diff --git a/Master/tlpkg/tlperl/lib/Archive/Tar.pm b/Master/tlpkg/tlperl/lib/Archive/Tar.pm index 4ed3ae0386e..dd4b968acd3 100644 --- a/Master/tlpkg/tlperl/lib/Archive/Tar.pm +++ b/Master/tlpkg/tlperl/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.90"; $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; @@ -867,7 +874,7 @@ sub _extract_file { $self->_error( qq[Could not update timestamp] ); } - if( $CHOWN && CAN_CHOWN->() ) { + if( $CHOWN && CAN_CHOWN->() and not -l $full ) { chown $entry->uid, $entry->gid, $full or $self->_error( qq[Could not set uid/gid on '$full'] ); } @@ -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; @@ -1482,8 +1495,8 @@ The following list of properties is supported: name, size, mtime devmajor, devminor, prefix, type. (On MacOS, the file's path and modification times are converted to Unix equivalents.) -Valid values for the file type are the following constants defined in -Archive::Tar::Constants: +Valid values for the file type are the following constants defined by +Archive::Tar::Constant: =over 4 @@ -1743,7 +1756,7 @@ If C<list_archive()> is passed an array reference as its third argument it returns a list of hash references containing the requested properties of each file. The following list of properties is supported: full_path, name, size, mtime (last modified date), mode, -uid, gid, linkname, uname, gname, devmajor, devminor, prefix. +uid, gid, linkname, uname, gname, devmajor, devminor, prefix, type. See C<Archive::Tar::File> for details about supported properties. diff --git a/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm b/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm index 1bea5ce12d7..7839c6dc5cb 100644 --- a/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm +++ b/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm @@ -3,7 +3,7 @@ package Archive::Tar::Constant; BEGIN { require Exporter; - $VERSION = '1.82'; + $VERSION = '1.90'; @ISA = qw[Exporter]; require Time::Local if $^O eq "MacOS"; diff --git a/Master/tlpkg/tlperl/lib/Archive/Tar/File.pm b/Master/tlpkg/tlperl/lib/Archive/Tar/File.pm index 9067de10863..de01e0513d4 100644 --- a/Master/tlpkg/tlperl/lib/Archive/Tar/File.pm +++ b/Master/tlpkg/tlperl/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.90'; ### set value to 1 to oct() it during the unpack ### |