Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Zip with system tar
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarrett committed Feb 22, 2019
1 parent ee07cea commit 08bd30e
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions script/ddgc_export_help.pl
Expand Up @@ -8,7 +8,6 @@
use File::Copy;
use IO::All -utf8;
use HTML::TreeBuilder::LibXML;
use Archive::Tar;
use File::Find;
use Try::Tiny;

Expand Down Expand Up @@ -55,12 +54,6 @@ sub _build_tarball {
catfile( $self->ddgc_dir, 'media', 'help-' . $self->now . '.tar.bz2' );
}

has archive_tar => ( is => 'lazy' );
sub _build_archive_tar {
my ( $self ) = @_;
Archive::Tar->new;
}

sub _mkdir {
my ( $self, @dir ) = @_;
my $d = catdir( @dir );
Expand Down Expand Up @@ -128,14 +121,9 @@ sub export_helps {

sub zip_helps {
my ( $self ) = @_;
my @files;
find (
sub { push @files, $File::Find::name },
$self->pkg_dir
);
$self->archive_tar->add_files( @files );
$self->archive_tar->write( $self->tarball, COMPRESS_BZIP )
and printf( "Wrote %s\n", $self->tarball );
chdir $self->pkg_dir;
system( qw/ tar cjf /, $self->tarball, '.' );
printf( "Wrote %s\n", $self->tarball ) unless $? != 0;
}

sub go {
Expand Down

0 comments on commit 08bd30e

Please sign in to comment.