line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::VersionCondition; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
9586
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
143
|
|
4
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
108
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
13
|
use Carp; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
215
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
416
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
3
|
|
|
|
|
282
|
|
|
3
|
|
|
|
|
20
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub initialize { |
11
|
45
|
|
|
45
|
0
|
94
|
my ( $self, $param ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
45
|
100
|
|
|
|
129
|
if ( ! defined $param ) { |
14
|
3
|
|
|
|
|
20
|
$self->{value} = 'latest'; |
15
|
3
|
|
|
|
|
6
|
$self->{is_evaluated}++; |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
6
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
42
|
100
|
|
|
|
90
|
if ( $param ) { |
21
|
41
|
|
|
|
|
186
|
$self->SUPER::initialize( $param ); |
22
|
41
|
|
|
|
|
81
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
4
|
require Enbld::Exception; |
26
|
1
|
|
|
|
|
1
|
my $err = "Attribute 'VersionCondition' isn't defined"; |
27
|
1
|
|
|
|
|
4
|
croak( Enbld::Exception->new( $err )); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub validate { |
31
|
84
|
|
|
84
|
0
|
114
|
my ( $self, $string ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
84
|
|
|
|
|
226
|
$self->SUPER::validate( $string ); |
34
|
|
|
|
|
|
|
|
35
|
82
|
100
|
|
|
|
189
|
return $string if ( $string eq 'latest' ); |
36
|
|
|
|
|
|
|
|
37
|
60
|
|
|
|
|
255
|
my $allowed = $self->{attributes}->AllowedCondition; |
38
|
60
|
100
|
100
|
|
|
164
|
return $string if ( $allowed and ( $string eq $allowed ) ); |
39
|
|
|
|
|
|
|
|
40
|
59
|
|
|
|
|
228
|
my $form = $self->{attributes}->VersionForm; |
41
|
59
|
100
|
|
|
|
367
|
return $string if ( $string =~ /^$form$/ ); |
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
|
|
4
|
my $err = "Invalid Version Condition:$string," . |
44
|
|
|
|
|
|
|
" please check install condition"; |
45
|
2
|
|
|
|
|
482
|
require Enbld::Error; |
46
|
2
|
|
|
|
|
6
|
die( Enbld::Error->new( $err )); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |