summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Archive/Extract.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Archive/Extract.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Archive/Extract.pm27
1 files changed, 20 insertions, 7 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