]> iEval git - zeal.git/commitdiff
Chdir manually in _unpack_tar_to_dir instead of using tar -C
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 14 Feb 2015 21:58:26 +0000 (23:58 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 14 Feb 2015 21:58:26 +0000 (23:58 +0200)
lib/Zeal/Feed.pm

index 5964cfe878472255c681e249344d1565c3210485..b4bbc521437d6649a1e36e28b8f4ccebc7eb07dd 100644 (file)
@@ -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 {
This page took 0.023515 seconds and 4 git commands to generate.