| 1 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | package ExtUtils::Installed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | #use warnings; # XXX requires 5.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Carp qw(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use ExtUtils::Packlist; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use ExtUtils::MakeMaker; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use File::Find; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $Is_VMS = $^O eq 'VMS'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | my $DOSISH = ($^O =~ /^(MSWin\d\d|os2|dos|mint)$/); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | require VMS::Filespec if $Is_VMS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | our $VERSION = '2.22'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 27 | ▶ | sub _is_prefix { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_prefix: called CC=7 SCAR=22.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 27 | my ($self, $path, $prefix) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 27 | ▶ | return unless defined $prefix && defined $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $prefix and defined $path
MC/DC100%2/2
defined $prefix and defined $path
defined $prefix
defined $path
Truth table100%3/3
A and B
A= defined $prefixB= defined $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 25 | ▶ | if( $Is_VMS ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | $prefix = VMS::Filespec::unixify($prefix); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $path = VMS::Filespec::unixify($path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | # Unix path normalization. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 25 | $prefix = File::Spec->canonpath($prefix); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 25 | ▶ | return 1 if substr($path, 0, length($prefix)) eq $prefix; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 13 | ▶ | if ($DOSISH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $path =~ s|\\|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | $prefix =~ s|\\|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | return 1 if $path =~ m{^\Q$prefix\E}i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 13 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 4 | ▶ | sub _is_doc { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_doc: called CC=5 SCAR=20.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 4 | my ($self, $path) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 4 | my $man1dir = $self->{':private:'}{Config}{man1direxp}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 4 | my $man3dir = $self->{':private:'}{Config}{man3direxp}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 4 | ▶ | return(($man1dir && $self->_is_prefix($path, $man1dir)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$man1dir and $self->_is_prefix($path, $man1dir) or $man3dir and $self->_is_prefix($path, $man3dir)
$man1dir and $self->_is_prefix($path, $man1dir)
$man3dir and $self->_is_prefix($path, $man3dir)
MC/DC0%0/4
$man1dir and $self->_is_prefix($path, $man1dir) or $man3dir and $self->_is_prefix($path, $man3dir)
$man1dir
$self->_is_prefix($path, $man1dir)
$man3dir
$self->_is_prefix($path, $man3dir)
Truth table14%1/7
A and B or C and D
A= $man1dirB= $self->_is_prefix($path, $man1dir)C= $man3dirD= $self->_is_prefix($path, $man3dir)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ($man3dir && $self->_is_prefix($path, $man3dir)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | ? 1 : 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 14 | ▶ | sub _is_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_type: called CC=7 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 14 | my ($self, $path, $type) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 14 | ▶ | return 1 if $type eq "all"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 9 | ▶ | return($self->_is_doc($path)) if $type eq "doc"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 9 | my $conf= $self->{':private:'}{Config}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 9 | ▶ | if ($type eq "prog") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | return($self->_is_prefix($path, $conf->{prefix} || $conf->{prefixexp}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | ▶ | && !($self->_is_doc($path)) ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$self->_is_prefix($path, $conf->{"prefix"} || $conf->{"prefixexp"}) and not $self->_is_doc($path)
$conf->{'prefix'} || $conf->{'prefixexp'}
MC/DC50%1/2
$self->_is_prefix($path, $conf->{"prefix"} || $conf->{"prefixexp"}) and not $self->_is_doc($path)
$self->_is_prefix($path, $conf->{"prefix"} || $conf->{"prefixexp"})
not $self->_is_doc($path)
MC/DC0%0/2
$conf->{'prefix'} || $conf->{'prefixexp'}
$conf->{'prefix'}
$conf->{'prefixexp'}
Truth table66%2/3
A and not(B)
A= $self->_is_prefix($path, $conf->{"prefix"} || $conf->{"prefixexp"})B= not $self->_is_doc($path)
Truth table33%1/3
A || B
A= $conf->{'prefix'}B= $conf->{'prefixexp'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 10 | ▶ | sub _is_under { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_under: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 10 | my ($self, $path, @under) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 10 | ▶ | $under[0] = "" if (! @under); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 10 | foreach my $dir (@under) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 15 | ▶ | return(1) if ($self->_is_prefix($path, $dir)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 3 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 12 | ▶ | sub _fix_dirs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fix_dirs: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 12 | my ($self, @dirs)= @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # File::Find does not know how to deal with VMS filepaths. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 12 | ▶ | if( $Is_VMS ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | $_ = VMS::Filespec::unixify($_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | for @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 12 | ▶ | if ($DOSISH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | s|\\|/|g for @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 12 | ▶ | return wantarray ? @dirs : $dirs[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 1025 | ▶ | sub _make_entry { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_make_entry: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 1025 | my ($self, $module, $packlist_file, $modfile)= @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 1025 | my $data= { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | module => $module, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | packlist => scalar(ExtUtils::Packlist->new($packlist_file)), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | packlist_file => $packlist_file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1025 | ▶ | if (!$modfile) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 6 | $data->{version} = $self->{':private:'}{Config}{version}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 1019 | $data->{modfile} = $modfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | # Find the top-level module file in @INC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 1019 | $data->{version} = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 1019 | foreach my $dir (@{$self->{':private:'}{INC}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 6938 | my $p = File::Spec->catfile($dir, $modfile); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 6938 | ▶ | if (-r $p) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 1019 | ▶ | $module = _module_name($p, $module) if $Is_VMS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 1019 | $data->{version} = MM->parse_version($p); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 1019 | $data->{version_from} = $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1019 | $data->{packlist_valid} = exists $data->{packlist}{$p}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 1019 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 1025 | $self->{$module}= $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | our $INSTALLED; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 6 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=17 SCAR=29.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 6 | my ($class) = shift(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 6 | ▶ | $class = ref($class) || $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 6 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 6 | ▶ | return $INSTALLED if $INSTALLED and ($args{default_get} || $args{default}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition16%1/6
$ExtUtils::Installed::INSTALLED and $args{"default_get"} || $args{"default"}
$args{"default_get"} or $args{"default"}
MC/DC0%0/3
$ExtUtils::Installed::INSTALLED and $args{"default_get"} || $args{"default"}
$ExtUtils::Installed::INSTALLED
$args{"default_get"}
$args{"default"}
Truth table25%1/4
A and B or C
A= $ExtUtils::Installed::INSTALLEDB= $args{"default_get"}C= $args{"default"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 6 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 6 | ▶ | $INSTALLED= $self if $args{default_set} || $args{default}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$args{"default_set"} or $args{"default"}
MC/DC0%0/2
$args{"default_set"} or $args{"default"}
$args{"default_set"}
$args{"default"}
Truth table33%1/3
A or B
A= $args{"default_set"}B= $args{"default"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 6 | ▶ | if ($args{config_override}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 1 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | $self->{':private:'}{Config} = { %{$args{config_override}} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } or Carp::croak( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | "The 'config_override' parameter must be a hash reference." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 5 | $self->{':private:'}{Config} = \%Config; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 6 | for my $tuple ([inc_override => INC => [ @INC ] ], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | [ extra_libs => EXTRA => [] ]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 12 | my ($arg,$key,$val)=@$tuple; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 12 | ▶ | if ( $args{$arg} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 2 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 2 | $self->{':private:'}{$key} = [ @{$args{$arg}} ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } or Carp::croak( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | "The '$arg' parameter must be an array reference." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | elsif ($val) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 10 | $self->{':private:'}{$key} = $val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 6 | my %dupe; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 6 | @{$self->{':private:'}{LIBDIRS}} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 47 | ▶ | grep { $_ ne '.' || ! $args{skip_cwd} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$_ ne '.' || !$args{'skip_cwd'}
MC/DC100%2/2
$_ ne '.' || !$args{'skip_cwd'}
$_ ne '.'
!$args{'skip_cwd'}
Truth table100%3/3
A || not(B)
A= $_ ne '.'B= !$args{'skip_cwd'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 66 | ▶ | grep { -e $_ && !$dupe{$_}++ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
-e $_ && !$dupe{$_}++
MC/DC100%2/2
-e $_ && !$dupe{$_}++
-e $_
!$dupe{$_}++
Truth table100%3/3
A && not(B)
A= -e $_B= !$dupe{$_}++
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 6 | @{$self->{':private:'}{EXTRA}}, @{$self->{':private:'}{INC}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 6 | my @dirs= $self->_fix_dirs(@{$self->{':private:'}{LIBDIRS}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # Read the core packlist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 6 | my $archlib = $self->_fix_dirs($self->{':private:'}{Config}{archlibexp}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 6 | $self->_make_entry("Perl",File::Spec->catfile($archlib, '.packlist')); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 6 | my $root; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # Read the module packlists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 129415 | ▶ | my $sub = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | # Only process module .packlists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 129415 | ▶ | return if $_ ne ".packlist" || $File::Find::dir eq $archlib; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$_ ne ".packlist" or $File::Find::dir eq $archlib
MC/DC100%2/2
$_ ne ".packlist" or $File::Find::dir eq $archlib
$_ ne ".packlist"
$File::Find::dir eq $archlib
Truth table100%3/3
A or B
A= $_ ne ".packlist"B= $File::Find::dir eq $archlib
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | # Hack of the leading bits of the paths & convert to a module name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 2047 | my $module = $File::Find::name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | my $found = $module =~ s!^.*?/auto/(.*)/.packlist!$1!s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 2047 | ▶ | or do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | # warn "Woah! \$_=$_\n\$module=$module\n\$File::Find::dir=$File::Find::dir\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | # join ("\n",@dirs); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 10 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 2037 | my $modfile = "$module.pm"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 2037 | $module =~ s!/!::!g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 2037 | ▶ | return if $self->{$module}; #shadowing? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 1019 | $self->_make_entry($module,$File::Find::name,$modfile); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 6 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 6 | ▶ | while (@dirs) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 45 | $root= shift @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 45 | ▶ | next if !-d $root; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 45 | find($sub,$root); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 6 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | # VMS's non-case preserving file-system means the package name can't | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | # be reconstructed from the filename. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | sub _module_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_module_name: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | my($file, $orig_module) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | my $module = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | if (open PACKFH, $file) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | while (<PACKFH>) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | if (/package\s+(\S+)\s*;/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my $pack = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | # Make a sanity check, that lower case $module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | # is identical to lowercase $pack before | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | # accepting it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | if (lc($pack) eq lc($orig_module)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $module = $pack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | close PACKFH; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | print STDERR "Couldn't figure out the package name for $file\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | unless $module; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return $module; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 2 | ▶ | sub modules { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
modules: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 2 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | # Bug/feature of sort in scalar context requires this. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | return wantarray | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 4 | ? sort grep { not /^:private:$/ } keys %$self | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 2 | ▶ | : grep { not /^:private:$/ } keys %$self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 7 | ▶ | sub files { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
files: called CC=10 SCAR=23.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 7 | my ($self, $module, $type, @under) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 7 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | # Validate arguments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 7 | ▶ | Carp::croak("$module is not installed") if (! exists($self->{$module})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 6 | ▶ | $type = "all" if (! defined($type)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 6 | ▶ | Carp::croak('type must be "all", "prog" or "doc"') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$type ne "all" and $type ne "prog" and $type ne "doc"
$type ne "all" and $type ne "prog"
MC/DC66%2/3
$type ne "all" and $type ne "prog" and $type ne "doc"
$type ne "all"
$type ne "prog"
$type ne "doc"
Truth table75%3/4
A and B and C
A= $type ne "all"B= $type ne "prog"C= $type ne "doc"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | if ($type ne "all" && $type ne "prog" && $type ne "doc"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 5 | my (@files); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 5 | foreach my $file (keys(%{$self->{$module}{packlist}})) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 10 | ▶ | push(@files, $file) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->_is_type($file, $type) and $self->_is_under($file, @under)
MC/DC100%2/2
$self->_is_type($file, $type) and $self->_is_under($file, @under)
$self->_is_type($file, $type)
$self->_is_under($file, @under)
Truth table100%3/3
A and B
A= $self->_is_type($file, $type)B= $self->_is_under($file, @under)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | if ($self->_is_type($file, $type) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | $self->_is_under($file, @under)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 5 | return(@files); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 2 | ▶ | sub directories { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directories: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | my ($self, $module, $type, @under) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 2 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 2 | my (%dirs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 2 | foreach my $file ($self->files($module, $type, @under)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 2 | $dirs{dirname($file)}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 2 | return sort keys %dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | sub directory_tree { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directory_tree: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | my ($self, $module, $type, @under) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | my (%dirs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | foreach my $dir ($self->directories($module, $type, @under)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $dirs{$dir}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my ($last) = (""); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | while ($last ne $dir) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $last = $dir; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | $dir = dirname($dir); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | last if !$self->_is_under($dir, @under); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $dirs{$dir}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | return(sort(keys(%dirs))); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 2 | ▶ | sub validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 2 | my ($self, $module, $remove) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 2 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 2 | ▶ | Carp::croak("$module is not installed") if (! exists($self->{$module})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 1 | return($self->{$module}{packlist}->validate($remove)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 2 | ▶ | sub packlist { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
packlist: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 2 | my ($self, $module) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 2 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 2 | ▶ | Carp::croak("$module is not installed") if (! exists($self->{$module})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 1 | return($self->{$module}{packlist}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 2 | ▶ | sub version { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 2 | my ($self, $module) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 2 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 2 | ▶ | Carp::croak("$module is not installed") if (! exists($self->{$module})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 1 | return($self->{$module}{version}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | sub _debug_dump { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_debug_dump: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | my ($self, $module) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | $self= $self->new(default=>1) if !ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | local $self->{":private:"}{Config}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | require Data::Dumper; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | print Data::Dumper->new([$self])->Sortkeys(1)->Indent(1)->Dump(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||