Subversion Repositories DevTools

Rev

Rev 2040 | Rev 2450 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2040 Rev 2429
Line 41... Line 41...
41
my $opt_test = 1;
41
my $opt_test = 1;
42
my $opt_force;
42
my $opt_force;
43
my $opt_checkOperation;
43
my $opt_checkOperation;
44
my $opt_report = 0;
44
my $opt_report = 0;
45
my $opt_live;
45
my $opt_live;
-
 
46
my $opt_grep;
46
 
47
 
47
#-------------------------------------------------------------------------------
48
#-------------------------------------------------------------------------------
48
# Function        : Main Entry
49
# Function        : Main Entry
49
#
50
#
50
# Description     :
51
# Description     :
Line 61... Line 62...
61
                'database:s'    => \$opt_rm,
62
                'database:s'    => \$opt_rm,
62
                'test!'         => \$opt_test,
63
                'test!'         => \$opt_test,
63
                'force!'        => \$opt_force,
64
                'force!'        => \$opt_force,
64
                'check:s'       => \$opt_checkOperation,
65
                'check:s'       => \$opt_checkOperation,
65
                'report:+'      => \$opt_report,
66
                'report:+'      => \$opt_report,
66
                'live'          => \$opt_live,
67
                'live!'         => \$opt_live,
-
 
68
                'grep'          => \$opt_grep,          # Grep friendly - display pkg name
67
                );
69
                );
68
 
70
 
69
#
71
#
70
#   Process help and manual options
72
#   Process help and manual options
71
#
73
#
Line 114... Line 116...
114
 
116
 
115
foreach my $packageName ( $opt_package, @ARGV )
117
foreach my $packageName ( $opt_package, @ARGV )
116
{
118
{
117
    next unless ( defined $packageName );
119
    next unless ( defined $packageName );
118
    $packageName =~ s~\.data$~~;
120
    $packageName =~ s~\.data$~~;
-
 
121
    $packageName =~ s~\.svg$~~;
119
    getVcsData($packageName) if ( $opt_report <= 1 );
122
    getVcsData($packageName) if ( $opt_report <= 1 );
120
    readPackageData($packageName);
123
    readPackageData($packageName);
121
}
124
}
122
exit 0;
125
exit 0;
123
 
126
 
Line 153... Line 156...
153
{
156
{
154
    my ($pname) = @_;
157
    my ($pname) = @_;
155
    my $fname = $pname . '.data';
158
    my $fname = $pname . '.data';
156
    my @updateList;
159
    my @updateList;
157
    Verbose2 ('Reading Package Data: ' . $fname);
160
    Verbose2 ('Reading Package Data: ' . $fname);
-
 
161
return unless ( -f $fname );
158
    Error "Cannot locate $fname" unless ( -f $fname );
162
    Error "Cannot locate $fname" unless ( -f $fname );
159
    %ScmVersions = ();
163
    %ScmVersions = ();
160
    require $fname;
164
    require $fname;
161
 
165
 
162
    Error "Data in $fname is not valid\n"
166
    Error "Data in $fname is not valid\n"
Line 164... Line 168...
164
 
168
 
165
 
169
 
166
    my $essentialCount = 0;
170
    my $essentialCount = 0;
167
    my $errorCount = 0;
171
    my $errorCount = 0;
168
    my $ecount = 0;
172
    my $ecount = 0;
-
 
173
    my $notOk = 0;
169
    my $transferred = 0;
174
    my $transferred = 0;
170
    my $totalCount = 0;
175
    my $totalCount = 0;
171
    my $diffCount = 0;
176
    my $diffCount = 0;
172
    my $missingPVID = 0;
177
    my $missingPVID = 0;
173
    my $rippleProcessed = 0;
178
    my $rippleProcessed = 0;
174
    my $globalErrors = 0;
179
    my $globalErrors = 0;
175
    my $notProcessed = 0;
180
    my $notProcessed = 0;
176
    my $pkgBase = 0;
181
    my $pkgBase = 0;
-
 
182
    my $pkgProject = 0;
177
    my $adjustedPath = 0;
183
    my $adjustedPath = 0;
178
#    my $rtCount = 0;
184
#    my $rtCount = 0;
179
    my $rtErrorCount = 0;
185
    my $rtErrorCount = 0;
180
    
186
    
181
 
187
 
Line 186... Line 192...
186
        $essentialCount++ if ( $ScmVersions{$entry}{Essential}  );
192
        $essentialCount++ if ( $ScmVersions{$entry}{Essential}  );
187
        $rippleProcessed++ if ( $ScmVersions{$entry}{rippleProcessed} );
193
        $rippleProcessed++ if ( $ScmVersions{$entry}{rippleProcessed} );
188
 
194
 
189
        $globalErrors++ if ( $ScmVersions{$entry}{data}{errFlags} eq 'e' );
195
        $globalErrors++ if ( $ScmVersions{$entry}{data}{errFlags} eq 'e' );
190
        $pkgBase++ if ( $ScmVersions{$entry}{data}{BadProjectBase} );
196
        $pkgBase++ if ( $ScmVersions{$entry}{data}{BadProjectBase} );
-
 
197
        $pkgProject++ if ( $ScmVersions{$entry}{data}{BadMakeProject} );
191
        $adjustedPath++ if ( $ScmVersions{$entry}{data}{adjustedPath} );
198
        $adjustedPath++ if ( $ScmVersions{$entry}{data}{adjustedPath} );
192
        unless ( $ScmVersions{$entry}{TagCreated} )
199
        unless ( $ScmVersions{$entry}{TagCreated} )
193
        {
200
        {
194
            $errorCount++ if ( $ScmVersions{$entry}{Essential}  );
201
            $errorCount++ if ( $ScmVersions{$entry}{Essential}  );
195
            $ecount++;
202
            $ecount++;
196
            Verbose ("Package Not Processed: " . $ScmVersions{$entry}{vname} . ' - ' . ($ScmVersions{$entry}{data}{errStr} || 'Unspecified Error')  );
203
            Verbose ("Package Not Processed: " . $ScmVersions{$entry}{vname} . ' - ' . ($ScmVersions{$entry}{data}{errStr} || 'Unspecified Error')  );
-
 
204
 
-
 
205
            unless ( $ScmVersions{$entry}{DeadWood} ||  $ScmVersions{$entry}{locked} eq 'N' )
-
 
206
            {
-
 
207
                $notOk++;
-
 
208
#Warning ("Package Not OK: " . $ScmVersions{$entry}{vname} . ' - ' . ($ScmVersions{$entry}{data}{errStr} || 'Unspecified Error')  );
-
 
209
            }
-
 
210
 
197
        }
211
        }
198
 
212
 
199
#        $rtCount += $ScmVersions{$entry}{data}{ReleaseTag}{tCount} || 0;
213
#        $rtCount += $ScmVersions{$entry}{data}{ReleaseTag}{tCount} || 0;
200
#        $rtErrorCount += $ScmVersions{$entry}{data}{ReleaseTag}{eCount} || 0;
214
#        $rtErrorCount += $ScmVersions{$entry}{data}{ReleaseTag}{eCount} || 0;
201
    }
215
    }
