line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
1
|
|
|
1
|
|
5
|
package Module::CPANfile::Result; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
755
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
|
|
|
|
|
|
|
5
|
0
|
|
|
0
|
0
|
|
sub from_prereqs { |
6
|
0
|
|
|
|
|
|
my($class, $spec) = @_; |
7
|
|
|
|
|
|
|
bless { |
8
|
|
|
|
|
|
|
phase => 'runtime', |
9
|
|
|
|
|
|
|
spec => $spec, |
10
|
|
|
|
|
|
|
}, $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
0
|
|
sub new { |
14
|
|
|
|
|
|
|
bless { |
15
|
|
|
|
|
|
|
phase => 'runtime', # default phase |
16
|
|
|
|
|
|
|
features => {}, |
17
|
|
|
|
|
|
|
feature => undef, |
18
|
|
|
|
|
|
|
spec => {}, |
19
|
|
|
|
|
|
|
}, shift; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
0
|
|
sub on { |
23
|
0
|
|
|
|
|
|
my($self, $phase, $code) = @_; |
24
|
0
|
|
|
|
|
|
local $self->{phase} = $phase; |
25
|
|
|
|
|
|
|
$code->() |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
0
|
|
sub feature { |
29
|
|
|
|
|
|
|
my($self, $identifier, $description, $code) = @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
0
|
|
|
|
# shortcut: feature identifier => sub { ... } |
32
|
0
|
|
|
|
|
|
if (@_ == 3 && ref($description) eq 'CODE') { |
33
|
0
|
|
|
|
|
|
$code = $description; |
34
|
|
|
|
|
|
|
$description = $identifier; |
35
|
|
|
|
|
|
|
} |
36
|
0
|
0
|
0
|
|
|
|
|
37
|
0
|
|
|
|
|
|
unless (ref $description eq '' && ref $code eq 'CODE') { |
38
|
|
|
|
|
|
|
Carp::croak("Usage: feature 'identifier', 'Description' => sub { ... }"); |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
local $self->{feature} = $self->{features}{$identifier} |
42
|
0
|
|
|
|
|
|
= { identifier => $identifier, description => $description, spec => {} }; |
43
|
|
|
|
|
|
|
$code->(); |
44
|
|
|
|
|
|
|
} |
45
|
0
|
|
|
0
|
0
|
|
|
46
|
|
|
|
|
|
|
sub osname { die "TODO" } |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
0
|
|
sub requires { |
49
|
0
|
0
|
0
|
|
|
|
my($self, $module, $requirement) = @_; |
50
|
|
|
|
|
|
|
($self->{feature} ? $self->{feature}{spec} : $self->{spec}) |
51
|
|
|
|
|
|
|
->{$self->{phase}}{requires}{$module} = $requirement || 0; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
0
|
0
|
|
sub recommends { |
55
|
0
|
0
|
0
|
|
|
|
my($self, $module, $requirement) = @_; |
56
|
|
|
|
|
|
|
($self->{feature} ? $self->{feature}{spec} : $self->{spec}) |
57
|
|
|
|
|
|
|
->{$self->{phase}}{recommends}{$module} = $requirement || 0; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
0
|
|
sub suggests { |
61
|
0
|
0
|
0
|
|
|
|
my($self, $module, $requirement) = @_; |
62
|
|
|
|
|
|
|
($self->{feature} ? $self->{feature}{spec} : $self->{spec}) |
63
|
|
|
|
|
|
|
->{$self->{phase}}{suggests}{$module} = $requirement || 0; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
0
|
0
|
|
sub conflicts { |
67
|
0
|
0
|
0
|
|
|
|
my($self, $module, $requirement) = @_; |
68
|
|
|
|
|
|
|
($self->{feature} ? $self->{feature}{spec} : $self->{spec}) |
69
|
|
|
|
|
|
|
->{$self->{phase}}{conflicts}{$module} = $requirement || 0; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Module::Install compatible shortcuts |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
0
|
0
|
|
sub configure_requires { |
75
|
0
|
|
|
0
|
|
|
my($self, @args) = @_; |
|
0
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$self->on(configure => sub { $self->requires(@args) }); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
0
|
0
|
|
sub build_requires { |
80
|
0
|
|
|
0
|
|
|
my($self, @args) = @_; |
|
0
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
$self->on(build => sub { $self->requires(@args) }); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
0
|
0
|
|
sub test_requires { |
85
|
0
|
|
|
0
|
|
|
my($self, @args) = @_; |
|
0
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
$self->on(test => sub { $self->requires(@args) }); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
0
|
0
|
|
sub author_requires { |
90
|
0
|
|
|
0
|
|
|
my($self, @args) = @_; |
|
0
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
$self->on(develop => sub { $self->requires(@args) }); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |