line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Dist::Inno::System; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Object that represents [Run] or [UninstallRun] system call entries. |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
49273
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
6
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
8
|
1
|
|
|
1
|
|
10
|
use Carp qw{ croak }; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
54
|
|
9
|
1
|
|
|
1
|
|
910
|
use Params::Util qw{ _IDENTIFIER _STRING }; |
|
1
|
|
|
|
|
7191
|
|
|
1
|
|
|
|
|
75
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
7
|
use vars qw{$VERSION}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
12
|
|
|
|
|
|
|
BEGIN { |
13
|
1
|
|
|
1
|
|
21
|
$VERSION = '1.16'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
6
|
use Object::Tiny qw{ |
17
|
|
|
|
|
|
|
section |
18
|
|
|
|
|
|
|
filename |
19
|
|
|
|
|
|
|
description |
20
|
|
|
|
|
|
|
parameters |
21
|
|
|
|
|
|
|
working_dir |
22
|
|
|
|
|
|
|
status_msg |
23
|
|
|
|
|
|
|
run_once_id |
24
|
|
|
|
|
|
|
verbs |
25
|
|
|
|
|
|
|
flags |
26
|
1
|
|
|
1
|
|
1011
|
}; |
|
1
|
|
|
|
|
318
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
##################################################################### |
33
|
|
|
|
|
|
|
# Constructors |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
1
|
|
|
1
|
0
|
2
|
my $class = shift; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Create the object |
39
|
1
|
|
|
|
|
8
|
my $self = bless { @_ }, $class; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Check params |
42
|
1
|
50
|
33
|
|
|
31
|
unless ( |
43
|
|
|
|
|
|
|
defined $self->section |
44
|
|
|
|
|
|
|
and |
45
|
|
|
|
|
|
|
$self->section =~ /^(?:Run|UninstallRun)$/ |
46
|
|
|
|
|
|
|
) { |
47
|
0
|
|
|
|
|
0
|
croak("Missing or invalid 'section' param"); |
48
|
|
|
|
|
|
|
} |
49
|
1
|
50
|
33
|
|
|
72
|
if ( |
50
|
|
|
|
|
|
|
defined $self->description |
51
|
|
|
|
|
|
|
and |
52
|
|
|
|
|
|
|
$self->section eq 'Run' |
53
|
|
|
|
|
|
|
) { |
54
|
0
|
|
|
|
|
0
|
croak("A Description is only valid in a [Run] block"); |
55
|
|
|
|
|
|
|
} |
56
|
1
|
50
|
33
|
|
|
29
|
if ( |
57
|
|
|
|
|
|
|
defined $self->status_msg |
58
|
|
|
|
|
|
|
and |
59
|
|
|
|
|
|
|
$self->section eq 'Run' |
60
|
|
|
|
|
|
|
) { |
61
|
0
|
|
|
|
|
0
|
croak("A StatusMsg is only valid in a [Run] block"); |
62
|
|
|
|
|
|
|
} |
63
|
1
|
50
|
33
|
|
|
26
|
if ( |
64
|
|
|
|
|
|
|
defined $self->run_once_id |
65
|
|
|
|
|
|
|
and |
66
|
|
|
|
|
|
|
$self->section eq 'UninstallRun' |
67
|
|
|
|
|
|
|
) { |
68
|
0
|
|
|
|
|
0
|
croak("A RunOnceId is only valid in an [UninstallRun] block"); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
8
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub run { |
75
|
|
|
|
|
|
|
shift->new( |
76
|
1
|
|
|
1
|
0
|
16
|
section => 'Run', |
77
|
|
|
|
|
|
|
@_, |
78
|
|
|
|
|
|
|
); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub uninstallrun { |
82
|
|
|
|
|
|
|
shift->new( |
83
|
0
|
|
|
0
|
0
|
0
|
section => 'UninstallRun', |
84
|
|
|
|
|
|
|
@_, |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
##################################################################### |
93
|
|
|
|
|
|
|
# Main Methods |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub as_string { |
96
|
1
|
|
|
1
|
0
|
2507
|
my $self = shift; |
97
|
1
|
|
|
|
|
2
|
my @flags = (); |
98
|
|
|
|
|
|
|
# push @flags, 'flag_name' if $self->flag_name; |
99
|
1
|
50
|
|
|
|
25
|
return join( '; ', |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
100
|
|
|
|
|
|
|
(defined $self->filename) |
101
|
|
|
|
|
|
|
? ("Filename: \"" . $self->filename . "\"") |
102
|
|
|
|
|
|
|
: (), |
103
|
|
|
|
|
|
|
(defined $self->description) |
104
|
|
|
|
|
|
|
? ("Description: \"" . $self->description . "\"") |
105
|
|
|
|
|
|
|
: (), |
106
|
|
|
|
|
|
|
(defined $self->parameters) |
107
|
|
|
|
|
|
|
? ("Parameters: \"" . $self->parameters . "\"") |
108
|
|
|
|
|
|
|
: (), |
109
|
|
|
|
|
|
|
(defined $self->working_dir) |
110
|
|
|
|
|
|
|
? ("WorkingDir: \"" . $self->working_dir . "\"") |
111
|
|
|
|
|
|
|
: (), |
112
|
|
|
|
|
|
|
(defined $self->status_msg) |
113
|
|
|
|
|
|
|
? ("StatusMsg: \"" . $self->status_msg . "\"") |
114
|
|
|
|
|
|
|
: (), |
115
|
|
|
|
|
|
|
(defined $self->run_once_id) |
116
|
|
|
|
|
|
|
? ("RunOnceId: \"" . $self->run_once_id . "\"") |
117
|
|
|
|
|
|
|
: (), |
118
|
|
|
|
|
|
|
(defined $self->verbs) |
119
|
|
|
|
|
|
|
? ("Verbs: \"" . $self->verbs . "\"") |
120
|
|
|
|
|
|
|
: (), |
121
|
|
|
|
|
|
|
(scalar @flags) |
122
|
|
|
|
|
|
|
? ("Flags: " . join(' ', @flags)) |
123
|
|
|
|
|
|
|
: (), |
124
|
|
|
|
|
|
|
); |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |