| 1 | package ExtUtils::Installed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.00503; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | #use warnings; # XXX requires 5.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Carp qw(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use ExtUtils::Packlist; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use ExtUtils::MakeMaker; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use File::Find; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | my $Is_VMS = $^O eq 'VMS'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | my $DOSISH = ($^O =~ /^(MSWin\d\d|os2|dos|mint)$/); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | require VMS::Filespec if $Is_VMS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | $VERSION = '1.999_001'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | sub _is_prefix { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 25 | ▶ | my ($self, $path, $prefix) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_prefix: called CC=7 SCAR=25.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 25 | ▶ | return unless defined $prefix && defined $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $prefix and defined $path
MC/DC0%0/2
defined $prefix and defined $path
defined $prefix
defined $path
Truth table33%1/3
A and B
A= defined $prefixB= defined $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 25 | ▶ | if( $Is_VMS ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | $prefix = VMS::Filespec::unixify($prefix); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | $path = VMS::Filespec::unixify($path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # Unix path normalization. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 25 | $prefix = File::Spec->canonpath($prefix); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 25 | ▶ | return 1 if substr($path, 0, length($prefix)) eq $prefix; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 13 | ▶ | if ($DOSISH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | $path =~ s|\\|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $prefix =~ s|\\|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | return 1 if $path =~ m{^\Q$prefix\E}i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 13 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | sub _is_doc { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 4 | ▶ | my ($self, $path) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_doc: called CC=5 SCAR=20.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 4 | my $man1dir = $self->{':private:'}{Config}{man1direxp}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 4 | my $man3dir = $self->{':private:'}{Config}{man3direxp}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 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)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | ($man3dir && $self->_is_prefix($path, $man3dir)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | ? 1 : 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | sub _is_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 14 | ▶ | my ($self, $path, $type) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_type: called CC=7 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 14 | ▶ | return 1 if $type eq "all"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 9 | ▶ | return($self->_is_doc($path)) if $type eq "doc"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 9 | my $conf= $self->{':private:'}{Config}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 9 | ▶ | if ($type eq "prog") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | return($self->_is_prefix($path, $conf->{prefix} || $conf->{prefixexp}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 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'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | sub _is_under { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 10 | ▶ | my ($self, $path, @under) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_under: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 10 | ▶ | $under[0] = "" if (! @under); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 10 | foreach my $dir (@under) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 15 | ▶ | return(1) if ($self->_is_prefix($path, $dir)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 3 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | sub _fix_dirs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 8 | ▶ | my ($self, @dirs)= @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fix_dirs: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | # File::Find does not know how to deal with VMS filepaths. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 8 | ▶ | if( $Is_VMS ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | $_ = VMS::Filespec::unixify($_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | for @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 8 | ▶ | if ($DOSISH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | s|\\|/|g for @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 8 | ▶ | return wantarray ? @dirs : $dirs[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | sub _make_entry { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 660 | ▶ | my ($self, $module, $packlist_file, $modfile)= @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_make_entry: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 660 | my $data= { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | module => $module, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | packlist => scalar(ExtUtils::Packlist->new($packlist_file)), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | packlist_file => $packlist_file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 660 | ▶ | if (!$modfile) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 4 | $data->{version} = $self->{':private:'}{Config}{version}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 656 | $data->{modfile} = $modfile; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | # Find the top-level module file in @INC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 656 | $data->{version} = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 656 | foreach my $dir (@{$self->{':private:'}{INC}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 5120 | my $p = File::Spec->catfile($dir, $modfile); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 5120 | ▶ | if (-r $p) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 656 | ▶ | $module = _module_name($p, $module) if $Is_VMS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 656 | $data->{version} = MM->parse_version($p); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 656 | $data->{version_from} = $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 656 | $data->{packlist_valid} = exists $data->{packlist}{$p}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 656 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 660 | $self->{$module}= $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 1 | our $INSTALLED; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 4 | ▶ | my ($class) = shift(@_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=16 SCAR=28.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 4 | ▶ | $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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 4 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 4 | ▶ | 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"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 4 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 4 | ▶ | $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"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 4 | ▶ | if ($args{config_override}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | $self->{':private:'}{Config} = { %{$args{config_override}} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } or Carp::croak( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | "The 'config_override' parameter must be a hash reference." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 3 | $self->{':private:'}{Config} = \%Config; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 4 | for my $tuple ([inc_override => INC => [ @INC ] ], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | [ extra_libs => EXTRA => [] ]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 8 | my ($arg,$key,$val)=@$tuple; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 8 | ▶ | if ( $args{$arg} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 2 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 2 | $self->{':private:'}{$key} = [ @{$args{$arg}} ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } or Carp::croak( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | "The '$arg' parameter must be an array reference." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | elsif ($val) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 6 | $self->{':private:'}{$key} = $val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 4 | my %dupe; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 50 | ▶ | @{$self->{':private:'}{LIBDIRS}} = grep { -e $_ && !$dupe{$_}++ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 4 | @{$self->{':private:'}{EXTRA}}, @{$self->{':private:'}{INC}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 4 | my @dirs= $self->_fix_dirs(@{$self->{':private:'}{LIBDIRS}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # Read the core packlist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 4 | my $archlib = $self->_fix_dirs($self->{':private:'}{Config}{archlibexp}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 4 | $self->_make_entry("Perl",File::Spec->catfile($archlib, '.packlist')); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 4 | my $root; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # Read the module packlists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | my $sub = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | # Only process module .packlists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 86159 | ▶ | return if $_ ne ".packlist" || $File::Find::dir eq $archlib; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
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 | 1319 | my $module = $File::Find::name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | my $found = $module =~ s!^.*?/auto/(.*)/.packlist!$1!s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1319 | ▶ | or do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | # warn "Woah! \$_=$_\n\$module=$module\n\$File::Find::dir=$File::Find::dir\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | # join ("\n",@dirs); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 6 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1313 | my $modfile = "$module.pm"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 1313 | $module =~ s!/!::!g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1313 | ▶ | return if $self->{$module}; #shadowing? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 656 | $self->_make_entry($module,$File::Find::name,$modfile); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 4 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 4 | ▶ | while (@dirs) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 37 | $root= shift @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 37 | ▶ | next if !-d $root; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 37 | find($sub,$root); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 4 | 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 | sub _module_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | my($file, $orig_module) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_module_name: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub modules { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 2 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
modules: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub files { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 7 | ▶ | my ($self, $module, $type, @under) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
files: called CC=10 SCAR=23.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub directories { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | ▶ | my ($self, $module, $type, @under) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directories: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub directory_tree { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | my ($self, $module, $type, @under) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directory_tree: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 2 | ▶ | my ($self, $module, $remove) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub packlist { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 2 | ▶ | my ($self, $module) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
packlist: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub version { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 2 | ▶ | my ($self, $module) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | sub debug_dump { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | my ($self, $module) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug_dump: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||