Branch Coverage

blib/script/applypatch
Criterion Covered Total %
branch 86 206 41.7


line true false branch
110 0 1 if $verbose
112 0 1 unless @ARGV
115 0 1 unless open $argv, $file
119 1 81 if (/^#### Patch data follows ####/) { }
1 80 elsif (/^#### End of Patch data ####/) { }
1 79 elsif (/^#### ApplyPatch data follows ####/) { }
1 78 elsif (/^#### End of ApplyPatch data ####/) { }
1 77 elsif (/^#### End of Patch kit (\[created: ([^\]]+)\] )?####/) { }
1 76 elsif (/^#### Patch checksum: (\d+) (\d+) (\d+) ####/) { }
1 75 elsif (/^#### Checksum: (\d+) (\d+) (\d+) ####/) { }
28 47 elsif ($applypatch == 1) { }
120 0 1 if $trace
126 0 1 if $trace
130 0 1 if $trace
134 0 1 if $trace
138 0 1 if $trace
140 0 1 if (defined $timestamp and defined $2 and $2 ne $timestamp)
150 0 1 if $trace
152 0 1 if ($1 != $lines)
157 0 1 if ($2 != $bytes)
162 0 1 if ($3 != $sum)
169 0 1 if $trace
170 1 0 if ($patch_checksum_okay) { }
171 0 1 unless $1 == $all_lines or not $verbose
174 0 1 unless $2 == $all_bytes or not $verbose
177 0 1 unless $3 == $all_sum or not $verbose
182 0 0 if ($1 != $all_lines)
187 0 0 if ($2 != $all_bytes)
192 0 0 if ($3 != $all_sum)
200 1 27 if (/^# Data version\s*:\s*(\d+\.\d+)$/) { }
1 26 elsif (/^# Date generated\s*:\s+(.*)$/) { }
2 24 elsif (/^# (\S) (.*)$/) { }
201 0 1 if $trace
202 0 1 if ($1 > $data_version)
235 0 1 if ($applypatch == 1) { }
0 1 elsif ($applypatch == 2) { }
244 1 0 if ($applypatch)
246 0 1 if ($patchdata == 0) { }
0 1 elsif ($patchdata == 1) { }
0 1 elsif ($patchdata == 2) { }
259 0 1 if ($endkit == 0)
265 0 1 if ($fail)
266 0 0 if ($force) { }
276 0 0 $applypatch == 3 ? :
0 1 if $verbose
287 0 1 if $verbose
292 0 2 if ($op eq 'c') { }
0 2 elsif ($op eq 'C') { }
2 0 elsif ($op eq 'r' or $op eq 'p' or $op eq 'v') { }
0 0 elsif ($op eq 'R') { }
293 0 0 if (-f $fn or -d _)
300 0 0 if (-f $fn or -d _)
308 2 0 if (defined $sz) { }
309 0 2 if ($sz != $args[0])
321 0 0 unless (-d $fn)
329 0 1 if ($fail)
330 0 0 if ($force) { }
341 0 1 if $verbose
349 0 2 if ($op eq 'C')
351 0 0 unless $mode
352 0 0 if $trace
353 0 0 unless mkdir $fn, $mode
361 0 2 if ($op eq 'c')
364 0 0 if $trace
365 0 0 unless open F, '>' . $fn
380 0 1 unless $p->open("|$patch")
391 0 1 if $trace
392 1 0 if ($applypatch) { }
396 0 28 if $debug
397 1 27 if $_ eq '#### Patch data follows ####'
398 1 26 if $_ eq '#### End of Patch data ####'
399 1 25 unless $p
403 0 1 if $trace
407 0 0 unless $p
411 1 0 if defined $p
417 0 2 unless defined $mode
418 0 2 unless chmod 0777, $fn
420 0 2 if $trace
423 0 2 unless utime $mtime, $mtime, $fn or -d $fn
425 0 2 if $trace
426 0 2 unless chmod $mode, $fn
433 0 0 unless chmod 0777, $fn
435 0 0 if $verbose
436 0 0 if unlink $fn
438 0 0 unless chmod $mode, $fn
445 0 0 unless chmod 0777, $fn
447 0 0 if $verbose
448 0 0 if rmdir $fn
450 0 0 unless chmod $mode, $fn
461 2 0 if ($op eq 'c' or $op eq 'C' or $op eq 'p') { }
0 0 elsif ($op eq 'r') { }
0 0 elsif ($op eq 'R') { }
462 2 0 if (defined $mode)
464 0 2 unless $mode
467 0 2 if $retain
469 0 2 if (-f $fn)
474 0 0 if $trace
476 0 0 if (-e $fn) { }
484 0 0 if $trace
486 0 0 if (-e $fn) { }
504 0 1 unless @ARGV > 0
517 0 1 if not &GetOptions(@opts) or $help
535 0 0 if defined $exit and $exit != 0