Branch Coverage

bin/fetchware
Criterion Covered Total %
branch 80 138 57.9


line true false branch
102 0 0 if ($parent_pid == $$)
157 11 1 @ARGV ? :
158 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') { }
186 0 0 if ($@)
222 82 2 if (defined $filename and -e $filename) { }
231 82 0 if ($filename =~ /\.fpkg$/) { }
310 82 0 unless (config('no_install'))
358 50 0 if ($fetchware_package_path =~ /\.fpkg$/) { }
393 49 0 if (cp($fetchware_package_path, $temp_dir)) { }
496 0 0 if $fetchware_extension =~ m[\.\./|/|.pl|.pm]
501 0 0 if (grep {$fetchware_extension eq $_;} 'App::Fetchware', 'Fetchware', 'fetchware', 'default', 'Default') { }
582 36 0 if ($P_fetchware_package_path =~ /\.fpkg$/) { }
625 0 0 if ($P_upgrade) { }
668 6 30 if ($P_upgrade) { }
728 1 16 if @_
765 14 2 if (grep({$_ eq 'No upgrade needed.';} @upgraded_packages) eq @upgraded_packages) { }
791 2 0 if ($filename =~ /\.fpkg$/) { }
889 0 32 if (@installed_packages == 0)
914 5 0 scalar @_ ? :
922 0 5 unless -d $fetchware_temp_dir
936 14 2 if (-d $fetchware_file_or_dir) { }
947 0 2 unless unlink $fetchware_file_or_dir
957 0 5 if @globbed_fetchware_temp_dirs < 1
975 14 0 if (open $fh_sem, '>', $sem_lock_file) { }
981 0 0 if ($> != (stat $sem_lock_file)[4]) { }
1000 3 11 unless (flock $fh_sem, 6)
1020 0 11 if (@$err) { }
1024 0 0 if ($file eq '') { }
1034 11 0 if (@$res)
1043 0 5 if $num_remove_tree_errors > 0
1046 4 1 if $num_remove_tree_successes > 0
1110 0 169 unless ref $fetchwarefile eq 'SCALAR'
1117 0 169 unless $$fetchwarefile =~ /^\s*use\s+App::FetchwareX?(::)?/m
1131 0 169 if $@
1159 1859 25181 if $union{$element}++
1165 0 169 if (grep({$api_subs{$_} eq $intersection{$_} if exists $api_subs{$_} and exists $intersection{$_};} keys %api_subs) != scalar keys %api_subs)
1166 1859 0 if exists $api_subs{$_} and exists $intersection{$_}
1170 0 0 if (not exists $intersection{$api_sub} && defined $intersection{$api_sub} or $intersection{$api_sub} == 0)
1206 0 90 unless chdir $new_dir
1249 0 90 unless my $tar_fetchwarefile = 'Archive::Tar::File'->new('data', './Fetchwarefile', $$fetchwarefile)
1259 0 90 unless $tar->add_files($tar_fetchwarefile)
1265 0 90 unless $tar->add_files(@file_list)
1270 0 90 unless $tar->write($fetchware_package_full_path, 9)
1276 0 90 unless chdir $previous_cwd
1291 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') { }
1297 4 0 if ($> == 0) { }
1310 0 33 if ($^O eq 'MSWin32')
1316 0 0 if (Win32::IsAdminUser()) { }
1348 0 90 if @fetchware_package_filenames == 0
1358 1 89 if (@fetchware_package_filenames > 1)
1399 0 169 unless gunzip($fh, $output_fh)
1412 0 169 unless $tar->read($output_fh)
1418 0 169 unless my $fetchwarefile = $tar->get_content('./Fetchwarefile')
1438 1 88 unless (-e $fetchware_db_path)
1443 0 1 unless make_path($fetchware_db_path)
1449 0 89 unless cp($fetchware_package_path, $fetchware_db_path)
1467 0 55 unless file_name_is_absolute($uninstall_package_name)
1472 0 55 unless unlink $uninstall_package_name