Chdir manually in _unpack_tar_to_dir instead of using tar -C
[zeal.git] / lib / Zeal / Feed.pm
index df306530ab818cbf68183738b84bf8396438f928..b4bbc521437d6649a1e36e28b8f4ccebc7eb07dd 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 use re '/s';
 
-our $VERSION = '0.000_002';
+our $VERSION = '0.001';
 
 use parent qw/Class::Accessor::Fast/;
 __PACKAGE__->mk_ro_accessors(qw/version/);
@@ -58,19 +58,19 @@ sub url {
 
 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 {
@@ -168,7 +168,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014 by Marius Gavrilescu
+Copyright (C) 2014-2015 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.20.1 or,
This page took 0.009747 seconds and 4 git commands to generate.