Branch Coverage

blib/lib/PAR/Dist.pm
Criterion Covered Total %
branch 23 258 8.9


line true false branch
140 0 0 if @_ == 1
150 0 0 if $args{'dist'}
156 0 0 if (defined $path)
162 0 0 unless -d "blib"
165 0 0 unless open MANIFEST, ">", "File::Spec"->catfile("blib", "MANIFEST")
166 0 0 unless open META, ">", "File::Spec"->catfile("blib", "META.yml")
170 0 0 unless $File::Find::name
171 0 0 if -r $_ and not -d $_
185 0 0 -s $mymeta_file_name ? :
186 0 0 if (open OLD_META, $meta_file_name)
188 0 0 if (/^distribution_type:/) { }
195 0 0 if (/^name:\s+(.*)/) { }
0 0 elsif (/^version:\s+.*Module::Build::Version/) { }
0 0 elsif (/^version:\s+(.*)/) { }
201 0 0 unless /^\s+original:\s+(.*)/
214 0 0 if (not $name && $version and open MAKEFILE, "Makefile")
216 0 0 if (/^DISTNAME\s+=\s+(.*)$/) { }
0 0 elsif (/^VERSION\s+=\s+(.*)$/) { }
225 0 0 unless (defined $name and defined $version)
228 0 0 if (not defined $name) { }
0 0 elsif (not defined $version) { }
230 0 0 unless defined $version
244 0 0 if -f $file
246 0 0 if fileno META
269 0 0 if $cwd
271 0 0 if ($dist and $file ne $dist)
272 0 0 if (File::Copy::copy($file, $dist)) { }
282 0 0 if ($^O eq "MSWin32")
286 0 0 unless $quiet
292 0 0 if $cwd
297 0 0 if (-e 'Build') { }
0 0 elsif (-e 'Makefile') { }
0 0 elsif (-e 'Build.PL') { }
0 0 elsif (-e 'Makefile.PL') { }
430 0 0 if defined $args{'prefix'}
437 0 0 if (open META, "File::Spec"->catfile("blib", "META.yml"))
439 0 0 unless /^name:\s+(.*)/
446 0 0 if not defined $name or $name eq ""
448 0 0 if (-d "script")
451 0 0 unless -T $file
460 0 0 if ($action eq 'install') { }
0 0 elsif ($action eq 'uninstall') { }
527 0 0 $par_has_archlib ? :
546 0 0 if (not defined $value and $key ne 'packlist_read' and $key ne 'packlist_write') { }
0 0 elsif (exists $sources{$key}) { }
558 0 0 if ($user->{'auto_inst_lib_conversion'} and $par_has_archlib)
570 0 0 if $_ eq ".exists"
571 0 0 if (-f $_)
639 0 0 unless (defined $base_par)
643 0 0 unless (-f $base_par and -r _ and -w _)
648 0 0 unless (-f $_ and -r _)
682 0 0 if (-f $meta_file)
693 0 0 if -f $file
694 0 0 if -d _
719 0 0 unless File::Copy::copy($file, $target)
743 0 0 unless defined $meta_orig_file and -f $meta_orig_file
744 0 0 unless defined $meta_extra_file and -f $meta_extra_file
750 0 0 unless exists $yaml_functions->{'LoadFile'} and exists $yaml_functions->{'DumpFile'}
757 0 0 ref $orig_meta eq 'ARRAY' ? :
758 0 0 ref $extra_meta eq 'ARRAY' ? :
773 0 0 unless exists $extra_hash->{'provides'}
795 0 0 unless exists $extra_hash->{$type}
828 0 0 unless (defined $par)
832 0 0 unless (-f $par and -r _ and -w _)
853 0 0 unless opendir DIRECTORY, "blib"
888 0 0 unless defined $dist and -r $dist
903 0 0 unless (-r $meta)
907 0 0 unless open FH, "<", $meta
927 0 0 unless -f $dist
930 0 0 if (eval { do { require Archive::Unzip::Burst; 1 } })
932 0 0 if $return
935 0 0 if (eval { do { require Archive::Zip; 1 } }) { }
938 0 0 unless $_[0] =~ /\bstat\b/
939 0 0 unless $zip->read($dist) == Archive::Zip::AZ_OK() and $zip->extractTree("", "$path/") == Archive::Zip::AZ_OK()
945 0 0 if (_system_wrapper("unzip", $dist, "-d", $path))
958 0 0 if (eval { do { require Archive::Zip; 1 } }) { }
961 0 0 unless $zip->writeToFileNamed($dist) == Archive::Zip::AZ_OK()
965 0 0 if (_system_wrapper(("zip", "-r"), $dist, "File::Spec"->curdir))
978 0 0 unless (@_)
983 0 0 if @_ == 1
990 0 0 if (defined $args{'name'})
994 0 0 if (defined $elems[0]) { }
1004 0 0 if ($args{'dist'} and not $args{'dist'} =~ /\.[a-zA-Z_][^.]*$/)
1012 0 0 if ($args{'dist'} and $args{'dist'} =~ m[^\w+://])
1025 0 0 if ($args{'dist'} =~ s[^file://][])
1026 0 0 if -e $args{'dist'}
1033 0 0 unless %escapes
1042 0 0 if (not LWP::Simple::is_success($rc) and $rc != 304)
1046 0 0 if -e $file
1055 0 0 unless "Module::Signature"->VERSION >= "0.25"
1062 0 0 -e 'SIGNATURE' ? :
1064 0 0 if ($action eq "sign")
1065 0 0 unless -e "SIGNATURE"
1066 0 0 unless open FH, "MANIFEST"
1070 0 0 unless ($out =~ /^SIGNATURE(?:\s|$)/m)
1072 0 0 unless open FH, ">MANIFEST"
1077 0 0 unless exists $args{'overwrite'}
1078 0 0 unless exists $args{'skip'}
1082 0 0 if $action eq "sign"
1096 0 0 unless my $tmpdir = File::Temp::tempdir("parXXXXX", "TMPDIR", 1, "CLEANUP", 1)
1100 0 0 if defined $args{'subdir'}
1136 0 5 unless defined $file
1146 5 9 if ($e =~ /^$version$/o and not @elem && $elem[0] =~ /^$version$/o)
1160 5 0 if @dn
1162 1 4 unless (@elem)
1168 4 17 if ($e =~ /^(?:$version|any_version)$/)
1176 4 0 if @arch
1224 0 0 if !defined($suffix) || $suffix eq '' and $archname and $perlversion
1229 0 0 if (grep {not defined $_;} $name, $version, $suffix)
1235 0 0 unless (-f "META.yml")
1236 0 0 unless open META, ">", "META.yml"
1238 0 0 if fileno META
1282 0 0 unless defined $dist and -r $dist
1300 0 0 if -f $_ and not /^\.exists$/
1309 0 0 $found ? :
1313 0 0 if ($PAR::Dist::DEBUG)
1326 0 1 if -x $_cmd or $_cmd = "MM"->maybe_command($_cmd)
1330 0 10 if -x $abs or $abs = "MM"->maybe_command($abs)
1353 1 4 unless ($@)
1354 1 0 if $PAR::Dist::DEBUG
1358 2 2 if (defined $subref and ref $subref eq "CODE")
1366 0 1 unless (keys %yaml_functions)
1374 1 0 if ($PAR::Dist::DEBUG)
1376 2 2 unless defined $tools->{$_}
1382 0 1 if (eval { do { require Archive::Zip; 1 } } and $Archive::Zip::VERSION ne '1.28') { }
0 1 elsif (_MI_can_run('zip') and _MI_can_run('unzip')) { }
1383 0 0 if $PAR::Dist::DEBUG
1387 0 0 if $PAR::Dist::DEBUG
1391 1 0 if $PAR::Dist::DEBUG