line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::Version; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
11130
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
121
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
2
|
|
|
3
|
|
|
|
|
86
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
13
|
use version; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
21
|
|
7
|
3
|
|
|
3
|
|
276
|
use Carp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
229
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
17
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
21
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub initialize { |
12
|
55
|
|
|
55
|
0
|
114
|
my ( $self, $param ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
55
|
100
|
|
|
|
204
|
if ( ! defined $param ) { |
15
|
|
|
|
|
|
|
$self->{callback} = sub { |
16
|
34
|
|
|
34
|
|
60
|
my $attributes = shift; |
17
|
|
|
|
|
|
|
|
18
|
34
|
|
|
|
|
170
|
my $list = $attributes->SortedVersionList; |
19
|
|
|
|
|
|
|
|
20
|
34
|
100
|
|
|
|
204
|
if ( $attributes->VersionCondition eq 'latest' ) { |
21
|
20
|
|
|
|
|
74
|
return $list->[-1]; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
14
|
100
|
|
|
|
27
|
if ( grep { $attributes->VersionCondition eq $_ } @{ $list} ) { |
|
28
|
|
|
|
|
100
|
|
|
14
|
|
|
|
|
29
|
|
25
|
13
|
|
|
|
|
103
|
return $attributes->VersionCondition; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
7
|
my $err = "Invalid Version Condition:" . |
29
|
|
|
|
|
|
|
$attributes->VersionCondition . ", ". |
30
|
|
|
|
|
|
|
"please check install condition"; |
31
|
1
|
|
|
|
|
10
|
require Enbld::Error; |
32
|
1
|
|
|
|
|
8
|
croak( Enbld::Error->new( $err )); |
33
|
47
|
|
|
|
|
387
|
}; |
34
|
|
|
|
|
|
|
|
35
|
47
|
|
|
|
|
98
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
8
|
100
|
|
|
|
21
|
if ( $param ) { |
39
|
7
|
|
|
|
|
42
|
$self->SUPER::initialize( $param ); |
40
|
7
|
|
|
|
|
11
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
7
|
require Enbld::Exception; |
44
|
1
|
|
|
|
|
2
|
my $err = "Attribute 'Version' isn't defined"; |
45
|
1
|
|
|
|
|
8
|
croak( Enbld::Exception->new( $err )); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub validate { |
49
|
96
|
|
|
96
|
0
|
183
|
my ( $self, $string ) = @_; |
50
|
|
|
|
|
|
|
|
51
|
96
|
|
|
|
|
341
|
$self->SUPER::validate( $string ); |
52
|
|
|
|
|
|
|
|
53
|
93
|
|
|
|
|
474
|
my $form = $self->{attributes}->VersionForm; |
54
|
93
|
100
|
|
|
|
672
|
unless ( $string =~ /^$form$/ ) { |
55
|
1
|
|
|
|
|
3
|
my $err = 'Attribute Version is NOT valid version string.'; |
56
|
1
|
|
|
|
|
8
|
require Enbld::Exception; |
57
|
1
|
|
|
|
|
9
|
croak( Enbld::Exception->new( $err, $string )); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
92
|
|
|
|
|
193
|
return $string; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |