X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FZeal%2FFeed.pm;h=6c1ebc2416b08defc71d2eb1f9ba559d6d1996d8;hb=refs%2Ftags%2F0.001001;hp=df306530ab818cbf68183738b84bf8396438f928;hpb=164f653cb3a8ecfc674451034b4fd3fd10bfc6e0;p=zeal.git diff --git a/lib/Zeal/Feed.pm b/lib/Zeal/Feed.pm index df30653..6c1ebc2 100644 --- a/lib/Zeal/Feed.pm +++ b/lib/Zeal/Feed.pm @@ -5,7 +5,7 @@ use strict; use warnings; use re '/s'; -our $VERSION = '0.000_002'; +our $VERSION = '0.001001'; use parent qw/Class::Accessor::Fast/; __PACKAGE__->mk_ro_accessors(qw/version/); @@ -58,19 +58,24 @@ 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'; + + # uncoverable branch true + # uncoverable condition false + local $ENV{ZEAL_USE_INTERNAL_TAR} = 1 if $file =~ /gz$|bz2$/ && $^O eq 'solaris'; + 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 +173,7 @@ Marius Gavrilescu, Emarius@ieval.roE =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,