Branch Coverage

blib/lib/MDV/Packdrakeng.pm
Criterion Covered Total %
branch 115 178 64.6


line true false branch
34 0 7 if (++$count > 10)
42 3 32 $_ > 25 && $_ < 32 ? :
93 0 16 defined $options{'comp_level'} ? :
0 16 defined $options{'block_size'} ? :
0 16 $options{'quiet'} ? :
0 16 $options{'debug'} ? :
101 0 8 unless (sysopen $$pack{'handle'}, $$pack{'filename'}, 577)
117 0 8 unless (sysopen $$pack{'handle'}, $$pack{'filename'}, 0)
121 0 8 unless $pack->read_toc
133 3 5 unless defined $$pack{'compress_method'} or defined $$pack{'uncompress_method'}
137 2 14 if ($test_method =~ /^bzip2|^bunzip2/)
140 12 4 if ($test_method =~ /^gzip|^gunzip/)
142 8 4 unless ($$pack{'force_extern'})
151 12 4 if (not $$pack{'noargs'})
153 12 0 $$pack{'compress_method'} ? :
159 0 16 if $$pack{'destroyed'}
163 0 16 unless $pack->build_toc == 1
164 16 0 if $$pack{'handle'}
165 0 16 if $$pack{'ustream_data'}{'handle'}
172 8 8 unless $$pack{'need_build_toc'}
174 0 8 unless ($pack->end_seek)
182 0 2 unless (my $w = syswrite($$pack{'handle'}, $entry . "\n"))
190 0 2 unless (my $w = syswrite($$pack{'handle'}, sprintf("%s\n%s\n", $entry, $$pack{'symlink'}{$entry})))
198 0 64 unless (my $w = syswrite($$pack{'handle'}, $entry . "\n"))
206 0 64 unless (syswrite $$pack{'handle'}, pack('NNNN', $$entry{'coff'}, $$entry{'csize'}, $$entry{'off'}, $$entry{'size'}))
216 0 8 unless (syswrite $$pack{'handle'}, pack('a4NNNNa40a4', $toc_header, $cd, $cl, $cf, $toc_length, $$pack{'uncompress_method'}, $toc_footer))
229 0 8 unless ($header eq $toc_header and $trailer eq $toc_footer)
258 10 54 if $$pack{'files'}{$f}{'coff'} + $$pack{'files'}{$f}{'csize'} > $$pack{'coff'}
267 99 25 $$pack{'files'}{$a}{'coff'} == $$pack{'files'}{$b}{'coff'} ? :
124 0 defined $$pack{'files'}{$a} && defined $$pack{'files'}{$b} ? :
279 36 53 $pack->direct_write ? :
287 0 17 unless $pack->end_seek
312 4 45 if (not defined $sourcefh) { }
328 406 4 if (defined $$pack{'cstream_data'})
331 406 4 if (defined $$data) { }
3 1 elsif (defined $$pack{'cstream_data'}) { }
332 3 403 unless (defined $$pack{'cstream_data'})
337 0 3 unless ($$pack{'cstream_data'}{'pid'} = CORE::open($hout, "|$$pack{'compress_method'} > $$pack{'cstream_data'}{'file_block'}"))
346 0 406 unless (syswrite($hout, $$data) == length $$data)
357 0 3 unless (sysopen my $hin, $$pack{'cstream_data'}{'file_block'}, 0)
363 0 384 unless ((my $l = syswrite($$pack{'handle'}, $tdata)) == $length)
378 3 42 if (defined $$pack{'ustream_data'} and !defined($fileinfo) || ($$fileinfo{'coff'} != $$pack{'ustream_data'}{'coff'} || $$fileinfo{'off'} < $$pack{'ustream_data'}{'off'}))
387 8 45 unless defined $fileinfo
390 3 42 unless (defined $$pack{'ustream_data'})
402 3 381 $cread + $$pack{'bufsize'} > $$fileinfo{'csize'} ? :
0 384 unless (my $cl = sysread($$pack{'handle'}, my $data, $cread + $$pack{'bufsize'} > $$fileinfo{'csize'} ? $$fileinfo{'csize'} - $cread : $$pack{'bufsize'}))
410 0 384 unless (syswrite($tempfh, $data) == length $data)
420 2 1 $$pack{'uncompress_method'} eq 'gzip -d' || $$pack{'uncompress_method'} eq 'bzip2 -d' ? :
423 0 3 unless (CORE::open $$pack{'ustream_data'}{'handle'}, "$cmd |")
439 1771 38 if (not defined $data) { }
440 0 1771 unless ($length = sysread($$pack{'ustream_data'}{'handle'}, $data, $$pack{'bufsize'}))
451 0 1809 if ($$pack{'ustream_data'}{'read'} < $$fileinfo{'off'} and $$pack{'ustream_data'}{'read'} + $length > $$fileinfo{'off'})
455 0 1809 if ($$pack{'ustream_data'}{'read'} <= $$fileinfo{'off'})
458 38 1771 if ($byteswritten + length($data) > $$fileinfo{'size'}) { }
466 0 1809 unless (syswrite($destfh, $data, $bw) == $bw)
485 0 0 unless (sysopen my $handle, $dest, 577)
490 0 0 unless (sysseek($$pack{'handle'}, $$pack{'files'}{$file}{'coff'}, 0) == $$pack{'files'}{$file}{'coff'})
498 0 0 unless $l = sysread($$pack{'handle'}, my $buf, $$pack{'files'}{$file}{'csize'}) == $$pack{'files'}{$file}{'csize'}
504 0 0 unless $$pack{'files'}{$_}{'coff'} == $$pack{'files'}{$file}{'coff'}
518 2 66 if ($type eq 'l')
523 2 64 if ($type eq 'd')
528 64 0 if ($type eq 'f')
530 0 64 unless ($pack->end_seek)
535 62 2 ref $data eq 'GLOB' ? :
549 9 55 if ($$pack{'block_size'} > 0 and $$pack{'current_block_csize'} >= $$pack{'block_size'})
562 0 60 $prefix ? :
565 0 60 if (-l $srcfile)
569 0 60 if (-d $srcfile)
573 60 0 if (-f $srcfile)
574 0 60 unless (sysopen my $htocompress, $srcfile, 0)
589 0 64 unless defined $$pack{'files'}{$filename}
590 0 64 unless (sysseek($$pack{'handle'}, $$pack{'files'}{$filename}{'coff'}, 0) == $$pack{'files'}{$filename}{'coff'})
600 64 0 $destdir ? :
603 2 62 if (exists $$pack{'dir'}{$f}) { }
2 60 elsif (exists $$pack{'symlink'}{$f}) { }
60 0 elsif (exists $$pack{'files'}{$f}) { }
604 0 2 unless -d $dest or mkpath($dest)
608 0 2 unless -d $dir or mkpath($dir)
610 0 2 if -l $dest
611 0 2 unless symlink $$pack{'symlink'}{$f}, $dest
615 0 60 unless (-d $dir or mkpath($dir))
618 0 60 if (-l $dest)
619 0 0 unless (unlink $dest)
625 60 0 if (defined $destdir) { }
626 0 60 unless (sysopen $destfh, $dest, 577)
634 0 60 if $written == -1
656 2 6 if (defined $$pack{'files'}{$file}) { }
2 4 elsif (defined $$pack{'symlink'}{$file}) { }
2 2 elsif (defined $$pack{'dir'}{$file}) { }