Line 230... Line 244...
230
            Verbose ("Processed: " . $ScmVersions{$entry}{vname} . ' :: ' . ($rmRef || '???') . $done );
244
            Verbose ("Processed: " . $ScmVersions{$entry}{vname} . ' :: ' . ($rmRef || '???') . $done );
231
            
245
            
232
        }
246
        }
233
    }
247
    }
234
 
248
 
-
 
249
    if ( $opt_report == 3 )
-
 
250
    {
-
 
251
        #
-
 
252
        #   Just the packages that have no problems
-
 
253
        #   Short form
-
 
254
        #
-
 
255
#Debug0("$pname", $notOk ,$globalErrors ,$pkgBase ,$pkgProject ,$errorCount ,$notProcessed ,$rtErrorCount);
-
 
256
        return if ( $notOk ||$globalErrors || $pkgBase || $pkgProject ||  $errorCount || $notProcessed || $rtErrorCount );
-
 
257
        print ("$pname\n");
-
 
258
        return;
-
 
259
    }
-
 
260
 
-
 
261
    if ( $opt_report == 4 )
-
 
262
    {
-
 
263
        #
-
 
264
        #   Just the packages that Global Errors
-
 
265
        #   Short form
-
 
266
        #
-
 
267
        return if (  !$globalErrors);
-
 
268
        print ("$pname\n");
-
 
269
        return;
-
 
270
    }
-
 
271
    
-
 
272
    
235
    if ( $opt_report )
273
    if ( $opt_report )
236
    {
274
    {
237
        return unless ($globalErrors || $pkgBase ||  $errorCount || $notProcessed || $rtErrorCount);
275
        return unless ($globalErrors || $pkgBase || $pkgProject ||  $errorCount || $notProcessed || $rtErrorCount);
238
    }
276
    }
239
 
277
 
240
    sub highlight
278
    sub highlight
241
    {
279
    {
242
        my ($value) = @_;
280
        my ($value) = @_;
243
        return $value ? ' <------' : '';
281
        return $value ? ' <------' : '';
244
    }
282
    }
245
 
283
 
246
    my $rmTotal = scalar keys %packageVcs;
284
    my $rmTotal = scalar keys %packageVcs;
-
 
285
    my $tpref = $opt_grep ? "$pname: " : '';
