| 1 | package LedgerSMB::Installer::OS v0.999.11; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use v5.20; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use experimental qw(signatures); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Cwd qw( getcwd ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use File::Basename qw( fileparse ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Log::Any qw($log); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | ▶ | sub am_system_perl($self) { | |||||||||||||||||||||||||||
|
Subroutine
am_system_perl: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | return !!0; | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | sub have_cmd($self, $cmd, $fatal = 1, $extra_path = []) { | ||||||||||||||||||||||||||
|
Subroutine
have_cmd: not called CC=14 SCAR=53.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if ($self->{cmd} and $self->{cmd}->{$cmd}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"cmd"} and $self->{"cmd"}{$cmd}
MC/DC0%0/2
$self->{"cmd"} and $self->{"cmd"}{$cmd}
$self->{"cmd"}
$self->{"cmd"}{$cmd}
Truth table0%0/3
A and B
A= $self->{"cmd"}B= $self->{"cmd"}{$cmd}
| |||||||||||||||||||||||||||||
| 18 | 0 | $log->debug( "Found cached command $self->{cmd}->{$cmd}" ); | |||||||||||||||||||||||||||
| 19 | 0 | return $self->{cmd}->{$cmd}; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | my $executable = ''; | |||||||||||||||||||||||||||
| 23 | 0 | ▶ | if (File::Spec->file_name_is_absolute( $cmd )) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | $executable = $cmd if -x $cmd; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | else { | ||||||||||||||||||||||||||||
| 27 | 0 | my (undef, $dirs) = File::Spec->splitpath( $cmd ); | |||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ($dirs) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | $cmd = File::Spec->catfile( getcwd(), $cmd ); | |||||||||||||||||||||||||||
| 30 | 0 | ▶ | $executable = $cmd if -x $cmd; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | else { | ||||||||||||||||||||||||||||
| 33 | # Prefer specific added paths over system path; we may have | ||||||||||||||||||||||||||||
| 34 | # installed something specific; if we did, we don't want to | ||||||||||||||||||||||||||||
| 35 | # find the system global thing in its place. | ||||||||||||||||||||||||||||
| 36 | 0 | for my $path ($extra_path->@*, File::Spec->path) { | |||||||||||||||||||||||||||
| 37 | 0 | my $expanded = File::Spec->catfile( $path, $cmd ); | |||||||||||||||||||||||||||
| 38 | 0 | ▶ | next if not -x $expanded; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | $executable = $expanded; | |||||||||||||||||||||||||||
| 41 | 0 | last; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | 0 | ▶ | if ($executable) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | $self->{cmd} //= {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"cmd"} //= {}
MC/DC0%0/1
$self->{"cmd"} //= {}
$self->{"cmd"}
Truth table0%0/2
A
A= $self->{"cmd"}
| |||||||||||||||||||||||||||||
| 47 | 0 | $self->{cmd}->{$cmd} = $executable; | |||||||||||||||||||||||||||
| 48 | 0 | $log->info( "Command $cmd found as $executable" ); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | elsif (not $fatal) { | ||||||||||||||||||||||||||||
| 51 | 0 | $log->info( "Command $cmd not found" ); | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | else { | ||||||||||||||||||||||||||||
| 54 | 0 | die "Missing '$cmd'"; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | 0 | return $executable; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | ▶ | sub executable_name($self, $command) { | |||||||||||||||||||||||||||
|
Subroutine
executable_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 60 | 0 | return $command; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | sub have_pkgs($self, $pkgs) { | ||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | ▶ | sub pg_config_extra_paths($self) { | |||||||||||||||||||||||||||
|
Subroutine
pg_config_extra_paths: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 67 | 0 | return (); | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | ▶ | sub pkgs_from_modules($self, $mod) { | |||||||||||||||||||||||||||
|
Subroutine
pkgs_from_modules: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 71 | 0 | die 'Operating system and distribution support needs to override the "pkgs_from_modules" method'; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | ▶ | sub pkg_can_install($self) { | |||||||||||||||||||||||||||
|
Subroutine
pkg_can_install: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 75 | 0 | return 0; # there's no such thing as generic installer support across operating systems | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | ▶ | sub pkg_install($self) { | |||||||||||||||||||||||||||
|
Subroutine
pkg_install: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 79 | 0 | die 'Operating system and distribution support needs to override the "pkg_install" method'; | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | ▶ | sub pkg_uninstall($self) { | |||||||||||||||||||||||||||
|
Subroutine
pkg_uninstall: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 83 | 0 | die 'Operating system and distribution support needs to override the "pkg_uninstall" method'; | |||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | ▶ | sub name($self) { | |||||||||||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 87 | 0 | die 'Operating system and distribution support needs to override the "name" method'; | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | sub cleanup_env($self, $config, %args) { | ||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 1 | 1; | |||||||||||||||||||||||||||