Branch Coverage

blib/lib/PAR/Dist.pm
Criterion Covered Total %
branch 80 254 31.5


line true false branch
140 0 1 if @_ == 1
150 0 1 if $args{'dist'}
156 0 1 if (defined $path)
162 0 1 unless -d "blib"
165 0 1 unless open MANIFEST, ">", "File::Spec"->catfile("blib", "MANIFEST")
166 0 1 unless open META, ">", "File::Spec"->catfile("blib", "META.yml")
170 0 15 unless $File::Find::name
171 6 9 if -r $_ and not -d $_
185 0 1 -s $mymeta_file_name ? :
186 1 0 if (open OLD_META, $meta_file_name)
188 0 40 if (/^distribution_type:/) { }
195 1 39 if (/^name:\s+(.*)/) { }
1 38 elsif (/^version:\s+(\S*)/) { }
208 0 1 if (not $name && $version and open MAKEFILE, "Makefile")
210 0 0 if (/^DISTNAME\s+=\s+(.*)$/) { }
0 0 elsif (/^VERSION\s+=\s+(.*)$/) { }
219 0 1 unless (defined $name and defined $version)
222 0 0 if (not defined $name) { }
0 0 elsif (not defined $version) { }
224 0 0 unless defined $version
238 0 1 if -f $file
240 0 1 if fileno META
263 0 1 if $cwd
265 0 1 if ($dist and $file ne $dist)
266 0 0 if (File::Copy::copy($file, $dist)) { }
276 0 1 if ($^O eq "MSWin32")
280 0 1 unless $quiet
286 0 1 if $cwd
291 0 0 if (-e 'Build') { }
0 0 elsif (-e 'Makefile') { }
0 0 elsif (-e 'Build.PL') { }
0 0 elsif (-e 'Makefile.PL') { }
424 0 0 if defined $args{'prefix'}
431 0 0 if (open META, "File::Spec"->catfile("blib", "META.yml"))
433 0 0 unless /^name:\s+(.*)/
440 0 0 if not defined $name or $name eq ""
442 0 0 if (-d "script")
445 0 0 unless -T $file
454 0 0 if ($action eq 'install') { }
0 0 elsif ($action eq 'uninstall') { }
521 0 0 $par_has_archlib ? :
540 0 0 if (not defined $value and $key ne 'packlist_read' and $key ne 'packlist_write') { }
0 0 elsif (exists $sources{$key}) { }
552 0 0 if ($user->{'auto_inst_lib_conversion'} and $par_has_archlib)
564 0 0 if $_ eq ".exists"
565 0 0 if (-f $_)
633 0 1 unless (defined $base_par)
637 0 1 unless (-f $base_par and -r _ and -w _)
642 0 1 unless (-f $_ and -r _)
676 1 0 if (-f $meta_file)
687 4 5 if -f $file
688 5 4 if -d _
713 0 4 unless File::Copy::copy($file, $target)
737 0 1 unless defined $meta_orig_file and -f $meta_orig_file
738 0 1 unless defined $meta_extra_file and -f $meta_extra_file
744 0 1 unless exists $yaml_functions->{'LoadFile'} and exists $yaml_functions->{'DumpFile'}
751 0 1 ref $orig_meta eq 'ARRAY' ? :
752 0 1 ref $extra_meta eq 'ARRAY' ? :
767 0 1 unless exists $extra_hash->{'provides'}
789 2 2 unless exists $extra_hash->{$type}
822 0 0 unless (defined $par)
826 0 0 unless (-f $par and -r _ and -w _)
847 0 0 unless opendir DIRECTORY, "blib"
882 0 1 unless defined $dist and -r $dist
897 0 1 unless (-r $meta)
901 0 1 unless open FH, "<", $meta
921 0 3 unless -f $dist
924 0 3 if (eval { do { require Archive::Unzip::Burst; 1 } })
926 0 0 if $return
929 3 0 if (eval { do { require Archive::Zip; 1 } }) { }
932 0 0 unless $_[0] =~ /\bstat\b/
933 0 3 unless $zip->read($dist) == Archive::Zip::AZ_OK() and $zip->extractTree("", "$path/") == Archive::Zip::AZ_OK()
939 0 0 if (_system_wrapper("unzip", $dist, "-d", $path))
952 1 0 if (eval { do { require Archive::Zip; 1 } }) { }
955 0 1 unless $zip->writeToFileNamed($dist) == Archive::Zip::AZ_OK()
959 0 0 if (_system_wrapper(("zip", "-r"), $dist, "File::Spec"->curdir))
972 0 8 unless (@_)
977 1 7 if @_ == 1
984 8 0 if (defined $args{'name'})
988 8 0 if (defined $elems[0]) { }
998 0 8 if ($args{'dist'} and not $args{'dist'} =~ /\.[a-zA-Z_][^.]*$/)
1006 0 8 if ($args{'dist'} and $args{'dist'} =~ m[^\w+://])
1019 0 0 if ($args{'dist'} =~ s[^file://][])
1020 0 0 if -e $args{'dist'}
1027 0 0 unless %escapes
1037 0 0 if (not LWP::Simple::is_success($rc) and $rc != 304)
1041 0 0 if -e $file
1050 0 0 unless "Module::Signature"->VERSION >= "0.25"
1057 0 0 -e 'SIGNATURE' ? :
1059 0 0 if ($action eq "sign")
1060 0 0 unless -e "SIGNATURE"
1061 0 0 unless open FH, "MANIFEST"
1065 0 0 unless ($out =~ /^SIGNATURE(?:\s|$)/m)
1067 0 0 unless open FH, ">MANIFEST"
1072 0 0 unless exists $args{'overwrite'}
1073 0 0 unless exists $args{'skip'}
1077 0 0 if $action eq "sign"
1091 0 3 unless my $tmpdir = File::Temp::tempdir("parXXXXX", "TMPDIR", 1, "CLEANUP", 1)
1095 2 1 if defined $args{'subdir'}
1131 0 13 unless defined $file
1141 6 20 if ($e =~ /^$version$/o and not @elem && $elem[0] =~ /^$version$/o)
1155 13 0 if @dn
1157 8 5 unless (@elem)
1163 5 19 if ($e =~ /^(?:$version|any_version)$/)
1171 5 0 if @arch
1219 0 0 if !defined($suffix) || $suffix eq '' and $archname and $perlversion
1224 0 0 if (grep {not defined $_;} $name, $version, $suffix)
1230 0 0 unless (-f "META.yml")
1231 0 0 unless open META, ">", "META.yml"
1233 0 0 if fileno META
1277 0 0 unless defined $dist and -r $dist
1295 0 0 if -f $_ and not /^\.exists$/
1304 0 0 $found ? :
1308 0 0 if ($PAR::Dist::DEBUG)
1321 0 0 if -x $_cmd or $_cmd = "MM"->maybe_command($_cmd)
1325 0 0 if -x $abs or $abs = "MM"->maybe_command($abs)
1348 3 6 unless ($@)
1349 1 2 if $PAR::Dist::DEBUG
1353 12 0 if (defined $subref and ref $subref eq "CODE")
1361 0 3 unless (keys %yaml_functions)
1369 1 0 if ($PAR::Dist::DEBUG)
1371 0 4 unless defined $tools->{$_}
1377 1 0 if (eval { do { require Archive::Zip; 1 } } and $Archive::Zip::VERSION ne '1.28') { }
0 0 elsif (_MI_can_run('zip') and _MI_can_run('unzip')) { }
1378 1 0 if $PAR::Dist::DEBUG
1382 0 0 if $PAR::Dist::DEBUG
1386 0 0 if $PAR::Dist::DEBUG