deprecated/buildtools/commonbldutils/sbsv2htmlscanlog/sbsv2htmlscanlog.pl
author Ross Qin <ross.qin@nokia.com>
Fri, 29 Oct 2010 10:03:48 +0800
changeset 670 46ea84d14897
parent 655 3f65fd25dfd4
permissions -rw-r--r--
remove migrated template meta data files (in DFS_MCL wk42)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     2
# All rights reserved.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     3
# This component and the accompanying materials are made available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     5
# which accompanies this distribution, and is available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     7
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     8
# Initial Contributors:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    10
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    11
# Contributors:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    12
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    13
# Description:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    14
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
# summarise an automated build log
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
use strict;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
use Getopt::Long;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
use HTML::Entities;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
use Carp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
use File::stat;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
use FindBin;		# for FindBin::Bin
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
# Add the directory contain this perl script into the path to find modules
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
use lib $FindBin::Bin;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
use sbsv2scanlog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
# For Date calculations
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
use lib "$FindBin::Bin/../lib"; # For running in source
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
use lib "$FindBin::Bin/build/lib"; # For running in epoc32\tools
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
use XML::Parser;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
# Variables
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
my $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
my $iSlurp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
my %Components;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
my %Commands;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
my $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
my $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
my %errors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
my %warnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
my %remarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
my %migrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
my %AdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
my %CmdErrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
my %CmdWarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
my %CmdRemarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
my %CmdMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
my %CmdAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
my %missing;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
my %not_built;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
my $starttime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
my $duration;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
my $currentfiletime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
my $warningcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
my $errorcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
my $remarkcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
my $migrationNoteCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
my $AdvisoryNoteCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
my ($iStatus, $iName);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
my $warningmigrated;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
my %htmlColours=(
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
"errors" =>"#ff0000",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
"warnings" =>"#fff000",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
"remarks" =>"#ffccff",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
"migrationNotes" =>"#ffcc99",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
"AdvisoryNotes" => "#ffa500"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
my $MigrateNextExitCode = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
my $inRecipe = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
my $RetryInProgress = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
# Package variables - these can also be accessed the from package "SubHandlers"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
use vars qw($component $command %Components %Commands);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
our $iLog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
my $Dsec;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
# Main section
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
my ($iOutput, $iTitle, $iVerbose, @iLogs) =&ProcessCommandLine();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
# Open Output file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
  open (HTML, ">$iOutput") or die "Couldn't open $iOutput for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
# Parse each log File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
foreach $iLog (@iLogs) # parses through all logs 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
    # Check the log file exists
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
    if (-e $iLog)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
        # Process the logs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
        &ProcessLog();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
      print "WARNING: $iLog does not exist\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
&PrintResults($iTitle);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
# Print HTML Footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
&PrintHTMLFooter();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
# ProcessLog
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
# $iLog - Logfile name
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
sub ProcessLog()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
  #Clear current file time as starting processing a new log
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
  $currentfiletime = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
  print "Processing: $iLog\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
  my $iParser = XML::Parser->new(Style => 'Subs', Pkg => 'MySubs' , ErrorContext => 2,
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
                                 Handlers => {Char => \&char_handler});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
  # Supply the XML Parser the data source
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
  eval {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
    $iParser->parsefile($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
  };
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
  #Set current component and command to special values to record log processing errors/warnings/etc
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
  $component = 'sbsv2scanlog';    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
  $command = 'sbsv2scanlog';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
  #Check for parse errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
  if ($@)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
    #Generate error in log as the file time stamps are duff
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
    &do_error($iLog, "No_linenumer", "XML Parse error:$@");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
    $Components{$component} = '0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
    $Commands{$command} ='0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
  # Calculate the Total Duration
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
  # $currentfiletime is set from the info tags at the end of the log.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
  $duration += $currentfiletime;  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
  #Clear current component and command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
  $component = '';    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
  $command = ''; 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
# PrintResults
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   157
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   158
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   159
# $iTitle (Title for Log file)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
# This function prints all the data as HTML
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
sub PrintResults
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
  my ($iTitle) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
  my $title;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
  # Print Heading of Log File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
  my $heading ="Overall";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
  print HTML qq{<h1>$iTitle</h1>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
  print HTML qq{<h2>$heading</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
  # Calculate the total number of remarks messages
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
	$remarkcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
	foreach $component (sort {lc $a cmp lc $b} keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
		$remarkcount += scalar(@{$remarks{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
  # Calculate the Total number of errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
  	$errorcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
	foreach $component (sort {lc $a cmp lc $b} keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
		$errorcount += scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
  # Calculate the total number of warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
	$warningcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
	foreach $component (sort {lc $a cmp lc $b} keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
		$warningcount += scalar(@{$warnings{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
  # Calculate the total number of migration notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
  $migrationNoteCount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
  foreach $component (sort {lc $a cmp lc $b} keys %migrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
    $migrationNoteCount += scalar(@{$migrationNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
  # Calculate the total number of Advisory notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
  $AdvisoryNoteCount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
  foreach $component (sort {lc $a cmp lc $b} keys %AdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
    $AdvisoryNoteCount += scalar(@{$AdvisoryNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
  &StartHTMLTable();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
  # Print the Totals
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
  &HTMLTableRow($heading,"Total", $duration, $errorcount, $warningcount, $AdvisoryNoteCount, $remarkcount, $migrationNoteCount);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
  # By Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
  print HTML qq{<h2>By Component</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
  $title="Component";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
  &StartHTMLTable($title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
  # Print the by Component Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
    foreach $component (sort {lc $a cmp lc $b} keys %Components)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
      # Calculate the number errors and warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
      if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
        # No Remarks were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
        $totalremarks = scalar(@{$remarks{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
      if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
        $totalerrors = scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
      if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
        $totalwarnings = scalar(@{$warnings{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
      if (!defined $migrationNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
        $totalMigrationNotes = scalar(@{$migrationNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
      if (!defined $AdvisoryNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
        $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
        $totalAdvisoryNotes = scalar(@{$AdvisoryNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
      # Print the Table Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
      &HTMLTableRow($title,$component, $Components{$component}, $totalerrors, $totalwarnings, $totalAdvisoryNotes,$totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
  # By Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
  print HTML qq{<h2>By Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
  $title="Command";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
  &StartHTMLTable($title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
  # Print the by Command Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
    foreach $command (sort {lc $a cmp lc $b} keys %Commands)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
      # Calculate the number errors, warnings and remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
      if (!defined $CmdRemarks{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
        # No Remarks were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
        $totalremarks = scalar(@{$CmdRemarks{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
      if (!defined $CmdErrors{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
        $totalerrors = scalar(@{$CmdErrors{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   318
      if (!defined $CmdWarnings{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   319
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   320
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
        $totalwarnings = scalar(@{$CmdWarnings{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
      if (!defined $CmdMigrationNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
        $totalMigrationNotes = scalar(@{$CmdMigrationNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   334
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   335
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   336
      if (!defined $CmdAdvisoryNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
        $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   342
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   343
        $totalAdvisoryNotes = scalar(@{$CmdAdvisoryNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   344
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
      # Print the Table Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
	  &HTMLTableRow($title,$command, $Commands{$command}, $totalerrors, $totalwarnings, $totalAdvisoryNotes, $totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
  # Print Things Missing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
  if (scalar %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
	my $count = scalar keys %missing;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
	print HTML qq{<h2>Things Missing ($count)</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
	print HTML "Don't know how to make...\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
	foreach my $file (sort {lc $a cmp lc $b} keys %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
		printf HTML "%d\t%s</BR>\n", $missing{$file}, $file;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365
  print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   366
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   367
  # Print Things Not Built
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   368
  if (scalar %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   369
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   370
	my $count = scalar keys %not_built;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   371
	print HTML qq{<h2>Things Not Built ($count)</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   372
	foreach my $file (sort {lc $a cmp lc $b} keys %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   373
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   374
		print HTML "MISSING: $file ($not_built{$file})</BR>\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   375
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   376
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   377
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   378
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   379
  # Print the Actual Errors by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   380
  if ($iVerbose > 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   381
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   382
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   383
    if (scalar(keys %errors))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   384
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   385
      print HTML qq{<h2><a name="errorsByOverall_Total">Error Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   386
	  foreach $component (sort {lc $a cmp lc $b} keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   387
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   388
			my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   389
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   390
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   391
			my $count = scalar @{$errors{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   392
			print HTML qq{<h3><a name="errorsByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   393
			foreach $line (@{$errors{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   394
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   395
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   396
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   397
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   398
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   399
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   400
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   401
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   402
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   403
  # Print the Actual Warning by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   404
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   405
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   406
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   407
    if (scalar(keys %warnings))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   408
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   409
      print HTML qq{<h2><a name="warningsByOverall_Total">Warning Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   410
      foreach $component (sort {lc $a cmp lc $b} keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   411
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   412
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   413
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   414
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   415
		  my $count = scalar @{$warnings{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   416
          print HTML qq{<h3><a name="warningsByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   417
          foreach $line (@{$warnings{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   418
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   419
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   420
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   421
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   422
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   423
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   424
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   425
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   426
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   427
  # Print the Actual Advisory Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   428
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   429
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   430
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   431
    if (scalar(keys %AdvisoryNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   432
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   433
      print HTML qq{<h2><a name="AdvisoryNotesByOverall_Total">Advisory Note Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   434
      foreach $component (sort {lc $a cmp lc $b} keys %AdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   435
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   436
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   437
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   438
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   439
		     my $count = scalar @{$AdvisoryNotes{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   440
          print HTML qq{<h3><a name="AdvisoryNotesByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   441
          foreach $line (@{$AdvisoryNotes{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   442
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   443
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   444
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   445
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   446
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   447
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   448
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   449
  }  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   450
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   451
  # Print the Actual Remarks by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   452
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   453
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   454
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   455
    if (scalar(keys %remarks))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   456
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   457
      print HTML qq{<h2><a name="remarksByOverall_Total">Remarks Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   458
	  foreach $component (sort {lc $a cmp lc $b} keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   459
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   460
			my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   461
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   462
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   463
			my $count = scalar @{$remarks{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   464
			print HTML qq{<h3><a name="remarksByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   465
			foreach $line (@{$remarks{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   466
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   467
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   468
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   469
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   470
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   471
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   472
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   473
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   474
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   475
   # Print the Actual Migration Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   476
if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   477
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   478
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   479
    if (scalar(keys %migrationNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   480
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   481
      print HTML qq{<h2><a name="migrationNotesByOverall_Total">Migration Note Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   482
      foreach $component (sort {lc $a cmp lc $b} keys %migrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   483
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   484
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   485
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   486
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   487
		     my $count = scalar @{$migrationNotes{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   488
          print HTML qq{<h3><a name="migrationNotesByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   489
          foreach $line (@{$migrationNotes{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   490
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   491
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   492
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   493
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   494
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   495
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   496
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   497
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   498
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   499
  # Print the Actual Errors by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   500
  if ($iVerbose > 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   501
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   502
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   503
    if (scalar(keys %CmdErrors))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   504
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   505
      print HTML qq{<h2>Error Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   506
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdErrors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   507
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   508
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   509
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   510
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   511
			print HTML qq{<h3><a name="errorsByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   512
			foreach $line (@{$CmdErrors{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   513
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   514
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   515
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   516
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   517
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   518
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   519
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   520
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   521
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   522
  # Print the Actual Warning by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   523
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   524
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   525
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   526
    if (scalar(keys %CmdWarnings))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   527
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   528
      print HTML qq{<h2>Warning Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   529
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdWarnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   530
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   531
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   532
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   533
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   534
			print HTML qq{<h3><a name="warningsByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   535
			foreach $line (@{$CmdWarnings{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   536
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   537
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   538
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   539
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   540
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   541
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   542
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   543
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   544
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   545
  # Print the Actual Advisory Notes by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   546
  if ($iVerbose >1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   547
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   548
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   549
    if (scalar(keys %CmdAdvisoryNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   550
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   551
      print HTML qq{<h2>Advisory Note Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   552
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   553
      foreach $command (sort {lc $a cmp lc $b} keys %CmdAdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   554
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   555
     	  my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   556
        $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   557
        encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   558
        print HTML qq{<h3><a name="AdvisoryNotesByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   559
        foreach $line (@{$CmdAdvisoryNotes{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   560
				  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   561
				  encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   562
				  print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   563
				  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   564
        print HTML qq{</BR>\n}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   565
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   566
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   567
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   568
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   569
  # Print the Actual Remarks by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   570
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   571
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   572
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   573
    if (scalar(keys %CmdRemarks))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   574
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   575
      print HTML qq{<h2>Remarks Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   576
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdRemarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   577
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   578
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   579
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   580
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   581
			print HTML qq{<h3><a name="remarksByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   582
			foreach $line (@{$CmdRemarks{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   583
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   584
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   585
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   586
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   587
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   588
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   589
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   590
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   591
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   592
  # Print the Actual Migration Notes by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   593
  if ($iVerbose >1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   594
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   595
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   596
    if (scalar(keys %CmdMigrationNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   597
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   598
      print HTML qq{<h2>Migration Note Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   599
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   600
      foreach $command (sort {lc $a cmp lc $b} keys %CmdMigrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   601
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   602
     	  my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   603
        $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   604
        encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   605
        print HTML qq{<h3><a name="migrationNotesByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   606
        foreach $line (@{$CmdMigrationNotes{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   607
				  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   608
				  encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   609
				  print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   610
				  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   611
        print HTML qq{</BR>\n}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   612
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   613
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   614
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   615
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   616
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   617
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   618
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   619
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   620
# StartHTMLTable
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   621
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   622
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   623
# $iC1Title (Column 1 Title)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   624
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   625
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   626
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   627
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   628
# This function prints the start of the HTML Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   629
sub StartHTMLTable
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   630
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   631
  my ($iC1Title) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   632
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   633
  if ($iC1Title eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   634
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   635
    $iC1Title = "&nbsp;";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   636
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   637
    encode_entities($iC1Title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   638
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   639
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   640
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   641
  print HTML qq{<table border="1" cellpadding="0" cellspacing="0" width="100%">\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   642
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   643
  # Print the Header Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   644
  print HTML qq{<tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   645
  print HTML qq{\t<th width="50%">$iC1Title</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   646
  print HTML qq{\t<th width="15%">Time</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   647
  print HTML qq{\t<th width="8%">Errors</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   648
  print HTML qq{\t<th width="8%">Warnings</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   649
  print HTML qq{\t<th width="8%">Advisory Notes</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   650
  print HTML qq{\t<th width="8%">Remarks</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   651
  print HTML qq{\t<th width="8%">Migration Notes</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   652
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   653
  print HTML qq{</tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   654
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   656
# HTMLTableCell
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   657
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   658
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   659
# $iType	(errors,warnings,remarks,migration_notes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   660
# $iCount	(number of errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   661
# $iLink	(empty string or linktype)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   662
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   663
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   664
# Returns HTML table data element with appropriate link & background color
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   665
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   666
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   667
# Constructs HTML table element - used by HTMLTableRow to handle the formatting
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   668
# of the data cells, complete with colouring and links where appropriate.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   669
sub HTMLTableCell
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   670
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   671
   my ($iType,$iCount,$iLink)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   672
   my $td = qq{td width="8%" align="center"};	# implied by the TH elements already? 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   673
   if ($iCount != 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   674
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   675
	  $td = "$td BGCOLOR=$htmlColours{$iType}";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   676
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   677
   if ($iLink eq "" || $iCount == 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   678
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   679
      return qq{<$td>$iCount</td>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   680
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   681
   $iLink = $iType."By".$iLink;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   682
   return qq{<$td><a href="#$iLink">$iCount</a></td>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   683
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   684
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   685
# HTMLTableRow
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   686
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   687
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   688
# $iTitle (Need to differentiate between command and component to provide correct anchors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   689
# $iC1Data(Column 1 Data)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   690
# $iC2Data(Column 2 Data) (Time in seconds)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   691
# $iC3Data(Column 3 Data) (Number of errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   692
# $iC4Data(Column 4 Data) (Number of warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   693
# $iC5Data(Column 5 Data) (Number of Advisory notes )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   694
# $iC6Data(Column 6 Data) (Number of remarks )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   695
# $iC7Data(Column 7 Data) (Number of migration notes )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   696
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   697
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   698
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   699
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   700
# This function prints a line of the HTML Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   701
sub HTMLTableRow
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   702
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   703
  my ($iTitle,$iC1Data, $iC2Data, $iC3Data, $iC4Data,$iC5Data, $iC6Data, $iC7Data) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   704
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   705
  #print "$iC2Data\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   706
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   707
  # Convert the seconds in hh:mm:ss format
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   708
  $iC2Data = &ConvertSeconds($iC2Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   709
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   710
  # HTML encode the text
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   711
  encode_entities($iC1Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   712
  encode_entities($iC2Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   713
  encode_entities($iC3Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   714
  encode_entities($iC4Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   715
  encode_entities($iC5Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   716
  encode_entities($iC6Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   717
  encode_entities($iC7Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   718
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   719
  my $linkname = "$iTitle"."_"."$iC1Data";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   720
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   721
  # Print the Row, including summary in a script comment
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   722
  print HTML qq{<tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   723
  print HTML qq{<!--\t$linkname\t$iC2Data\t$iC3Data\t$iC4Data\t$iC5Data\t$iC6Data\t$iC7Data\t-->\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   724
  print HTML qq{\t<td width="50%">$iC1Data</td>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   725
  print HTML qq{\t<td width="15%" align="center">$iC2Data</td>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   726
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   727
  print HTML "\t",&HTMLTableCell("errors",  $iC3Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   728
  print HTML "\t",&HTMLTableCell("warnings",$iC4Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   729
  print HTML "\t",&HTMLTableCell("AdvisoryNotes", $iC5Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   730
  print HTML "\t",&HTMLTableCell("remarks", $iC6Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   731
  print HTML "\t",&HTMLTableCell("migrationNotes", $iC7Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   732
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   733
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   734
  print HTML qq{</tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   735
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   736
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   737
# ConvertSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   738
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   739
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   740
# $iSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   741
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   742
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   743
# $iString (seconds in hh:mm:ss)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   744
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   745
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   746
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   747
sub ConvertSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   748
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   749
  my ($iSeconds) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   750
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   751
  my ($iString);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   752
  my ($ih) = int($iSeconds/3600);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   753
  my ($im) = int(($iSeconds-($ih*3600))/60);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   754
  my ($is) = $iSeconds-($ih*3600)-($im*60);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   755
  # Print the correct format if the data is HiRes (has a decimal point in the string)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   756
  if ($is =~ /\d+\.\d+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   757
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   758
    $iString = sprintf "%d:%02d:%06.3f", $ih, $im, $is;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   759
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   760
    $iString = sprintf "%d:%02d:%02d", $ih, $im, $is;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   761
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   762
  return $iString;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   763
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   764
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   765
# ProcessCommandLine
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   766
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   767
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   768
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   769
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   770
# $iOutput (Output filename)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   771
# $iVerbose (Verbose Level)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   772
# $iLogs (Log files to process)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   773
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   774
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   775
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   776
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   777
sub ProcessCommandLine {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   778
  my ($iHelp, @iLogs, $iOutput, $iTitle, $iVerbose);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   779
  GetOptions('h' => \$iHelp, 'l=s' =>\@iLogs, 'o=s' => \$iOutput, 't=s' => \$iTitle, 'v+' => \$iVerbose);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   780
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   781
  if (($iHelp) || (!defined @iLogs) || (!defined $iOutput))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   782
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   783
    Usage();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   784
  } elsif (-e $iOutput) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   785
    die "$iOutput already exists";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   786
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   787
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   788
  foreach my $iLog (@iLogs)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   789
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   790
    warn "$iLog does not exist" if (! -e $iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   791
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   792
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   793
  # Set default title
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   794
  if ($iTitle eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   795
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   796
    $iTitle = "Log File Summary";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   797
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   798
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   799
  return($iOutput, $iTitle, $iVerbose, @iLogs);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   800
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   801
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   802
# Usage
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   803
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   804
# Output Usage Information.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   805
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   806
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   807
sub Usage {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   808
  print <<USAGE_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   809
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   810
    Usage: Scanlog.pl [options]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   811
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   812
    options:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   813
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   814
    -h  help
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   815
    -l  Log file to scan [Multiple allowed]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   816
    -o  Output file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   817
    -v  Increments Verbose level [Maximum Level = 2]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   818
    -t  Title to add to the Summary    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   819
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   820
USAGE_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   821
	exit 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   822
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   823
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   824
# PrintHTMLHeader
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   825
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   826
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   827
# $iTitle (Title for Log file)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   828
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   829
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   830
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   831
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   832
# This function print the HTML Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   833
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   834
sub PrintHTMLHeader {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   835
  my ($iTitle) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   836
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   837
   print HTML <<HTML_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   838
<HTML>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   839
<HEAD>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   840
<TITLE>$iTitle</TITLE>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   841
</HEAD>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   842
<BODY BGCOLOR="FFFFFF">
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   843
<FONT FACE="Courier New">
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   844
HTML_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   845
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   846
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   847
# PrintHTMLFooter
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   848
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   849
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   850
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   851
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   852
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   853
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   854
# This function print the HTML Footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   855
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   856
sub PrintHTMLFooter {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   857
   print HTML <<HTML_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   858
</FONT>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   859
</BODY>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   860
</HTML>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   861
HTML_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   862
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   863
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   864
sub do_remarks()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   865
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   866
	my ($iLog, $iLineNumber, $line)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   867
	# Store remarks by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   868
	if (!defined $CmdRemarks{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   869
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   870
		$CmdRemarks{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   871
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   872
	push @{$CmdRemarks{$command}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   873
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   874
	# Store remarks by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   875
	if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   876
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   877
		$remarks{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   878
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   879
	push @{$remarks{$component}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   880
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   881
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   882
sub do_warning()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   883
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   884
	my ($iLog, $iLineNumber, $line)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   885
	# Store warning by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   886
	if (!defined $CmdWarnings{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   887
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   888
		$CmdWarnings{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   889
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   890
	push @{$CmdWarnings{$command}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   891
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   892
	# Store warning by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   893
	if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   894
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   895
		$warnings{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   896
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   897
	push @{$warnings{$component}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   898
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   899
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   900
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   901
sub do_migrationNotes()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   902
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   903
  my ($iLog, $iLineNumber, $line)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   904
  # Store Migration Notes by command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   905
  if (!defined $CmdMigrationNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   906
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   907
    $CmdMigrationNotes{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   908
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   909
  push @{$CmdMigrationNotes{$command}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   910
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   911
  # Store Migration Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   912
  if (!defined $migrationNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   913
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   914
    $migrationNotes{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   915
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   916
  push @{$migrationNotes{$component}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   917
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   918
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   919
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   920
sub do_AdvisoryNotes()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   921
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   922
  my ($iLog, $iLineNumber, $line)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   923
  # Store Advisory Notes by command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   924
  if (!defined $CmdAdvisoryNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   925
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   926
    $CmdAdvisoryNotes{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   927
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   928
  push @{$CmdAdvisoryNotes{$command}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   929
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   930
  # Store Advisory Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   931
  if (!defined $AdvisoryNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   932
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   933
    $AdvisoryNotes{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   934
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   935
  push @{$AdvisoryNotes{$component}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   936
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   937
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   938
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   939
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   940
sub do_error()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   941
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   942
  my ($iLog, $iLineNumber, $line)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   943
	# Store Errors by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   944
	if (!defined $CmdErrors{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   945
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   946
		$CmdErrors{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   947
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   948
	push @{$CmdErrors{$command}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   949
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   950
	# Store Errors by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   951
	if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   952
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   953
		$errors{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   954
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   955
	push @{$errors{$component}}, "$iLog:$iLineNumber>$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   956
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   957
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   958
# Read a number of lines in the log ignoreing the content
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   959
sub do_slurp()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   960
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   961
  my ($num_lines) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   962
  for (my $i = 0; $i < $num_lines; $i++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   963
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   964
    ;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   965
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   966
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   967
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   968
sub char_handler
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   969
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   970
  my ($iExpat, $data) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   971
  my ($iStatus);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   972
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   973
  # Now Buffer it up for context data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   974
  $iExpat->{cdata_buffer} .= $data;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   975
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   976
  #Delay parsing until end of line is found or close xml tag or end of recipe
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   977
  return if ($inRecipe);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   978
  if (!($data =~ /\n$/))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   979
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   980
    #Put in the line buffer until the rest of the line comes in or an element end causes a parseline call
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   981
    $iExpat->{line_buffer} .= $data;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   982
    return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   983
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   984
    #line ends in a \n
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   985
    #Add the $data to buffer(normally empty) and parse
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   986
    &parseline($iExpat,$iExpat->{line_buffer}.$data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   987
    #Empty the line buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   988
    $iExpat->{line_buffer} =''; 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   989
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   990
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   991
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   992
sub parseline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   993
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   994
  my ($iExpat, $data,$iLineNumber) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   995
  if (!($iLineNumber =~ /\d+/))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   996
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   997
    #If no linenumber is passed the set to the current line in the parse
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   998
    $iLineNumber = $iExpat->current_line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   999
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1000
  my $CheckForComponentExitCodesToMigrate = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1001
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1002
  #Set some defaults if $component and $command are empty
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1003
  if ($component eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1004
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1005
    $component = "anonymous component";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1006
    $Components{$component} = '0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1007
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1008
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1009
  if ($command eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1010
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1011
    $command = "anonymous command";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1012
    $Commands{$command} ='0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1013
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1014
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1015
    # Lines to Ignore
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1016
    $iStatus =&sbsv2scanlog::CheckForIgnore($data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1017
    if($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1018
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1019
      return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1020
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1021
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1022
    # AdvisoryNotes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1023
    ($iStatus) =&sbsv2scanlog::CheckForAdvisoryNotes($data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1024
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1025
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1026
      if ($RetryInProgress)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1027
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1028
        #A retry is in progress so downgrade to a remark
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1029
        &do_remarks($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1030
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1031
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1032
      &do_AdvisoryNotes($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1033
      return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1034
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1035
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1036
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1037
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1038
    #CheckForComponentExitCodesToMigrate
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1039
    $CheckForComponentExitCodesToMigrate = &sbsv2scanlog::CheckForComponentExitCodesToMigrate($data,$component);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1040
    if ($CheckForComponentExitCodesToMigrate )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1041
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1042
      $MigrateNextExitCode = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1043
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1044
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1045
    # Migration Notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1046
    $iStatus = &sbsv2scanlog::CheckForMigrationNotes($data,$component);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1047
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1048
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1049
      if ($RetryInProgress)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1050
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1051
        #A retry is in progress so downgrade to a remark
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1052
        &do_remarks($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1053
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1054
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1055
        &do_migrationNotes($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1056
        #Setup global $warningmigrated flag so warning_ function can ignore the warning element that this migration note was in
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1057
        $warningmigrated = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1058
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1059
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1060
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1061
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1062
    # Remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1063
    ($iStatus) =&sbsv2scanlog::CheckForRemarks($data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1064
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1065
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1066
      &do_remarks($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1067
      return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1068
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1069
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1070
    # Errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1071
    ($iStatus) =&sbsv2scanlog::CheckForErrors($data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1072
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1073
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1074
      if ($RetryInProgress)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1075
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1076
        #A retry is in progress so downgrade to a remark
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1077
        &do_remarks($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1078
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1079
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1080
        &do_error($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1081
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1082
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1083
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1084
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1085
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1086
    # Warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1087
    ($iStatus) =&sbsv2scanlog::CheckForWarnings($data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1088
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1089
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1090
      if ($RetryInProgress)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1091
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1092
        #A retry is in progress so downgrade to a remark
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1093
        &do_remarks($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1094
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1095
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1096
        &do_warning($iLog, $iLineNumber, $data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1097
        return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1098
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1099
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1100
    return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1101
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1102
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1103
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1104
  package MySubs;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1105
  # recipe
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1106
  #
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1107
  # Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1108
  #
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1109
  # Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1110
  #
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1111
  # Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1112
  # This function handles the recipe tag in the XML
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1113
  sub recipe
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1114
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1115
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1116
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1117
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1118
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1119
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1120
    #Set global flag to change char data handling to the end of the recipe
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1121
    #So that errors/warnings/migration notes can be down grade to remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1122
    #if a retry is signalled
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1123
    $inRecipe = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1124
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1125
    my (%iAttr);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1126
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1127
    # Read the attributes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1128
    while (@_) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1129
      my $iAtt = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1130
      my $iVal = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1131
      $iAttr{$iAtt} = $iVal;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1132
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1133
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1134
    #print "recipe name =".$iAttr{'name'}."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1135
    if ($iAttr{'component'} ne '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1136
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1137
      $component = $iAttr{'component'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1138
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1139
      #Try using the bld.inf as unique component identifier
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1140
      $component = $iAttr{'bldinf'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1141
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1142
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1143
    $command = $iAttr{'name'}." ".$iAttr{'platform'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1144
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1145
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1146
  sub recipe_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1147
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1148
    my $iExpat = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1149
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1150
    #Handle all recipe text that was inside this element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1151
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1152
    #Split the multiline cdata_buffer in to single lines
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1153
    my @lines = split /\n/,$iExpat->{cdata_buffer};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1154
    for (my $buffnum = 0 ; $buffnum < scalar (@lines); $buffnum++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1155
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1156
      #Parse each line
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1157
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1158
      #Calculate the actual line number subtracking status and time element lines (2) and position in array from end
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1159
      my $linenum = ($iExpat->current_line) - 2 - (scalar (@lines) - $buffnum);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1160
      &main::parseline($iExpat, $lines[$buffnum],$linenum);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1161
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1162
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1163
    #Clear $inRecipe flag
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1164
    $inRecipe = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1165
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1166
    #Clear $RetryInProgress flag as a retry cannot out live a recipe
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1167
    $RetryInProgress = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1168
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1169
    #Clear all data set by recipe start
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1170
    $component = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1171
    $command = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1172
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1173
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1174
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1175
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1176
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1177
  sub time
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1178
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1179
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1180
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1181
    my (%iAttr);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1182
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1183
    # Read the attributes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1184
    while (@_) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1185
      my $iAtt = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1186
      my $iVal = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1187
      $iAttr{$iAtt} = $iVal;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1188
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1189
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1190
    #Elapsed time and Total up for Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1191
    $Commands{$command} += $iAttr{'elapsed'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1192
    #Elapsed time and Total up for Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1193
    $Components{$component} += $iAttr{'elapsed'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1194
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1195
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1196
  sub time_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1197
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1198
    #Do nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1199
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1200
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1201
  sub info
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1202
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1203
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1204
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1205
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1206
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1207
    $component = 'SBS: Info';    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1208
    $command = 'SBS: Info';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1209
    $Components{$component} = '0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1210
    $Commands{$command} ='0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1211
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1212
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1213
  sub info_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1214
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1215
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1216
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1217
    #Handle any unhandle text that was inside this element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1218
    if ($iExpat->{line_buffer} =~ /.+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1219
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1220
      &main::parseline($iExpat, $iExpat->{line_buffer});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1221
      $iExpat->{line_buffer} =''; 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1222
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1223
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1224
    #Clear all data set by info start
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1225
    $component = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1226
    $command = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1227
	if ($iExpat->{cdata_buffer} =~ /Run time (.*?) seconds/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1228
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1229
      ($currentfiletime) =$1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1230
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1231
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1232
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1233
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1234
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1235
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1236
  sub warning
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1237
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1238
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1239
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1240
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1241
    #reset $warningmigrated flag
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1242
    $warningmigrated = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1243
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1244
    $component = 'SBS: Warning';    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1245
    $command = 'SBS: Warning';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1246
    $Components{$component} = '0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1247
    $Commands{$command} ='0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1248
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1249
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1250
  sub warning_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1251
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1252
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1253
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1254
    #Handle any unhandle text that was inside this element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1255
    if ($iExpat->{line_buffer} =~ /.+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1256
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1257
      &main::parseline($iExpat, $iExpat->{line_buffer});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1258
      $iExpat->{line_buffer} =''; 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1259
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1260
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1261
    my ($iLineNumber) = $iExpat->current_line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1262
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1263
    if ($warningmigrated != 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1264
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1265
      #Record error in its own right for the error xml element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1266
      &main::do_warning($iLog, $iLineNumber, $iExpat->{cdata_buffer});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1267
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1268
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1269
    #Clear all data set by info start
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1270
    $component = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1271
    $command = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1272
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1273
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1274
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1275
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1276
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1277
  sub error
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1278
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1279
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1280
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1281
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1282
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1283
    #Set generic component and command names so that these don't get allocated to a empty component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1284
    $component = 'SBS: Error';    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1285
    $command = 'SBS: Error';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1286
    $Components{$component} = '0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1287
    $Commands{$command} ='0';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1288
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1289
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1290
  sub error_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1291
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1292
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1293
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1294
    #Handle any unhandle text that was inside this element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1295
    if ($iExpat->{line_buffer} =~ /.+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1296
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1297
      &main::parseline($iExpat, $iExpat->{line_buffer});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1298
      $iExpat->{line_buffer} =''; 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1299
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1300
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1301
    my ($iLineNumber) = $iExpat->current_line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1302
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1303
    #Record error in its own right for the error xml element
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1304
    &main::do_error($iLog, $iLineNumber, $iExpat->{cdata_buffer});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1305
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1306
    #Clear all data set by info start
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1307
    $component = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1308
    $command = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1309
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1310
    #empty cdata buffer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1311
    $iExpat->{cdata_buffer} = '';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1312
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1313
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1314
  sub status
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1315
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1316
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1317
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1318
    my (%iAttr);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1319
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1320
    # Read the attributes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1321
    while (@_) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1322
      my $iAtt = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1323
      my $iVal = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1324
      $iAttr{$iAtt} = $iVal;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1325
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1326
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1327
    my ($iLineNumber) = $iExpat->current_line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1328
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1329
    if ($iAttr{'exit'} eq 'retry')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1330
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1331
      $RetryInProgress = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1332
      #Record retry as a remark
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1333
      &main::do_remarks($iLog, $iLineNumber, "$component retried on $command with ".$iAttr{'code'});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1334
      return;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1335
    } elsif ($iAttr{'exit'} ne 'ok') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1336
      #Record as migration note for non ok exit because a previous line has triggered this flag
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1337
      if ($MigrateNextExitCode)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1338
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1339
        &main::do_migrationNotes($iLog, $iLineNumber, "$component failed on $command with ".$iAttr{'code'});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1340
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1341
        #Record error in its own right for the non 'ok' exit status
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1342
        &main::do_error($iLog, $iLineNumber, "$component failed on $command with ".$iAttr{'code'});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1343
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1344
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1345
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1346
    #Resest the Migrate exit code flag because a previous line has triggered this flag
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1347
    $MigrateNextExitCode =0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1348
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1349
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1350
  sub status_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1351
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1352
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1353
    # Nothing to do
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1354
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1355
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1356
  sub debug
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1357
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1358
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1359
    # Nothing to do
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1360
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1361
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1362
    sub debug_
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1363
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1364
    my $iExpat = shift; my $iElement = shift;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1365
    # Nothing to do
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1366
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1367
}