Branch Coverage

lib/Archive/Extract.pm
Criterion Covered Total %
branch 144 280 51.4


line true false branch
18 0 1 $^O eq 'solaris' ? :
19 0 1 $^O =~ /^(netbsd|minix)$/ ? :
20 0 1 $^O =~ /^(openbsd|bitrig)$/ ? :
21 0 1 $^O =~ /^(free|midnight|dragonfly)(bsd)?$/ ? :
22 1 0 $^O eq 'linux' ? :
23 68 0 -e $_[0] ? :
26 0 1 $^O eq 'VMS' ? :
29 0 1 $^O eq 'MSWin32' ? :
186 570 3667 if @_
193 3 1 /.+?\.xz$/ ? :
10 4 /.+?\.(?:txz|tar\.xz)$/i ? :
3 14 /.+?\.lzma$/ ? :
3 17 /.+?\.Z$/ ? :
3 20 /.+?\.bz2$/i ? :
8 23 /.+?\.(?:tbz2?|tar\.bz2?)$/i ? :
27 31 /.+?\.(zip|jar|ear|war|par)$/i ? :
5 58 /.+?\.tar$/i ? :
3 63 /.+?\.gz$/i ? :
11 66 /.+?\.(?:tar\.gz|tgz)$/i ? :
284 0 68 unless my $parsed = check(\%utmpl, \%hash)
297 1 67 unless $parsed->{'type'}
359 1 96 unless check($tmpl, \%hash)
368 16 80 if ($self->is_gz or $self->is_bz2 or $self->is_Z or $self->is_lzma or $self->is_xz) { }
373 0 16 if (-d $to) { }
390 38 58 unless (-d $dir)
393 0 38 if $@
404 0 96 unless (Archive::Extract::chdir($dir))
422 38 58 if $Archive::Extract::_ALLOW_PURE_PERL
423 58 38 if $Archive::Extract::_ALLOW_BIN
426 0 96 if $Archive::Extract::PREFER_BIN
435 96 0 if ($rv and $rv ne [()]) { }
0 0 elsif ($rv and $rv eq [()]) { }
451 0 96 unless ($self->_extractor)
452 0 0 $na ? :
0 0 $fail ? :
462 0 96 unless (Archive::Extract::chdir($cwd))
583 52 0 if $Archive::Extract::PROGRAMS->{'gzip'}
584 0 0 if $Archive::Extract::PROGRAMS->{'unzip'}
585 144 0 if $Archive::Extract::PROGRAMS->{'tar'}
586 34 0 if $Archive::Extract::PROGRAMS->{'bunzip2'}
588 4 0 if $Archive::Extract::PROGRAMS->{'uncompress'}
589 4 0 if $Archive::Extract::PROGRAMS->{'unlzma'}
590 52 0 if $Archive::Extract::PROGRAMS->{'unxz'}
605 0 3 unless $self->bin_bunzip2
633 1 2 unless $buffer
637 0 2 if $version < 1
667 0 48 $self->is_txz && !$self->bin_unxz ? :
0 48 $self->is_tbz && !$self->bin_bunzip2 ? :
0 48 $self->is_tgz && !$self->bin_gzip ? :
0 48 !$self->bin_tar ? :
677 0 48 if ($diag)
697 16 8 $self->is_txz ? :
8 24 $self->is_tbz ? :
16 32 $self->is_tgz ? :
718 0 48 unless ($out[0])
725 24 24 if (not 'IPC::Cmd'->can_capture_buffer || $buffer) { }
752 16 8 $self->is_txz ? :
8 24 $self->is_tbz ? :
16 32 $self->is_tgz ? :
762 0 48 unless (scalar run('command', $cmd, 'buffer', \$buffer, 'verbose', $Archive::Extract::DEBUG))
771 48 0 if ($self->files)
802 0 32 unless (can_load('modules', $use_list))
817 16 16 if ($self->is_tgz) { }
8 8 elsif ($self->is_tbz) { }
0 8 elsif ($self->is_txz) { }
822 16 0 if eval { do { 'Archive::Tar'->VERSION('0.99'); 1 } }
825 0 16 unless (can_load('modules', $use_list))
838 0 8 unless (can_load('modules', $use_list))
848 0 8 unless my $bz = 'IO::Uncompress::Bunzip2'->new($self->archive)
856 0 0 unless (can_load('modules', $use_list))
866 0 0 unless my $xz = 'IO::Uncompress::UnXz'->new($self->archive)
882 16 16 $self->is_tgz ? :
888 16 16 if ($Archive::Extract::_ALLOW_TAR_ITER and 'Archive::Tar'->can('iter')) { }
891 0 16 unless ($next = 'Archive::Tar'->iter(@read))
900 0 26 unless $file->extract
911 0 16 unless ($tar->read(@read))
930 0 16 unless $tar->extract
948 32 0 if -d $self->extract_path
965 0 2 unless ($self->bin_gzip)
970 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
977 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
986 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
990 0 2 if defined $buffer
1005 0 4 unless (can_load('modules', $use_list))
1011 0 4 unless my $gz = &Compress::Zlib::gzopen($self->archive, 'rb')
1015 0 4 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1040 0 2 unless ($self->bin_uncompress)
1045 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1052 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1061 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1065 1 1 if defined $buffer
1088 0 0 unless ($self->bin_unzip)
1101 0 0 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1110 0 0 if (not 'IPC::Cmd'->can_capture_buffer || $buffer) { }
1126 0 0 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1134 0 0 if (scalar @{$self->files;})
1149 0 0 unless (can_load('modules', $use_list))
1157 0 0 unless ($zip->read($self->archive) == &Archive::Zip::AZ_OK)
1186 0 0 unless ($zip->extractMember($member, $to) == &Archive::Zip::AZ_OK)
1205 24 58 unless scalar @$files
1215 36 80 -d $files->[$pos] ? :
1227 58 0 if ($dir1 eq $dir2) { }
1236 0 0 $base1 eq $base2 ? :
1252 0 2 unless ($self->bin_bunzip2)
1257 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1263 0 2 if ($self->have_old_bunzip2 and not $self->archive =~ /\.bz2$/i)
1272 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1281 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1285 0 2 if defined $buffer
1332 0 2 unless (can_load('modules', $use_list))
1339 0 2 unless IO::Uncompress::Bunzip2::bunzip2($self->archive, $self->_gunzip_to)
1361 0 2 unless ($self->bin_unxz)
1366 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1373 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1382 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1386 0 2 if defined $buffer
1401 0 0 unless (can_load('modules', $use_list))
1408 0 0 unless IO::Uncompress::UnXz::unxz($self->archive, $self->_gunzip_to)
1431 0 2 unless ($self->bin_unlzma)
1436 0 2 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1443 0 2 unless (scalar run('command', $cmd, 'verbose', $Archive::Extract::DEBUG, 'buffer', \$buffer))
1452 1 0 unless ('IPC::Cmd'->can_capture_buffer or $buffer)
1456 0 2 if defined $buffer
1473 0 0 if (can_load('modules', $use_list1)) { }
0 0 elsif (can_load('modules', $use_list2)) { }
1474 0 0 unless IO::Uncompress::UnLzma::unlzma($self->archive, $self->_gunzip_to)
1481 0 0 unless my $fh = 'FileHandle'->new('>' . $self->_gunzip_to)
1487 0 0 unless (defined $buffer)
1492 0 0 if defined $buffer
1522 0 0 unless open my $file, '<', $unzip
1527 0 0 if (/[[:print:]]/)
1531 0 0 if ($buf and /[^[:print:]]/)
1532 0 0 if length $buf >= 4
1538 0 0 if $buf
1540 0 0 if ($part =~ /ZIPINFO/ or $part =~ /usage:.+?Z1/)
1572 1 34 if ($Archive::Extract::WARN)
1573 0 1 $Archive::Extract::DEBUG ? :
1602 192 0 unless $Archive::Extract::DEBUG
1609 0 24 unless my $file = shift()
1616 0 5 unless my $file = shift()