line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::VersionCondition; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
7154
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
75
|
|
4
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
9
|
use Carp; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
151
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
357
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
3
|
|
|
|
|
230
|
|
|
3
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub initialize { |
11
|
45
|
|
|
45
|
0
|
80
|
my ( $self, $param ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
45
|
100
|
|
|
|
124
|
if ( ! defined $param ) { |
14
|
3
|
|
|
|
|
11
|
$self->{value} = 'latest'; |
15
|
3
|
|
|
|
|
4
|
$self->{is_evaluated}++; |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
5
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
42
|
100
|
|
|
|
94
|
if ( $param ) { |
21
|
41
|
|
|
|
|
136
|
$self->SUPER::initialize( $param ); |
22
|
41
|
|
|
|
|
65
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
351
|
require Enbld::Exception; |
26
|
1
|
|
|
|
|
2
|
my $err = "Attribute 'VersionCondition' isn't defined"; |
27
|
1
|
|
|
|
|
4
|
croak( Enbld::Exception->new( $err )); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub validate { |
31
|
84
|
|
|
84
|
0
|
117
|
my ( $self, $string ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
84
|
|
|
|
|
177
|
$self->SUPER::validate( $string ); |
34
|
|
|
|
|
|
|
|
35
|
82
|
100
|
|
|
|
205
|
return $string if ( $string eq 'latest' ); |
36
|
|
|
|
|
|
|
|
37
|
60
|
|
|
|
|
225
|
my $allowed = $self->{attributes}->AllowedCondition; |
38
|
60
|
100
|
100
|
|
|
196
|
return $string if ( $allowed and ( $string eq $allowed ) ); |
39
|
|
|
|
|
|
|
|
40
|
59
|
|
|
|
|
208
|
my $form = $self->{attributes}->VersionForm; |
41
|
59
|
100
|
|
|
|
336
|
return $string if ( $string =~ /^$form$/ ); |
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
|
|
6
|
my $err = "Invalid Version Condition:$string," . |
44
|
|
|
|
|
|
|
" please check install condition"; |
45
|
2
|
|
|
|
|
389
|
require Enbld::Error; |
46
|
2
|
|
|
|
|
6
|
die( Enbld::Error->new( $err )); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |