| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=pod |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME Views.pm |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Object oriented interface to Clearcase Views |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=over |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=item Author |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Andrew DeFaria |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=item Revision |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$Revision: 1.12 $ |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=item Created |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Dec 29 12:07:59 PST 2005 |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=item Modified |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$Date: 2011/11/16 19:46:13 $ |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=back |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Provides access to information about Clearcase Views. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $views = new Clearcase::Views; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $nbr_views = $views->views; |
|
37
|
|
|
|
|
|
|
my @view_list = $views->views; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
print "Clearcase Views\n"; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
print "Number of views:\t\t" . $nbr_views . "\n"; |
|
42
|
|
|
|
|
|
|
print "View list:\n"; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
print "\t$_\n" foreach (@view_list); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This module implements an object oriented interface to Clearcase |
|
49
|
|
|
|
|
|
|
views. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 ROUTINES |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
The following routines are exported: |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
package Clearcase::Views; |
|
58
|
|
|
|
|
|
|
|
|
59
|
2
|
|
|
2
|
|
3303
|
use strict; |
|
|
2
|
|
|
|
|
12
|
|
|
|
2
|
|
|
|
|
120
|
|
|
60
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
196
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
2
|
|
|
2
|
|
13
|
use Clearcase; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
1884
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub new (;$) { |
|
65
|
0
|
|
|
0
|
1
|
|
my ($class, $region) = @_; |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=pod |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 new |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Construct a new Clearcase Views object. |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Parameters: |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=for html |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=over |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item none |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=back |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=for html |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns: |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=for html |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=over |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item Clearcase Views object |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=back |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=for html |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
|
98
|
|
|
|
|
|
|
|
|
99
|
0
|
|
0
|
|
|
|
$region ||= $Clearcase::CC->region || ''; |
|
|
|
|
0
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
my ($status, @output) = |
|
102
|
|
|
|
|
|
|
$Clearcase::CC->execute ("lsview -short -region $region"); |
|
103
|
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
$class = bless {views => \@output,}, $class; # bless |
|
105
|
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return $class; |
|
107
|
|
|
|
|
|
|
} # new |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub views () { |
|
110
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=pod |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 views |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Return a list of view tags in an array context or the number of views in |
|
117
|
|
|
|
|
|
|
a scalar context. |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Parameters: |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=for html |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=over |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item none |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=back |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=for html |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Returns: |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=for html |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=over |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item List of views or number of views |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Array of view tags in an array context or the number of views in a scalar context. |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=back |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=for html |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
|
146
|
|
|
|
|
|
|
|
|
147
|
0
|
0
|
|
|
|
|
if (wantarray) { |
|
148
|
0
|
0
|
|
|
|
|
return $self->{views} ? sort @{$self->{views}} : (); |
|
|
0
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
} else { |
|
150
|
0
|
0
|
|
|
|
|
return $self->{views} ? scalar @{$self->{views}} : 0; |
|
|
0
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
} #if |
|
152
|
|
|
|
|
|
|
} # views |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub dynamic () { |
|
155
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=pod |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head2 dynamic |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Return the number of dynamic views |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Parameters: |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=for html |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=over |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item none |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=back |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=for html |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Returns: |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=for html |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=over |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item number of dynamic views |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Returns the number of dynamic views in the region |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=back |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=for html |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=cut |
|
190
|
|
|
|
|
|
|
|
|
191
|
0
|
0
|
|
|
|
|
$self->updateViewInfo if !defined $self->{dynamic}; |
|
192
|
0
|
|
|
|
|
|
return $self->{dynamic}; |
|
193
|
|
|
|
|
|
|
} # dynamic |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub ucm () { |
|
196
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=pod |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head2 ucm |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Return the number of ucm views |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Parameters: |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=for html |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=over |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=item none |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=back |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=for html |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
Returns: |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=for html |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item number of ucm views |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Returns the number of ucm views in the region |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=back |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=for html |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=cut |
|
231
|
|
|
|
|
|
|
|
|
232
|
0
|
0
|
|
|
|
|
$self->updateViewInfo if !defined $self->{ucm}; |
|
233
|
0
|
|
|
|
|
|
return $self->{ucm}; |
|
234
|
|
|
|
|
|
|
} # ucm |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub snapshot () { |
|
237
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=pod |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=head2 snapshot |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
Return the number of snapshot views |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Parameters: |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=for html |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=over |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=item none |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=back |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=for html |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Returns: |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=for html |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=over |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=item number of snapshot views |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
Returns the number of snapshot views in the region |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=back |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=for html |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=cut |
|
272
|
|
|
|
|
|
|
|
|
273
|
0
|
0
|
|
|
|
|
$self->updateViewInfo if !defined $self->{snapshot}; |
|
274
|
0
|
|
|
|
|
|
return $self->{snapshot}; |
|
275
|
|
|
|
|
|
|
} # snapshot |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
sub web () { |
|
278
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=pod |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head2 web |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
Return the number of web views |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
Parameters: |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=for html |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=over |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=item none |
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=back |
|
295
|
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=for html |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
Returns: |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=for html |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=over |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=item number of web views |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
Returns the number of web views in the region |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=back |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=for html |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=cut |
|
313
|
|
|
|
|
|
|
|
|
314
|
0
|
0
|
|
|
|
|
$self->updateViewInfo if !defined $self->{web}; |
|
315
|
0
|
|
|
|
|
|
return $self->{web}; |
|
316
|
|
|
|
|
|
|
} # web |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
sub updateViewInfo ($) { |
|
319
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
|
320
|
|
|
|
|
|
|
|
|
321
|
0
|
|
|
|
|
|
my ($dynamic, $web, $ucm, $snapshot) = (0, 0, 0, 0); |
|
322
|
|
|
|
|
|
|
|
|
323
|
0
|
|
|
|
|
|
foreach ($self->views) { |
|
324
|
0
|
|
|
|
|
|
my ($status, @lsview_out) = |
|
325
|
|
|
|
|
|
|
$Clearcase::CC->execute ("lsview -properties -full $_"); |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
next |
|
328
|
0
|
0
|
|
|
|
|
if $status; |
|
329
|
|
|
|
|
|
|
|
|
330
|
0
|
|
|
|
|
|
foreach (@lsview_out) { |
|
331
|
0
|
0
|
|
|
|
|
if (/Properties/) { |
|
332
|
0
|
0
|
|
|
|
|
$dynamic++ |
|
333
|
|
|
|
|
|
|
if /dynamic/; |
|
334
|
0
|
0
|
0
|
|
|
|
$snapshot++ |
|
335
|
|
|
|
|
|
|
if /snapshot/ and not /webview/; |
|
336
|
0
|
0
|
|
|
|
|
$ucm++ |
|
337
|
|
|
|
|
|
|
if /ucmview/; |
|
338
|
0
|
0
|
|
|
|
|
$web++ |
|
339
|
|
|
|
|
|
|
if /webview/; |
|
340
|
0
|
|
|
|
|
|
last; |
|
341
|
|
|
|
|
|
|
} # if |
|
342
|
|
|
|
|
|
|
} # foreach |
|
343
|
|
|
|
|
|
|
|
|
344
|
0
|
|
|
|
|
|
$self->{dynamic} = $dynamic; |
|
345
|
0
|
|
|
|
|
|
$self->{web} = $web; |
|
346
|
0
|
|
|
|
|
|
$self->{ucm} = $ucm; |
|
347
|
0
|
|
|
|
|
|
$self->{snapshot} = $snapshot; |
|
348
|
|
|
|
|
|
|
} # foreach |
|
349
|
|
|
|
|
|
|
|
|
350
|
0
|
|
|
|
|
|
return; |
|
351
|
|
|
|
|
|
|
} # updateViewInfo |
|
352
|
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
1; |
|
354
|
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=head2 Modules |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=over |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
=item L |
|
362
|
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=back |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head1 INCOMPATABILITIES |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
None |
|
368
|
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
There are no known bugs in this module. |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
Please report problems to Andrew DeFaria . |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
Copyright (C) 2020 by Andrew@DeFaria.com |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
|
380
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.38.0 or, |
|
381
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
|
382
|
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=cut |