lib/Module/Build/Platform/Unix.pm

filter: Statementstmt 77.7% 21 / 27 Branchbran 0.0% 0 / 2 Conditioncond 9.0% 1 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 51.8% 28 / 54 CC 7 SCAR 25.4
CC
7
Cov
55%
_detildefy
30.0
_construct
3.1
BEGIN
1.0
CRAP 12.6
« blib/lib/Module/Build/ConfigData.pm ↑ Summary blib/lib/Module/Build/Platform/MacOS.pm »
1 package Module::Build::Platform::Unix;
2  
3 297 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 297 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 297 our $VERSION = '0.4234';
6 297 $VERSION = eval $VERSION;
7 297 ▶use Module::Build::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 297 our @ISA = qw(Module::Build::Base);
10  
11 144 ▶sub is_executable {
Subroutine is_executable: called CC=1 SCAR=0.0
Pod undocumented
12 # We consider the owner bit to be authoritative on a file, because
13 # -x will always return true if the user is root and *any*
14 # executable bit is set. The -x test seems to try to answer the
15 # question "can I execute this file", but I think we want "is this
16 # file executable".
17  
18 144 my ($self, $file) = @_;
19 144 return +(stat $file)[2] & 0100;
20 }
21  
22 6 ▶sub _startperl { "#! " . shift()->perl }
Subroutine _startperl: called CC=1 SCAR=0.0
23  
24 563 ▶sub _construct {
Subroutine _construct: called CC=3 SCAR=11.4
25 563 my $self = shift()->SUPER::_construct(@_);
26  
27 # perl 5.8.1-RC[1-3] had some broken %Config entries, and
28 # unfortunately Red Hat 9 shipped it like that. Fix 'em up here.
29 549 my $c = $self->{config};
30 549 for (qw(siteman1 siteman3 vendorman1 vendorman3)) {
31 2196 ▶ $c->{"install${_}dir"} ||= $c->{"install${_}"};
Condition33%1/3
$$c{"install${_}dir"} ||= $$c{"install$_"}
l!l&&r!l&&!r
002196
MC/DC0%0/2
$$c{"install${_}dir"} ||= $$c{"install$_"}
$$c{"install${_}dir"} $$c{"install$_"}
Truth table33%1/3
A ||= B
A= $$c{"install${_}dir"}B= $$c{"install$_"}
ABresult
1X1
011
000
32 }
33  
34 549 return $self;
35 }
36  
37 # Open group says username should be portable filename characters,
38 # but some Unix OS working with ActiveDirectory wind up with user-names
39 # with back-slashes in the name. The new code below is very liberal
40 # in what it accepts.
41 0 ▶sub _detildefy {
Subroutine _detildefy: not called CC=5 SCAR=34.0
42 0 my ($self, $value) = @_;
43 0 $value =~ s[^~([^/]+)?(?=/|$)] # tilde with optional username
44 [$1 ?
45 0 ▶ (eval{(getpwnam $1)[7]} || "~$1") :
Condition0%0/6
$ENV{"HOME"} or eval { do { (getpwuid $>)[7] } } or glob "~"
l!l&&r!l&&!r
000
$ENV{"HOME"} or eval { do { (getpwuid $>)[7] } }
l!l&&r!l&&!r
000
MC/DC0%0/3
$ENV{"HOME"} or eval { do { (getpwuid $>)[7] } } or glob "~"
$ENV{"HOME"} eval { do { (getpwuid $>)[7] } } glob "~"
Truth table0%0/4
A or B or C
A= $ENV{"HOME"}B= eval { do { (getpwuid $>)[7] } }C= glob "~"
ABCresult
1XX1
01X1
0011
0000
46 0 ▶ ($ENV{HOME} || eval{(getpwuid $>)[7]} || glob("~"))
Branch: 1 branch
BranchTrueFalseTotal
$1 ? : 0 0 0
Condition0%0/2
eval { do { (getpwnam $1)[7] } } or "~$1"
l!l
00
MC/DC0%0/1
eval { do { (getpwnam $1)[7] } } or "~$1"
eval { do { (getpwnam $1)[7] } }
Truth table0%0/2
A
A= eval { do { (getpwnam $1)[7] } }
Aresult
11
00
47 ]ex;
48 0 return $value;
49 }
50  
51 297 1;
52 __END__
« blib/lib/Module/Build/ConfigData.pm ↑ Summary blib/lib/Module/Build/Platform/MacOS.pm »