/usr/share/perl5/Module/Install/Admin/ScanDeps.pm is in libmodule-install-perl 1.16-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | package Module::Install::Admin::ScanDeps;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = '1.16';
@ISA = qw(Module::Install::Base);
}
sub scan_dependencies {
my ($self, $pkg, $perl_version, $pkg_version) = @_;
return if $pkg eq 'perl';
$perl_version ||= $self->perl_version or die <<'END_MESSAGE';
Please first specify a required perl version, like this:
perl_version('5.005');
END_MESSAGE
$perl_version =~ s{^(\d+)\.(\d+)\.(\d+)}{$1 + $2/1_000 + $3/1_000_000}e;
require Module::ScanDeps;
require Module::CoreList;
die "Module::CoreList has no information on perl $perl_version"
unless exists $Module::CoreList::version{$perl_version};
if (my $min_version = Module::CoreList->first_release($pkg, $pkg_version)) {
return if $min_version <= $perl_version;
}
# We only need the first one in the @INC here
my $file = $self->admin->find_in_inc($pkg)
or die "Cannot find $pkg in \@INC";
my %result = ($pkg => $file);
my @files = ($file);
while (@files) {
my $deps = Module::ScanDeps::scan_deps(
files => \@files,
recurse => 0,
);
@files = ();
foreach my $key (keys %$deps) {
if ($deps->{$key}{type} eq 'shared') {
foreach my $used_by (@{$deps->{$key}{used_by}}) {
$used_by =~ s!/!::!g;
$used_by =~ s!\.pm\Z!!i or next;
next if exists $result{$used_by};
$result{$used_by} = undef;
my $min_version = Module::CoreList->first_release($used_by);
print "skipped $used_by (needs shared library)\n"
unless !$min_version || $min_version <= $perl_version;
}
}
}
foreach my $key (keys %$deps) {
my $dep_pkg = $key;
$dep_pkg =~ s!/!::!g;
$dep_pkg =~ s!\.pm\Z!!i or next;
if (my $min_version = Module::CoreList->first_release($dep_pkg)) {
next if $min_version <= $perl_version;
}
next if $dep_pkg =~ /^(?:DB|(?:Auto|Dyna|XS)Loader|threads|warnings)\b/i;
next if exists $result{$dep_pkg};
$result{$dep_pkg} = $deps->{$key}{file};
push @files, $deps->{$key}{file};
}
}
while (my($k,$v) = each %result) {
delete $result{$k} unless defined $v;
}
return \%result;
}
1;
|