line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AIX::LPP::lpp_name; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.005_62; |
4
|
4
|
|
|
4
|
|
3132
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
165
|
|
5
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
6830
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.5'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
2
|
|
|
2
|
1
|
222
|
my $class = shift; |
11
|
2
|
|
|
|
|
14
|
my %param = @_; |
12
|
2
|
|
|
|
|
6
|
my $self = {}; |
13
|
|
|
|
|
|
|
|
14
|
2
|
50
|
|
|
|
9
|
if (defined $param{FORMAT}) { $self->{FORMAT} = $param{FORMAT}} |
|
2
|
|
|
|
|
9
|
|
15
|
0
|
|
|
|
|
0
|
else { $self->{FORMAT} = '4'} |
16
|
2
|
50
|
|
|
|
8
|
if (defined $param{PLATFORM}) { $self->{PLATFORM} = $param{PLATFORM}} |
|
2
|
|
|
|
|
7
|
|
17
|
0
|
|
|
|
|
0
|
else { $self->{PLATFORM} = 'R'} |
18
|
2
|
50
|
|
|
|
7
|
if (defined $param{TYPE}) { $self->{TYPE} = $param{TYPE}} |
|
2
|
|
|
|
|
13
|
|
19
|
0
|
|
|
|
|
0
|
else { $self->{TYPE} = 'I'} |
20
|
2
|
50
|
|
|
|
47
|
if (defined $param{NAME}) { $self->{NAME} = $param{NAME}} |
|
2
|
|
|
|
|
184
|
|
21
|
0
|
|
|
|
|
0
|
else { $self->{NAME} = 'test.lpp'} |
22
|
2
|
|
|
|
|
6
|
$self->{FILESET} = {}; |
23
|
2
|
|
|
|
|
6
|
bless $self, $class; |
24
|
2
|
|
|
|
|
9
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub lpp { |
28
|
3
|
|
|
3
|
1
|
14
|
my $self = shift; |
29
|
1
|
|
|
|
|
3
|
return ( $self->{NAME},$self->{TYPE},$self->{FORMAT},$self->{PLATFORM}, |
30
|
3
|
100
|
|
|
|
19
|
keys %{$self->{FILESET}} ) unless @_; |
31
|
2
|
|
|
|
|
21
|
my %param = @_; |
32
|
2
|
50
|
|
|
|
15
|
if (defined $param{FORMAT}) { $self->{FORMAT} = $param{FORMAT}} |
|
2
|
|
|
|
|
22
|
|
33
|
2
|
100
|
|
|
|
31
|
if (defined $param{PLATFORM}) { $self->{PLATFORM} = $param{PLATFORM}} |
|
1
|
|
|
|
|
6
|
|
34
|
2
|
100
|
|
|
|
12
|
if (defined $param{TYPE}) { $self->{TYPE} = $param{TYPE}} |
|
1
|
|
|
|
|
5
|
|
35
|
2
|
100
|
|
|
|
14
|
if (defined $param{NAME}) { $self->{NAME} = $param{NAME}} |
|
1
|
|
|
|
|
44
|
|
36
|
2
|
|
|
|
|
16
|
return ( $self->{NAME},$self->{TYPE},$self->{FORMAT},$self->{PLATFORM}, |
37
|
2
|
|
|
|
|
10
|
keys %{$self->{FILESET}} ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub fileset { |
41
|
4
|
|
|
4
|
1
|
23
|
my $self = shift; |
42
|
4
|
|
|
|
|
9
|
my $fsname = shift; |
43
|
4
|
|
|
|
|
28
|
my %param = @_; |
44
|
4
|
100
|
|
|
|
20
|
if ( $#_ == -1 ) { |
45
|
1
|
|
|
|
|
7
|
return ($self->{FILESET}{$fsname}{NAME},$self->{FILESET}{$fsname}{VRMF}, |
46
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{DISK},$self->{FILESET}{$fsname}{BOSBOOT}, |
47
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{CONTENT},$self->{FILESET}{$fsname}{LANG}, |
48
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{DESCRIPTION}, |
49
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{COMMENTS}); |
50
|
|
|
|
|
|
|
} else { |
51
|
3
|
50
|
|
|
|
43
|
if ( ! exists $self->{FILESET}{$fsname} ) { |
52
|
3
|
|
|
|
|
44
|
$self->{FILESET}{$fsname} = { |
53
|
|
|
|
|
|
|
NAME => $fsname, |
54
|
|
|
|
|
|
|
VRMF => $param{VRMF}, |
55
|
|
|
|
|
|
|
DISK => $param{DISK}, |
56
|
|
|
|
|
|
|
BOSBOOT => $param{BOSBOOT}, |
57
|
|
|
|
|
|
|
CONTENT => $param{CONTENT}, |
58
|
|
|
|
|
|
|
LANG => $param{LANG}, |
59
|
|
|
|
|
|
|
DESCRIPTION => $param{DESCRIPTION}, |
60
|
|
|
|
|
|
|
COMMENTS => $param{COMMENTS}, |
61
|
|
|
|
|
|
|
REQ => [ ], |
62
|
|
|
|
|
|
|
SIZEINFO => { } |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
} else { |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
3
|
|
|
|
|
37
|
return ( $self->{FILESET}{$fsname}{NAME}, |
70
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{VRMF}, |
71
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{DISK}, |
72
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{BOSBOOT}, |
73
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{CONTENT}, |
74
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{LANG}, |
75
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{DESCRIPTION}, |
76
|
|
|
|
|
|
|
$self->{FILESET}{$fsname}{COMMENTS}); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub sizeinfo { |
80
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
81
|
1
|
|
|
|
|
2
|
my $fset = shift; |
82
|
1
|
|
|
|
|
2
|
my $size_ref = shift; |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
14
|
$self->{FILESET}{$fset}{SIZEINFO} = $size_ref; |
85
|
1
|
|
|
|
|
3
|
return $self->{FILESET}{$fset}{SIZEINFO}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub requisites { |
89
|
2
|
|
|
2
|
1
|
12
|
my $self = shift; |
90
|
2
|
|
|
|
|
5
|
my $fset = shift; |
91
|
2
|
|
|
|
|
6
|
my $ref_req = shift; |
92
|
|
|
|
|
|
|
|
93
|
2
|
|
|
|
|
8
|
$self->{FILESET}{$fset}{REQ} = $ref_req; |
94
|
2
|
|
|
|
|
8
|
return $self->{FILESET}{$fset}{REQ}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
0
|
1
|
0
|
sub validate { |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub read { |
102
|
1
|
|
|
1
|
1
|
382599
|
my $class = shift; |
103
|
1
|
|
|
|
|
5
|
my $fh = shift; |
104
|
1
|
|
|
|
|
7
|
my $self = {}; |
105
|
1
|
|
|
|
|
6
|
bless $self, $class; |
106
|
|
|
|
|
|
|
|
107
|
1
|
|
|
|
|
72
|
chomp (my $line = <$fh>); |
108
|
1
|
|
|
|
|
17
|
my ($format,$platform,$type,$name,$token) = split / /, $line; |
109
|
1
|
|
|
|
|
16
|
$self->lpp(NAME => $name, FORMAT => $format, TYPE => $type, |
110
|
|
|
|
|
|
|
PLATFORM => $platform); |
111
|
1
|
|
|
|
|
6
|
chomp ($line = <$fh>); |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# add while loop here to process fileset headers |
114
|
|
|
|
|
|
|
|
115
|
1
|
|
|
|
|
15
|
my ($fsn,$vrmf,$disk,$bosboot,$content,$lang,@desc) = split / /, $line; |
116
|
1
|
|
|
|
|
16
|
$self->fileset($fsn, NAME => $fsn,VRMF => $vrmf,DISK => $disk, |
117
|
|
|
|
|
|
|
BOSBOOT => $bosboot, CONTENT => $content, LANG => $lang, |
118
|
|
|
|
|
|
|
DESCRIPTION => join ' ', @desc); |
119
|
|
|
|
|
|
|
|
120
|
1
|
|
|
|
|
39
|
chomp ($line = <$fh>) until $line =~ /^\[/; |
121
|
1
|
|
|
|
|
7
|
chomp ($line = <$fh>); |
122
|
|
|
|
|
|
|
|
123
|
1
|
|
|
|
|
3
|
FSDATA: { do { |
|
1
|
|
|
|
|
3
|
|
124
|
2
|
|
|
|
|
5
|
chomp $line; |
125
|
2
|
|
|
|
|
5
|
my @reqs; |
126
|
2
|
100
|
|
|
|
17
|
last if $line =~ /^\]/; |
127
|
|
|
|
|
|
|
|
128
|
1
|
|
|
|
|
3
|
REQS: { do { |
|
1
|
|
|
|
|
4
|
|
129
|
2
|
|
|
|
|
15
|
push @reqs, [ split (/ /, $line) ]; |
130
|
2
|
|
|
|
|
18
|
chomp ($line = <$fh>); |
131
|
|
|
|
|
|
|
} until $line =~ /^%/; } |
132
|
|
|
|
|
|
|
|
133
|
1
|
|
|
|
|
9
|
$self->requisites($fsn,\@reqs); |
134
|
|
|
|
|
|
|
|
135
|
1
|
|
|
|
|
4
|
chomp ($line = <$fh>); |
136
|
1
|
|
|
|
|
3
|
SIZEINFO: { do { |
|
1
|
|
|
|
|
36
|
|
137
|
14
|
|
|
|
|
73
|
my ($loc,@size) = split (/ /, $line); |
138
|
14
|
|
|
|
|
85
|
$self->{FILESET}{$fsn}{SIZEINFO}{$loc} = join ' ', @size; |
139
|
14
|
|
|
|
|
88
|
chomp ($line = <$fh>); |
140
|
|
|
|
|
|
|
} until $line =~ /^%/; } |
141
|
|
|
|
|
|
|
|
142
|
1
|
|
|
|
|
5
|
chomp ($line = <$fh>); |
143
|
1
|
|
|
|
|
4
|
THIRD: { do { |
|
1
|
|
|
|
|
10
|
|
144
|
|
|
|
|
|
|
} until $line =~ /^%/; } |
145
|
|
|
|
|
|
|
|
146
|
1
|
|
|
|
|
5
|
chomp ($line = <$fh>); |
147
|
1
|
|
|
|
|
2
|
FOURTH: { do { |
|
1
|
|
|
|
|
9
|
|
148
|
|
|
|
|
|
|
} until $line =~ /^%/; } |
149
|
|
|
|
|
|
|
|
150
|
1
|
|
|
|
|
4
|
chomp ($line = <$fh>); |
151
|
1
|
|
|
|
|
3
|
FIFTH: { do { |
|
1
|
|
|
|
|
25
|
|
152
|
|
|
|
|
|
|
} until $line =~ /^%/; } |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
} while ($line = <$fh>); } |
155
|
|
|
|
|
|
|
|
156
|
1
|
|
|
|
|
9
|
return $self; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub write { |
160
|
2
|
|
|
2
|
1
|
19
|
my $self = shift; |
161
|
2
|
|
|
|
|
5
|
my $fh = shift; |
162
|
|
|
|
|
|
|
|
163
|
2
|
|
|
|
|
121
|
print $fh join ' ', $self->{FORMAT}, $self->{PLATFORM}, $self->{TYPE}, |
164
|
|
|
|
|
|
|
$self->{NAME}, "{\n"; |
165
|
2
|
|
|
|
|
6
|
foreach my $fileset (keys %{$self->{FILESET}} ) { |
|
2
|
|
|
|
|
72
|
|
166
|
2
|
|
|
|
|
27
|
print $fh join ' ', $self->{FILESET}{$fileset}{NAME}, |
167
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{VRMF}, |
168
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{DISK}, |
169
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{BOSBOOT}, |
170
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{CONTENT}, |
171
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{LANG}, |
172
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{DESCRIPTION}, "\n[\n"; |
173
|
|
|
|
|
|
|
|
174
|
2
|
|
|
|
|
5
|
for my $i ( 0 .. $#{$self->{FILESET}{$fileset}{REQ}} ) { |
|
2
|
|
|
|
|
14
|
|
175
|
2
|
|
|
|
|
7
|
print $fh join ' ',@{${$self->{FILESET}{$fileset}{REQ}}[$i]},"\n"; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
28
|
|
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
2
|
|
|
|
|
8
|
print $fh "%\n"; |
179
|
2
|
|
|
|
|
7
|
foreach my $key (sort keys %{$self->{FILESET}{$fileset}{SIZEINFO}}) { |
|
2
|
|
|
|
|
28
|
|
180
|
14
|
|
|
|
|
63
|
print $fh join ' ', $key, |
181
|
|
|
|
|
|
|
$self->{FILESET}{$fileset}{SIZEINFO}{$key}, "\n"; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
2
|
|
|
|
|
10
|
print $fh "%\n%\n%\n%\n]\n"; |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
2
|
|
|
|
|
17
|
print $fh "}"; |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
1; |
191
|
|
|
|
|
|
|
__END__ |