sub _unpack_tar_to_dir {
my ($file, $dir) = @_;
+ $file = rel2abs $file;
+ my $oldwd = getcwd;
+ chdir $dir;
my $tar = which 'tar' or which 'gtar';
if ($tar && !$ENV{ZEAL_USE_INTERNAL_TAR}) {
my $arg = '-xf';
$arg = '-xzf' if $file =~ /[.]t?gz$/;
$arg = '-xjf' if $file =~ /[.]bz2$/;
- system $tar, -C => $dir, $arg => $file
+ system $tar, $arg => $file
} else {
- $file = rel2abs $file;
- my $oldwd = getcwd;
- chdir $dir;
Archive::Tar->extract_archive($file);
- chdir $oldwd;
}
+ chdir $oldwd;
}
sub download {