line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PM::Packages; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
347234
|
use 5.00405; |
|
5
|
|
|
|
|
57
|
|
4
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
349
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw( pm_packages ); |
9
|
|
|
|
|
|
|
our @EXPORT = @EXPORT_OK; |
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
5
|
|
48
|
use Exporter qw( import ); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
2299
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub pm_packages |
14
|
|
|
|
|
|
|
{ |
15
|
5
|
|
|
5
|
0
|
427
|
my( $pmfile ) = @_; |
16
|
5
|
|
|
|
|
11
|
my @ret; |
17
|
|
|
|
|
|
|
|
18
|
5
|
50
|
|
|
|
239
|
open my $fh, "<", "$pmfile" or return; |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
37
|
local $/ = "\n"; |
21
|
5
|
|
|
|
|
13
|
my $inpod = 0; |
22
|
5
|
|
|
|
|
158
|
PLINE: while (<$fh>) { |
23
|
86
|
|
|
|
|
135
|
chomp; |
24
|
86
|
|
|
|
|
145
|
my($pline) = $_; |
25
|
86
|
100
|
|
|
|
182
|
$inpod = $pline =~ /^=(?!cut)/ ? 1 : |
|
|
100
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$pline =~ /^=cut/ ? 0 : $inpod; |
27
|
86
|
100
|
|
|
|
142
|
next if $inpod; |
28
|
82
|
100
|
|
|
|
168
|
next if substr($pline,0,4) eq "=cut"; |
29
|
|
|
|
|
|
|
|
30
|
81
|
|
|
|
|
131
|
$pline =~ s/\#.*//; |
31
|
81
|
100
|
|
|
|
268
|
next if $pline =~ /^\s*$/; |
32
|
39
|
100
|
66
|
|
|
115
|
if ($pline =~ /^__(?:END|DATA)__\b/ |
33
|
|
|
|
|
|
|
and $pmfile !~ /\.PL$/ # PL files may well have code after __DATA__ |
34
|
|
|
|
|
|
|
){ |
35
|
2
|
|
|
|
|
7
|
last PLINE; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
37
|
|
|
|
|
55
|
my $pkg; |
39
|
|
|
|
|
|
|
my $strict_version; |
40
|
|
|
|
|
|
|
|
41
|
37
|
100
|
|
|
|
691
|
if ( |
42
|
|
|
|
|
|
|
$pline =~ m{ |
43
|
|
|
|
|
|
|
(.*) |
44
|
|
|
|
|
|
|
(?
|
45
|
|
|
|
|
|
|
\bpackage\s+ |
46
|
|
|
|
|
|
|
([\w\:\']+) |
47
|
|
|
|
|
|
|
\s* |
48
|
|
|
|
|
|
|
(?: $ | [\}\;] | \{ | \s+($version::STRICT) ) |
49
|
|
|
|
|
|
|
}x) { |
50
|
6
|
|
|
|
|
18
|
$pkg = $2; |
51
|
6
|
|
|
|
|
14
|
$strict_version = $3; |
52
|
6
|
50
|
|
|
|
13
|
if ($pkg eq "DB"){ |
53
|
|
|
|
|
|
|
# XXX if pumpkin and perl make him comaintainer! I |
54
|
|
|
|
|
|
|
# think I always made the pumpkins comaint on DB |
55
|
|
|
|
|
|
|
# without further ado (?) |
56
|
0
|
|
|
|
|
0
|
next PLINE; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
37
|
100
|
|
|
|
126
|
if ($pkg) { |
61
|
|
|
|
|
|
|
# Found something |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# from package |
64
|
6
|
|
|
|
|
10
|
$pkg =~ s/\'/::/; |
65
|
|
|
|
|
|
|
# next PLINE unless $pkg =~ /^[A-Za-z]/; |
66
|
6
|
50
|
|
|
|
31
|
next PLINE unless $pkg =~ /\w$/; |
67
|
6
|
50
|
|
|
|
15
|
next PLINE if $pkg eq "main"; |
68
|
|
|
|
|
|
|
# Perl::Critic::Policy::TestingAndDebugging::ProhibitShebangWarningsArg |
69
|
|
|
|
|
|
|
# database for modid in mods, package in packages, package in perms |
70
|
|
|
|
|
|
|
# alter table mods modify modid varchar(128) binary NOT NULL default ''; |
71
|
|
|
|
|
|
|
# alter table packages modify package varchar(128) binary NOT NULL default ''; |
72
|
6
|
50
|
|
|
|
14
|
next PLINE if length($pkg) > 128; |
73
|
6
|
|
|
|
|
75
|
push @ret, $pkg; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
5
|
|
|
|
|
391
|
$fh->close; |
78
|
5
|
|
|
|
|
43477
|
return @ret; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
__END__ |