247
    Message ("Transfer Stats",
286
    Message ("Transfer Stats",
248
            ,"Package                   : $pname"
287
            ,"${tpref}Package                   : $pname"
249
            ,"Total RM Versions         : $rmTotal"
288
            ,"${tpref}Total RM Versions         : $rmTotal"
250
            ,"Total Packages Processed  : $totalCount"
289
            ,"${tpref}Total Packages Processed  : $totalCount"
251
            ,"Packages NOT Processed    : $notProcessed" . highlight($notProcessed)
290
            ,"${tpref}Packages NOT Processed    : $notProcessed" . highlight($notProcessed)
252
            ,"Packages pruned           : " . ($rmTotal - $totalCount)
291
            ,"${tpref}Packages pruned           : " . ($rmTotal - $totalCount)
253
            ,"Essential Packages        : $essentialCount"
292
            ,"${tpref}Essential Packages        : $essentialCount"
254
            ,"Essential Packages Errors : $errorCount" . highlight($errorCount)
293
            ,"${tpref}Essential Packages Errors : $errorCount" . highlight($errorCount)
255
            ,"Global Import Errors      : $globalErrors" . highlight($globalErrors)
294
            ,"${tpref}Global Import Errors      : $globalErrors" . highlight($globalErrors)
256
            ,"PackageBase Error         : $pkgBase" . highlight($pkgBase)
295
            ,"${tpref}PackageBase Error         : $pkgBase" . highlight($pkgBase)
-
 
296
            ,"${tpref}MakeProject Error         : $pkgProject" . highlight($pkgProject)
257
            ,"Adjusted Paths            : $adjustedPath" . highlight($adjustedPath && ($transferred - $adjustedPath))
297
            ,"${tpref}Adjusted Paths            : $adjustedPath" . highlight($adjustedPath && ($transferred - $adjustedPath))
258
            ,"Not Transferred Packages  : $ecount"
298
            ,"${tpref}Not Transferred Packages  : $ecount"
259
            ,"Transferred Packages      : $transferred" . highlight(!$transferred)
299
            ,"${tpref}Transferred Packages      : $transferred" . highlight(!$transferred)
260
#            ,"Release Tags applied      : $rtCount"
300
#            ,"${tpref}Release Tags applied      : $rtCount"
261
#            ,"Release Tag errors        : $rtErrorCount" . highlight($rtErrorCount)
301
#            ,"${tpref}Release Tag errors        : $rtErrorCount" . highlight($rtErrorCount)
262
            ,"Transfer to RM            : $diffCount"
302
            ,"${tpref}Transfer to RM            : $diffCount"
263
            ,"Missing PackageVersions   : $missingPVID" . highlight($missingPVID)
303
            ,"${tpref}Missing PackageVersions   : $missingPVID" . highlight($missingPVID)
264
            ,"Ripple Processed Early    : $rippleProcessed" . highlight($rippleProcessed)
304
            ,"${tpref}Ripple Processed Early    : $rippleProcessed" . highlight($rippleProcessed)
265
            );
305
            );
266
 
306
 
267
    if ( $opt_report )
307
    if ( $opt_report )
268
    {
308
    {
269
        return;
309
        return;
Line 472... Line 512...
472
    -help              - brief help message
512
    -help              - brief help message
473
    -help -help        - Detailed help message
513
    -help -help        - Detailed help message
474
    -man               - Full documentation
514
    -man               - Full documentation
475
    -verbose           - Enable verbosity
515
    -verbose           - Enable verbosity
476
    -[no]test          - Test update. Default: -notest
516
    -[no]test          - Test update. Default: -notest
-
 
517
    -[no]live          - Select database. Default: -nolive
477
    -package=name      - Specify single package to be processed
518
    -package=name      - Specify single package to be processed
478
    -database=name     - Default: RELMANU1 (test db) Live: RELEASEM
519
    -database=name     - Default: RELMANU1 (test db) Live: RELEASEM
479
    -[no]force         - Force update of all entries
520
    -[no]force         - Force update of all entries
480
    -check=string      - Check operation with string
521
    -check=string      - Check operation with string
481
    -report            - Report on errors
522
    -report            - Report on errors
Line 504... Line 545...
504
In test mode the program will examine each packages 'data' results file
545
In test mode the program will examine each packages 'data' results file
505
and report status and errors.
546
and report status and errors.
506
 
547
 
507
In 'notest' the program will update the Release Manager database.
548
In 'notest' the program will update the Release Manager database.
508
 
549
 
-
 
550
=item B<-[no]live>
-
 
551
 
-
 
552
Invoke the program in live-database mode. This is the NOT the default.
-
 
553
 
-
 
554
In live mode the program will access the Live Release Manager database.
-
 
555
 
-
 
556
In non-live mode the program will access the test (RELMANU1) database
-
 
557
 
509
=item B<-package=name>
558
=item B<-package=name>
510
 
559
 
511
This option will name one package to be processed. Packages to be
560
This option will name one package to be processed. Packages to be
512
processed can just be named on the command line.
561
processed can just be named on the command line.
513
 
562