| 1 | # | ||||||||||||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||
| 4 | # vim: set ts=2 sw=2 tw=0: | ||||||||||||||||||||||||||||||
| 5 | # vim: set expandtab: | ||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||
| 7 | package Rex::Apache::Build::Base; | ||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Rex::Commands::Gather; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=16 SCAR=56.1
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 16 | 0 | my $that = shift; | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | my $proto = ref($that) || $that; | ||||||||||||||||||||||||||||
|
Condition0%0/3
ref $that || $that
MC/DC0%0/2
ref $that || $that
ref $that
$that
Truth table0%0/3
A || B
A= ref $thatB= $that
| |||||||||||||||||||||||||||||||
| 18 | 0 | my $self = { @_ }; | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||
| 20 | 0 | my %sys_info = get_system_information(); | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | $self->{maintainer} ||= ($ENV{USER} || "unknown"); | ||||||||||||||||||||||||||||
|
Condition0%0/5
$self->{"maintainer"} ||= $ENV{"USER"} || "unknown"
$ENV{'USER'} || 'unknown'
MC/DC0%0/2
$self->{"maintainer"} ||= $ENV{"USER"} || "unknown"
$self->{"maintainer"}
$ENV{'USER'}
Truth table0%0/3
A ||= B
A= $self->{"maintainer"}B= $ENV{'USER'}
| |||||||||||||||||||||||||||||||
| 23 | $self->{arch} ||= $sys_info{architecture}, | ||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | $self->{section} ||= "none"; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$self->{"arch"} ||= $sys_info{"architecture"}
$self->{"section"} ||= "none"
MC/DC0%0/2
$self->{"arch"} ||= $sys_info{"architecture"}
$self->{"arch"}
$sys_info{"architecture"}
MC/DC0%0/1
$self->{"section"} ||= "none"
$self->{"section"}
Truth table0%0/3
A ||= B
A= $self->{"arch"}B= $sys_info{"architecture"}
Truth table0%0/2
A
A= $self->{"section"}
| |||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | $self->{url} ||= "http://example.tld/"; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"url"} ||= "http://example.tld/"
MC/DC0%0/1
$self->{"url"} ||= "http://example.tld/"
$self->{"url"}
Truth table0%0/2
A
A= $self->{"url"}
| |||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $self->{version} ||= "1.0"; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"version"} ||= "1.0"
MC/DC0%0/1
$self->{"version"} ||= "1.0"
$self->{"version"}
Truth table0%0/2
A
A= $self->{"version"}
| |||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | $self->{description} ||= "No Description"; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"description"} ||= "No Description"
MC/DC0%0/1
$self->{"description"} ||= "No Description"
$self->{"description"}
Truth table0%0/2
A
A= $self->{"description"}
| |||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | $self->{target} ||= "linux"; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"target"} ||= "linux"
MC/DC0%0/1
$self->{"target"} ||= "linux"
$self->{"target"}
Truth table0%0/2
A
A= $self->{"target"}
| |||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | $self->{depends} ||= []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"depends"} ||= []
MC/DC0%0/1
$self->{"depends"} ||= []
$self->{"depends"}
Truth table0%0/2
A
A= $self->{"depends"}
| |||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | $self->{provides} ||= []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"provides"} ||= []
MC/DC0%0/1
$self->{"provides"} ||= []
$self->{"provides"}
Truth table0%0/2
A
A= $self->{"provides"}
| |||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | $self->{conflicts} ||= []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"conflicts"} ||= []
MC/DC0%0/1
$self->{"conflicts"} ||= []
$self->{"conflicts"}
Truth table0%0/2
A
A= $self->{"conflicts"}
| |||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | $self->{config_files} ||= []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"config_files"} ||= []
MC/DC0%0/1
$self->{"config_files"} ||= []
$self->{"config_files"}
Truth table0%0/2
A
A= $self->{"config_files"}
| |||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | $self->{exclude} ||= []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"exclude"} ||= []
MC/DC0%0/1
$self->{"exclude"} ||= []
$self->{"exclude"}
Truth table0%0/2
A
A= $self->{"exclude"}
| |||||||||||||||||||||||||||||||
| 35 | 0 | push(@{ $self->{exclude} }, qr{^Rexfile$}, qr{^Rexfile\.lock$}, qr{^\.git}, qr{^\.svn}, qr{.*~$}, qr{\.sw[a-z]$}, qr{^tmp$}, qr{\.cache$}); | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | $self->{source} ||= "."; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"source"} ||= "."
MC/DC0%0/1
$self->{"source"} ||= "."
$self->{"source"}
Truth table0%0/2
A
A= $self->{"source"}
| |||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||
| 40 | 0 | bless($self, $proto); | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||
| 42 | 0 | return $self; | |||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||
| 45 | 1 | for my $name (qw/ | |||||||||||||||||||||||||||||
| 46 | path | ||||||||||||||||||||||||||||||
| 47 | source | ||||||||||||||||||||||||||||||
| 48 | release | ||||||||||||||||||||||||||||||
| 49 | epoch | ||||||||||||||||||||||||||||||
| 50 | version | ||||||||||||||||||||||||||||||
| 51 | vendor | ||||||||||||||||||||||||||||||
| 52 | license | ||||||||||||||||||||||||||||||
| 53 | depends | ||||||||||||||||||||||||||||||
| 54 | conflicts | ||||||||||||||||||||||||||||||
| 55 | provides | ||||||||||||||||||||||||||||||
| 56 | arch | ||||||||||||||||||||||||||||||
| 57 | target | ||||||||||||||||||||||||||||||
| 58 | description | ||||||||||||||||||||||||||||||
| 59 | section | ||||||||||||||||||||||||||||||
| 60 | url | ||||||||||||||||||||||||||||||
| 61 | post_install | ||||||||||||||||||||||||||||||
| 62 | pre_install | ||||||||||||||||||||||||||||||
| 63 | post_uninstall | ||||||||||||||||||||||||||||||
| 64 | pre_uninstall | ||||||||||||||||||||||||||||||
| 65 | exclude | ||||||||||||||||||||||||||||||
| 66 | maintainer | ||||||||||||||||||||||||||||||
| 67 | priority | ||||||||||||||||||||||||||||||
| 68 | name | ||||||||||||||||||||||||||||||
| 69 | config_files | ||||||||||||||||||||||||||||||
| 70 | file_user | ||||||||||||||||||||||||||||||
| 71 | file_group | ||||||||||||||||||||||||||||||
| 72 | 0 | /) { | |||||||||||||||||||||||||||||
| 73 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 74 | 26 | ▶ | *{__PACKAGE__ . "::$name"} = sub { | ||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=15.1
| |||||||||||||||||||||||||||||||
| 75 | 0 | my ($self, $data) = @_; | |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | if($data) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 78 | 0 | $self->{$name} = $data; | |||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||
| 81 | 0 | $self->{$name}; | |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||
| 83 | 26 | }; | |||||||||||||||||||||||||||||
| 84 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | sub prefix { | ||||||||||||||||||||||||||||
|
Subroutine
prefix: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 88 | 0 | my ($self, $prefix) = @_; | |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | if($prefix) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 91 | 0 | $self->{prefix} = $prefix; | |||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | return $self->{prefix} || $self->{path}; | ||||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'prefix'} || $self->{'path'}
MC/DC0%0/2
$self->{'prefix'} || $self->{'path'}
$self->{'prefix'}
$self->{'path'}
Truth table0%0/3
A || B
A= $self->{'prefix'}B= $self->{'path'}
| |||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | sub build { | ||||||||||||||||||||||||||||
|
Subroutine
build: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 98 | 0 | my ($self, $target) = @_; | |||||||||||||||||||||||||||||
| 99 | 0 | die("Must be implemented by Class."); | |||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||
| 102 | 1 | 1; | |||||||||||||||||||||||||||||