Branch Coverage

bin/fetchware
Criterion Covered Total %
branch 78 138 56.5


line true false branch
108 0 0 if ($parent_pid == $$)
163 11 1 @ARGV ? :
164 2 10 if ($command eq 'install') { }
1 9 elsif ($command eq 'uninstall') { }
0 9 elsif ($command eq 'new') { }
2 7 elsif ($command eq 'upgrade') { }
1 6 elsif ($command eq 'upgrade-all') { }
1 5 elsif ($command eq 'list') { }
1 4 elsif ($command eq 'look') { }
1 3 elsif ($command eq 'clean') { }
1 2 elsif ($command eq 'help') { }
192 0 0 if ($@)
228 82 2 if (defined $filename and -e $filename) { }
237 82 0 if ($filename =~ /\.fpkg$/) { }
316 82 0 unless (config('no_install'))
364 50 0 if ($fetchware_package_path =~ /\.fpkg$/) { }
399 49 0 if (cp($fetchware_package_path, $temp_dir)) { }
502 0 0 if $fetchware_extension =~ m[\.\./|/|.pl|.pm]
507 0 0 if (grep {$fetchware_extension eq $_;} 'App::Fetchware', 'Fetchware', 'fetchware', 'default', 'Default') { }
588 36 0 if ($P_fetchware_package_path =~ /\.fpkg$/) { }
631 0 0 if ($P_upgrade) { }
674 6 30 if ($P_upgrade) { }
734 1 16 if @_
771 14 2 if (grep({$_ eq 'No upgrade needed.';} @upgraded_packages) eq @upgraded_packages) { }
797 2 0 if ($filename =~ /\.fpkg$/) { }
895 0 32 if (@installed_packages == 0)
920 5 0 scalar @_ ? :
928 0 5 unless -d $fetchware_temp_dir
942 10 0 if (-d $fetchware_file_or_dir) { }
953 0 0 unless unlink $fetchware_file_or_dir
963 0 5 if @globbed_fetchware_temp_dirs < 1
981 10 0 if (open $fh_sem, '>', $sem_lock_file) { }
987 0 0 if ($> != (stat $sem_lock_file)[4]) { }
1006 3 7 unless (flock $fh_sem, 6)
1026 0 7 if (@$err) { }
1030 0 0 if ($file eq '') { }
1040 7 0 if (@$res)
1049 0 5 if $num_remove_tree_errors > 0
1052 4 1 if $num_remove_tree_successes > 0
1116 0 169 unless ref $fetchwarefile eq 'SCALAR'
1123 0 169 unless $$fetchwarefile =~ /^\s*use\s+App::FetchwareX?(::)?/m
1137 0 169 if $@
1165 1859 25181 if $union{$element}++
1171 0 169 if (grep({$api_subs{$_} eq $intersection{$_} if exists $api_subs{$_} and exists $intersection{$_};} keys %api_subs) != scalar keys %api_subs)
1172 1859 0 if exists $api_subs{$_} and exists $intersection{$_}
1176 0 0 if (not exists $intersection{$api_sub} && defined $intersection{$api_sub} or $intersection{$api_sub} == 0)
1212 0 90 unless chdir $new_dir
1255 0 90 unless my $tar_fetchwarefile = 'Archive::Tar::File'->new('data', './Fetchwarefile', $$fetchwarefile)
1265 0 90 unless $tar->add_files($tar_fetchwarefile)
1271 0 90 unless $tar->add_files(@file_list)
1276 0 90 unless $tar->write($fetchware_package_full_path, 9)
1282 0 90 unless chdir $previous_cwd
1297 2 406 if (defined config('fetchware_db_path')) { }
402 4 elsif (defined $ENV{'FETCHWARE_DATABASE_PATH'}) { }
4 0 elsif (is_os_type('Unix', $^O)) { }
0 0 elsif ($^O eq 'MSWin32') { }
1303 4 0 if ($> == 0) { }
1316 0 33 if ($^O eq 'MSWin32')
1322 0 0 if (Win32::IsAdminUser()) { }
1354 0 90 if @fetchware_package_filenames == 0
1364 1 89 if (@fetchware_package_filenames > 1)
1405 0 169 unless gunzip($fh, $output_fh)
1418 0 169 unless $tar->read($output_fh)
1424 0 169 unless my $fetchwarefile = $tar->get_content('./Fetchwarefile')
1444 1 88 unless (-e $fetchware_db_path)
1449 0 1 unless make_path($fetchware_db_path)
1455 0 89 unless cp($fetchware_package_path, $fetchware_db_path)
1473 0 55 unless file_name_is_absolute($uninstall_package_name)
1478 0 55 unless unlink $uninstall_package_name