pack_dep_gen.pm
740 Bytes
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
package tools::pack_dep_gen;
use strict;
require Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT = qw(PrintDependency PrintDependModule);
@EXPORT_OK = qw(PrintDependency PrintDependModule);
return 1;
sub PrintDependency
{
my $file = shift;
if (-e $file)
{
$file = Win32::GetCwd() . "\\" . $file if (index($file, Win32::GetCwd()) != 0);
$file =~ s/\//\\/g;
print STDERR "[Dependency] $file\n";
}
}
sub PrintDependModule
{
my $file = shift;
if ($file eq "")
{
PrintDependency($0);
}
else
{
PrintDependency($file);
}
foreach my $value (values %INC)
{
if ($value =~ /[\/\\]Perl([\/\\].*)?[\/\\]lib[\/\\]/i)
{
# skip system module
}
else
{
PrintDependency($value);
}
}
}