Eliminate external call to tar executable in favour of Archive::Tar
authorMax Maischein <corion@corion.net>
Tue, 21 May 2013 17:09:47 +0000 (19:09 +0200)
committerDavid Golden <dagolden@cpan.org>
Tue, 21 May 2013 17:58:30 +0000 (13:58 -0400)
Archive::Tar has ->extract_archive, which does Just That. This means
we lose immediate support for bzip2 files, but not all
incarnations of `tar` support it either.

Signed-off-by: David Golden <dagolden@cpan.org>
Porting/sync-with-cpan

index b6ee246..ca3bedf 100755 (executable)
@@ -127,6 +127,7 @@ use 5.010;
 use strict;
 use warnings;
 use Getopt::Long;
+use Archive::Tar;
 
 $| = 1;
 
@@ -229,8 +230,8 @@ say "Cleaning out old directory";
 system git => 'clean', '-dfxq', $pkg_dir;
 
 say "Unpacking $new_file";
+Archive::Tar->extract_archive( $newfile );
 
-system tar => 'xfz', $new_file;
 (my $new_dir = $new_file) =~ s/\.tar\.gz//;
 # ensure 'make' will update all files
 system('find', $new_dir, '-exec', 'touch', '{}', ';');