deprecated/buildtools/buildsystemtools/scanlog/htmlscanlog.pl
author kelvzhu
Tue, 23 Nov 2010 10:47:23 +0800
changeset 702 341ab25bc4ef
parent 655 3f65fd25dfd4
permissions -rw-r--r--
merge from SF
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 FindBin;		# for FindBin::Bin
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
# Add the directory contain this perl script into the path to find modules
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
use lib $FindBin::Bin;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
use Scanlog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
# For Date calculations
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
use lib "$FindBin::Bin/../lib"; # For running in source
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
use lib "$FindBin::Bin/build/lib"; # For running in epoc32\tools
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
use Date::Manip;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
# Set TimeZone because Date:Manip needs it set and then tell it to IGNORE the TimeZone
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
&Date_Init("TZ=GMT","ConvTZ=IGNORE");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
# Variables
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
my $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
my $iSlurp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
my $PhaseStartTime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
my %Phases;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
my %Components;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
my %Commands;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
my $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
my $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
my $phase;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
my $match_phase='';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
my %errors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
my %warnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
my %remarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
my %migrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
my %AdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
my %CmdErrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
my %CmdWarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
my %CmdRemarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
my %CmdMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
my %CmdAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
my %missing;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
my %not_built;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
my $starttime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
my $duration;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
my $warningcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
my $errorcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
my $remarkcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
my $migrationNoteCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
my $AdvisoryNoteCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
my ($iStatus, $iName);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
my %htmlColours=(
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
"errors" =>"#ff0000",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
"warnings" =>"#fff000",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
"remarks" =>"#ffccff",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
"migrationNotes" =>"#ffcc99",
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
"AdvisoryNotes" => "#ffa500"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
# Hires Timer Variables
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
my %HiResComponents;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
my %HiResCommands;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
my $HiResStartTime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
my $HiResErrorFlag; #True if one of the Clients has not reported HiRes timing info
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
my $Dsec;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
# History Variables
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
my ($hostname) = "N/A";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
my ($EndTime);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
# Main section
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
my ($iOutput, $iTitle, $iVerbose, $iDiff, $iWhat, $iHistory, $iClass, @iLogs) =&ProcessCommandLine();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
# Open Output file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
  open (HTML, ">$iOutput") or die "Couldn't open $iOutput for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
# Open Diff file if specified
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
if ($iDiff ne '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
  open (DIFF, ">$iDiff") or die "Couldn't open $iDiff for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
# Print HTML Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
&PrintHTMLHeader($iTitle);
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
# Parse each log File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
foreach my $iLog (@iLogs) # parses through all logs 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
  # Open the Log file for reading
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
  unless (open (LOG, "< $iLog"))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
    {   # On error, warn rather than die. Then record a "pseudo-error", which will appear in summary output file.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
        $line = "Couldn't open $iLog for reading: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
        warn "$line\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
        $command = 'HTMLScanLog';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
        $component = 'Log Summaries';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
        $Commands{$command} = 0;            # Need to define these! So assume zero seconds 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
        $HiResCommands{$command} = 0;       # duration for each of four variables.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
        $Components{$component} = 0;        # The fact the relevant time(s) are defined
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
        $HiResComponents{$component} = 0;   # triggers inclusion in the applicable table. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
        do_error($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
  # Chop $iLog just to the filename
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
  $iLog =~ s/^.*\\//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
  # Process the logs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
  &ProcessLog($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
  close LOG;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
&PrintResults($iTitle);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
# Print HTML Footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
&PrintHTMLFooter();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
# Handle the History file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
if (defined $iHistory)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
  # Work out the class
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
  my ($mclass) = "N/A";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
  open (MC, "< $iClass");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
  while (<MC>)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
    chomp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
    my (@columns) = split(/,/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
    $mclass = $columns[0] if ($columns[1] eq $hostname);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
  close (MC);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
  # Open and Lock the csv file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
  open(FH, "+< $iHistory")                or die "can't open $iHistory: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
  flock(FH, 2)                        or die "can't flock iHistory: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
  # Read the file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
  # Reader the headers
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
  my $cline = <FH>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
  chomp($cline);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
  my (@headers) = split(/,/,$cline);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
  # Read the data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
  my (@csvdata);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
  @csvdata = <FH>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   157
  # Return to the begining
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   158
  seek(FH,0,0)                        or die "Seeking: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   159
  # Print the old and new data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
  # Work if new headers are needed
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
  # Use LowRes component names because they are always available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
  foreach my $component (sort {lc $a cmp lc $b} keys %Components)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
    my $compexist = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
    # Itterate through the header array to see if it already exists
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
    foreach my $header (@headers)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
      if ($component eq $header)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
        $compexist = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
    # This component not found in the headers
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
    # put the new header at the end of the header array
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
    push @headers, $component if ($compexist == 0);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
  # Print the headers back out
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
  print FH join(',',@headers)."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
  # Print the original data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
  print FH @csvdata;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
  # Print the new data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
  foreach my $header (@headers)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
    if ($header eq 'Machine Class')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
      print FH "$mclass";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
    } elsif ($header eq 'Machine Name') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
      print FH "$hostname";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
    } elsif ($header eq 'Title') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
      print FH "$iTitle";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
    } elsif ($header eq 'End Time') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
      print FH "$EndTime";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
    } elsif ($header eq 'Total Time') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
      print FH &ConvertSeconds($duration);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
      # If there is a complete set of HiRes data then use that instead of the LowRes data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
      if ((defined %HiResComponents) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
        if (exists $HiResComponents{$header})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
          print FH &ConvertSeconds($HiResComponents{$header});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
        } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
          print FH "";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
        if (exists $Components{$header})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
          print FH &ConvertSeconds($Components{$header});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
        } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
          print FH "";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
    # Print the , for next entry
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
    print FH ",";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
  # End the entry
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
  print FH "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
  # truncate just in case the file is shorter
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
  truncate(FH,tell(FH))               or die "Truncating: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
  close(FH)                           or die "Closing: $!";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
# DiffLog
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
# This function Outputs lines to the diff log
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
sub DiffLog()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
    # Write the line to diff file if specified and not a line with Build Time dependent infomation
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
    if ($iDiff ne '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
       # Check the line for Build Time dependent infomation
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
       unless (($line =~ /^=== .+ started/) || ($line =~ /^=== .+ finished/) || ($line =~ /^---/) || ($line =~ /^\+\+/))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
       {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
          print DIFF $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
       }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
# ProcessLog
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
# $iLog - Logfile name
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
sub ProcessLog()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
  my ($iLog) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
  print "Processing: $iLog\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
  while ($line=<LOG>)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
    &DiffLog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
    # Hostname is
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
    # capture the hostname if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
    if ($line =~ /^Hostname is (.*)$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
      $hostname = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
    # ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
    # === Stage=1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
    # ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
    # === Stage=1 started Wed Apr 30 23:09:38 2003
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
    if ($line =~ /^===------/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
      $line=<LOG>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
          &DiffLog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
      $line=<LOG>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
          &DiffLog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
      $line = <LOG>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
          &DiffLog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
      $line =~ /^=== (.+) started (.*)/;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
      $phase = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
      $PhaseStartTime =$2;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
      $match_phase=$phase;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
      $match_phase=~s-\\-\\\\-go;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
    # === bldfiles finished Sat Jul 24 01:38:56 1999.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
    if ($line =~ /^=== $match_phase finished (.*)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
      my ($TempTime) = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
      # Calculate the difference in Date/Time and Total up for Phase
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
      $Phases{$phase} += &DiffDateTime($PhaseStartTime, $TempTime) ;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
      # The check to see if phase end is later than current EndTime
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
      my $err;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
      # The first time a phase end is seen set $EndTime
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
      if (!defined $EndTime)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
        $EndTime = $TempTime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
        # Check the delta to previous EndTime value is positive
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
        # Need due to multiple log file processing might not be in time order
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
        my ($delta) = &DateCalc($EndTime,$TempTime,\$err);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
        die "Date Manip error" if ($err);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
        # If the delta starts with a + symbol $TempTime is later or the same as the last EndTime so set the new EndTime.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
        if ($delta =~ /^\+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
          $EndTime = $TempTime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   318
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   319
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   320
    # === resource == gdtran 036
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
    if ($line =~ /=== $match_phase == (.*)$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
      $component = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
    # Find Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
    # -- bldmake bldfiles -keepgoing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
    if ($line =~ /^-- (.*)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
      $command = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
      next;
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
    # Find the Command's Start time
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
    # ++ Started at Sat May 03 21:09:07 2003
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
    if ($line =~ /^\+\+ Started at (.*)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
      $starttime = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   342
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   343
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   344
    # Find the Command's End time
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
    # ++ Started at Sat May 03 21:09:07 2003
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
    if ($line =~ /^\+\+ Finished at (.*)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
      # Calculate the difference in Date/Time and Total up for Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
      $Dsec = &DiffDateTime($starttime, $1);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
      $Commands{$command} += $Dsec;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
      # Calculate the difference in Date/Time and Total up for Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
      $Components{$component} += $Dsec;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
    # Act on a HiRes Timer unavailable statement in the log
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
    # +++ HiRes Time Unavailable
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
    if (($line =~ /^\+\+\+ HiRes Time Unavailable/) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
      $HiResErrorFlag = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
          print "Warning one of the clients is not sending HiRes timer Data\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
          print "No HiRes timings will be available\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
          print "Reverting to LowRes timing Data\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
      # Clear out Current HiRes Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365
      undef %HiResCommands;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   366
      undef %HiResComponents;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   367
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   368
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   369
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   370
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   371
    # Find the Command's HiRes Start time
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   372
    # +++ HiRes Start 1051993130.602050
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   373
    if (($line =~ /^\+\+\+ HiRes Start (\S+)/) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   374
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   375
      $HiResStartTime = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   376
      next;
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
    # Find the Command's HiRes End time
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   380
    # +++ HiRes End 1051993193.829650
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   381
    if (($line =~ /^\+\+\+ HiRes End (\S+)/) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   382
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   383
      # Calculate the difference in Date/Time and Total up for Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   384
      $HiResCommands{$command} += ($1 - $HiResStartTime);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   385
      # Calculate the difference in Date/Time and Total up for Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   386
      $HiResComponents{$component} += ($1 - $HiResStartTime);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   387
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   388
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   389
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   390
    # Lines to Ignore
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   391
    ($iStatus) =&Scanlog::CheckForIgnore($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   392
    if($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   393
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   394
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   395
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   396
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   397
    # Advisory Notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   398
    ($iStatus) =&Scanlog::CheckForAdvisoryNotes($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   399
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   400
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   401
       do_AdvisoryNotes($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   402
       do_slurp($iSlurp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   403
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   404
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   405
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   406
    # Migration Notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   407
    ($iStatus) = &Scanlog::CheckForMigrationNotes($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   408
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   409
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   410
      do_migrationNotes($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   411
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   412
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   413
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   414
    # Remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   415
    ($iStatus, $iSlurp) =&Scanlog::CheckForRemarks($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   416
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   417
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   418
      do_remarks($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   419
      do_slurp($iSlurp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   420
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   421
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   422
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   423
    # Errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   424
    ($iStatus) =&Scanlog::CheckForErrors($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   425
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   426
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   427
      do_error($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   428
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   429
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   430
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   431
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   432
    # Warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   433
    ($iStatus) =&Scanlog::CheckForWarnings($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   434
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   435
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   436
      do_warning($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   437
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   438
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   439
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   440
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   441
    # Things Not Built
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   442
    ($iStatus, $iName) =&Scanlog::CheckForNotBuilt($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   443
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   444
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   445
      do_error($iLog); # record these along with the errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   446
      $not_built{$iName} = "$component";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   447
      next;
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
    # Things missing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   451
    ($iStatus, $iName) =&Scanlog::CheckForMissing($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   452
    if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   453
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   454
      do_error($iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   455
      $missing{$iName} += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   456
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   457
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   458
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   459
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   460
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   461
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   462
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   463
# PrintResults
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   464
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   465
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   466
# $iTitle (Title for Log file)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   467
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   468
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   469
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   470
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   471
# This function prints all the data as HTML
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   472
sub PrintResults
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   473
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   474
  my ($iTitle) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   475
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   476
  my $title;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   477
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   478
  # Print Heading of Log File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   479
  my $heading ="Overall";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   480
  print HTML qq{<h1>$iTitle</h1>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   481
  print HTML qq{<h2>$heading</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   482
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   483
  # Calculate the total number of remarks messages
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   484
	$remarkcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   485
	foreach $component (sort {lc $a cmp lc $b} keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   486
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   487
		$remarkcount += scalar(@{$remarks{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   488
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   489
  # Calculate the Total number of errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   490
  	$errorcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   491
	foreach $component (sort {lc $a cmp lc $b} keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   492
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   493
		$errorcount += scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   494
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   495
  # Calculate the total number of warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   496
	$warningcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   497
	foreach $component (sort {lc $a cmp lc $b} keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   498
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   499
		$warningcount += scalar(@{$warnings{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   500
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   501
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   502
  # Calculate the total number of migration notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   503
        $migrationNoteCount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   504
        foreach $component (sort {lc $a cmp lc $b} keys %migrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   505
                {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   506
                $migrationNoteCount += scalar(@{$migrationNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   507
                }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   508
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   509
  # Calculate the total number of Advisory notes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   510
        $AdvisoryNoteCount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   511
        foreach $component (sort {lc $a cmp lc $b} keys %AdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   512
                {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   513
                $AdvisoryNoteCount += scalar(@{$AdvisoryNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   514
                }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   515
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   516
  # Calculate the Total Duration from Phase Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   517
	$duration = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   518
	foreach $phase (sort {lc $a cmp lc $b} keys %Phases)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   519
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   520
		  $duration += $Phases{$phase};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   521
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   522
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   523
  &StartHTMLTable();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   524
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   525
  # Print the Totals
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   526
  &HTMLTableRow($heading,"Total", $duration, $errorcount, $warningcount, $AdvisoryNoteCount, $remarkcount, $migrationNoteCount);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   527
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   528
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   529
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   530
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   531
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   532
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   533
  # By Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   534
  print HTML qq{<h2>By Component</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   535
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   536
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   537
  $title="Component";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   538
  &StartHTMLTable($title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   539
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   540
  # Print the by Component Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   541
  # If there is a complete set of HiRes data then use that instead of the LowRes data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   542
  if ((defined %HiResComponents) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   543
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   544
    foreach $component (sort {lc $a cmp lc $b} keys %HiResComponents)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   545
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   546
      # Calculate the number errors,warnings,advisory notes and remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   547
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   548
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   549
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   550
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   551
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   552
      if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   553
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   554
        # No Remarks were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   555
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   556
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   557
        $totalremarks = scalar(@{$remarks{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   558
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   559
      if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   560
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   561
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   562
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   563
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   564
        $totalerrors = scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   565
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   566
      if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   567
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   568
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   569
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   570
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   571
        $totalwarnings = scalar(@{$warnings{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   572
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   573
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   574
      if (!defined $migrationNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   575
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   576
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   577
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   578
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   579
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   580
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   581
        $totalMigrationNotes = scalar(@{$migrationNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   582
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   583
      if (!defined $AdvisoryNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   584
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   585
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   586
        $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   587
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   588
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   589
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   590
        $totalAdvisoryNotes = scalar(@{$AdvisoryNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   591
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   592
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   593
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   594
      # Print the Table Row      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   595
      &HTMLTableRow($title,$component, $HiResComponents{$component}, $totalerrors, $totalwarnings, $totalAdvisoryNotes, $totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   596
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   597
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   598
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   599
    foreach $component (sort {lc $a cmp lc $b} keys %Components)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   600
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   601
      # Calculate the number errors,warnings,advisory notes and remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   602
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   603
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   604
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   605
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   606
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   607
      if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   608
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   609
        # No Remarks was recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   610
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   611
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   612
        $totalremarks = scalar(@{$remarks{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   613
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   614
      if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   615
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   616
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   617
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   618
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   619
        $totalerrors = scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   620
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   621
      if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   622
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   623
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   624
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   625
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   626
        $totalwarnings = scalar(@{$warnings{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   627
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   628
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   629
      if (!defined $migrationNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   630
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   631
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   632
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   633
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   634
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   635
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   636
        $totalMigrationNotes = scalar(@{$migrationNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   637
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   638
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   639
      if (!defined $AdvisoryNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   640
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   641
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   642
          $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   643
          }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   644
       else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   645
          {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   646
         $totalAdvisoryNotes = scalar(@{$AdvisoryNotes{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   647
          }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   648
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   649
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   650
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   651
      # Print the Table Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   652
	  &HTMLTableRow($title,$component, $Components{$component}, $totalerrors, $totalwarnings, $totalAdvisoryNotes, $totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   653
	}
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
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   657
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   658
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   659
  # By Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   660
  print HTML qq{<h2>By Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   661
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   662
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   663
  $title="Command";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   664
  &StartHTMLTable($title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   665
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   666
  # Print the by Command Data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   667
  # If there is a complete set of HiRes data then use that instead of the LowRes data
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   668
  if ((defined %HiResCommands) && !$HiResErrorFlag)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   669
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   670
    foreach $command (sort {lc $a cmp lc $b} keys %HiResCommands)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   671
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   672
      # Calculate the number errors, warnings, advisory notes and remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   673
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   674
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   675
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   676
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   677
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   678
      if (!defined $CmdRemarks{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   679
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   680
        # No Remarks were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   681
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   682
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   683
        $totalremarks = scalar(@{$CmdRemarks{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   684
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   685
      if (!defined $CmdErrors{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   686
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   687
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   688
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   689
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   690
        $totalerrors = scalar(@{$CmdErrors{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   691
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   692
      if (!defined $CmdWarnings{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   693
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   694
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   695
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   696
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   697
        $totalwarnings = scalar(@{$CmdWarnings{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   698
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   699
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   700
      if (!defined $CmdMigrationNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   701
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   702
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   703
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   704
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   705
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   706
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   707
        $totalMigrationNotes = scalar(@{$CmdMigrationNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   708
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   709
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   710
      if (!defined $CmdAdvisoryNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   711
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   712
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   713
        $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   714
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   715
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   716
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   717
        $totalAdvisoryNotes = scalar(@{$CmdAdvisoryNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   718
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   719
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   720
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   721
      # Print the Table Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   722
	  &HTMLTableRow($title,$command, $HiResCommands{$command}, $totalerrors, $totalwarnings, $totalAdvisoryNotes, $totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   723
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   724
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   725
    foreach $command (sort {lc $a cmp lc $b} keys %Commands)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   726
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   727
      # Calculate the number errors,warnings,advisory notes and remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   728
      my $totalerrors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   729
      my $totalwarnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   730
      my $totalremarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   731
      my $totalMigrationNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   732
      my $totalAdvisoryNotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   733
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   734
      if (!defined $CmdRemarks{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   735
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   736
        # No Remarks were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   737
        $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   738
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   739
        $totalremarks = scalar(@{$CmdRemarks{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   740
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   741
      if (!defined $CmdErrors{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   742
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   743
        # No errors were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   744
        $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   745
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   746
        $totalerrors = scalar(@{$CmdErrors{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   747
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   748
      if (!defined $CmdWarnings{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   749
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   750
        # No Warnings were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   751
        $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   752
      } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   753
        $totalwarnings = scalar(@{$CmdWarnings{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   754
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   755
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   756
      if (!defined $CmdMigrationNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   757
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   758
        # No MigrationNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   759
        $totalMigrationNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   760
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   761
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   762
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   763
        $totalMigrationNotes = scalar(@{$CmdMigrationNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   764
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   765
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   766
      if (!defined $CmdAdvisoryNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   767
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   768
        # No AdvisoryNotes were recorded, set total to zero
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   769
        $totalAdvisoryNotes=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   770
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   771
      else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   772
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   773
        $totalAdvisoryNotes = scalar(@{$CmdAdvisoryNotes{$command}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   774
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   775
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   776
      # Print the Table Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   777
      &HTMLTableRow($title,$command, $Commands{$command}, $totalerrors, $totalwarnings, $totalAdvisoryNotes, $totalremarks, $totalMigrationNotes);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   778
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   779
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   780
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   781
  # End the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   782
  print HTML qq{</table>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   783
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   784
  # Print Things Missing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   785
  if (scalar %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   786
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   787
	my $count = scalar keys %missing;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   788
	print HTML qq{<h2>Things Missing ($count)</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   789
	print HTML "Don't know how to make...\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   790
	foreach my $file (sort {lc $a cmp lc $b} keys %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   791
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   792
		printf HTML "%d\t%s</BR>\n", $missing{$file}, $file;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   793
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   794
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   795
  print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   796
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   797
  # Print Things Not Built
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   798
  if (scalar %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   799
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   800
	my $count = scalar keys %not_built;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   801
	print HTML qq{<h2>Things Not Built ($count)</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   802
	foreach my $file (sort {lc $a cmp lc $b} keys %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   803
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   804
		print HTML "MISSING: $file ($not_built{$file})</BR>\n";
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
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   808
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   809
  # Print the Actual Errors by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   810
  if ($iVerbose > 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   811
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   812
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   813
    if (scalar(keys %errors))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   814
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   815
      print HTML qq{<h2><a name="errorsByOverall_Total">Error Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   816
	  foreach $component (sort {lc $a cmp lc $b} keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   817
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   818
			my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   819
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   820
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   821
			my $count = scalar @{$errors{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   822
			print HTML qq{<h3><a name="errorsByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   823
			foreach $line (@{$errors{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   824
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   825
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   826
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   827
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   828
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   829
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   830
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   831
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   832
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   833
  # Print the Actual Warning by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   834
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   835
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   836
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   837
    if (scalar(keys %warnings))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   838
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   839
      print HTML qq{<h2><a name="warningsByOverall_Total">Warning Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   840
      foreach $component (sort {lc $a cmp lc $b} keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   841
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   842
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   843
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   844
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   845
		  my $count = scalar @{$warnings{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   846
          print HTML qq{<h3><a name="warningsByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   847
          foreach $line (@{$warnings{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   848
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   849
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   850
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   851
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   852
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   853
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   854
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   855
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   856
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   857
  # Print the Actual Advisory Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   858
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   859
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   860
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   861
    if (scalar(keys %AdvisoryNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   862
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   863
      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
   864
      foreach $component (sort {lc $a cmp lc $b} keys %AdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   865
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   866
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   867
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   868
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   869
		     my $count = scalar @{$AdvisoryNotes{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   870
          print HTML qq{<h3><a name="AdvisoryNotesByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   871
          foreach $line (@{$AdvisoryNotes{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   872
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   873
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   874
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   875
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   876
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   877
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   878
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   879
  }  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   880
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   881
  # Print the Actual Remarks by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   882
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   883
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   884
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   885
    if (scalar(keys %remarks))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   886
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   887
      print HTML qq{<h2><a name="remarksByOverall_Total">Remarks Details by Component</a></h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   888
	  foreach $component (sort {lc $a cmp lc $b} keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   889
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   890
			my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   891
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   892
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   893
			my $count = scalar @{$remarks{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   894
			print HTML qq{<h3><a name="remarksByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   895
			foreach $line (@{$remarks{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   896
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   897
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   898
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   899
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   900
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   901
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   902
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   903
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   904
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   905
   # Print the Actual Migration Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   906
if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   907
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   908
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   909
    if (scalar(keys %migrationNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   910
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   911
      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
   912
      foreach $component (sort {lc $a cmp lc $b} keys %migrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   913
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   914
          my ($HTML) = $component;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   915
          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   916
          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   917
		     my $count = scalar @{$migrationNotes{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   918
          print HTML qq{<h3><a name="migrationNotesByComponent_$HTML">$HTML</a> ($count)</h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   919
          foreach $line (@{$migrationNotes{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   920
            {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   921
            encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   922
            print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   923
            }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   924
          print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   925
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   926
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   927
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   928
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   929
  # Print the Actual Errors by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   930
  if ($iVerbose > 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   931
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   932
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   933
    if (scalar(keys %CmdErrors))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   934
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   935
      print HTML qq{<h2>Error Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   936
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdErrors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   937
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   938
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   939
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   940
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   941
			print HTML qq{<h3><a name="errorsByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   942
			foreach $line (@{$CmdErrors{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   943
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   944
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   945
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   946
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   947
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   948
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   949
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   950
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   951
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   952
  # Print the Actual Warning by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   953
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   954
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   955
    # Only Print the header if there are some warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   956
    if (scalar(keys %CmdWarnings))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   957
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   958
      print HTML qq{<h2>Warning Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   959
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdWarnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   960
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   961
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   962
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   963
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   964
			print HTML qq{<h3><a name="warningsByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   965
			foreach $line (@{$CmdWarnings{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   966
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   967
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   968
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   969
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   970
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   971
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   972
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   973
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   974
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   975
  # Print the Actual Advisory Notes by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   976
  if ($iVerbose >1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   977
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   978
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   979
    if (scalar(keys %CmdAdvisoryNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   980
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   981
        print HTML qq{<h2>Advisory Note Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   982
            foreach $command (sort {lc $a cmp lc $b} keys %CmdAdvisoryNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   983
                  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   984
     	                  my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   985
                          $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   986
                          encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   987
                          print HTML qq{<h3><a name="AdvisoryNotesByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   988
                          foreach $line (@{$CmdAdvisoryNotes{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   989
				  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   990
				  encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   991
		                  print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   992
	                          }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   993
                          print HTML qq{</BR>\n}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   994
                  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   995
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   996
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   997
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   998
  # Print the Actual Remarks by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   999
  if ($iVerbose > 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1000
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1001
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1002
    if (scalar(keys %CmdRemarks))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1003
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1004
      print HTML qq{<h2>Remarks Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1005
	  foreach $command (sort {lc $a cmp lc $b} keys %CmdRemarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1006
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1007
			my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1008
			$HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1009
			encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1010
			print HTML qq{<h3><a name="remarksByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1011
			foreach $line (@{$CmdRemarks{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1012
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1013
				encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1014
				print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1015
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1016
			print HTML qq{</BR>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1017
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1018
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1019
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1020
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1021
  # Print the Actual Migration Notes by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1022
  if ($iVerbose >1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1023
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1024
    # Only Print the header if there are some errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1025
    if (scalar(keys %CmdMigrationNotes))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1026
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1027
      print HTML qq{<h2>Migration Note Details by Command</h2>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1028
      
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1029
      foreach $command (sort {lc $a cmp lc $b} keys %CmdMigrationNotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1030
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1031
     	  my ($HTML) = $command;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1032
        $HTML =~ s/\s+$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1033
        encode_entities($HTML);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1034
        print HTML qq{<h3><a name="migrationNotesByCommand_$HTML">$HTML</a></h3>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1035
        foreach $line (@{$CmdMigrationNotes{$command}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1036
				  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1037
				  encode_entities($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1038
				  print HTML $line.qq{</BR>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1039
				  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1040
        print HTML qq{</BR>\n}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1041
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1042
      }
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
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1046
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1047
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1048
# StartHTMLTable
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1049
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1050
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1051
# $iC1Title (Column 1 Title)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1052
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1053
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1054
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1055
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1056
# This function prints the start of the HTML Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1057
sub StartHTMLTable
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1058
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1059
  my ($iC1Title) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1060
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1061
  if ($iC1Title eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1062
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1063
    $iC1Title = "&nbsp;";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1064
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1065
    encode_entities($iC1Title);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1066
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1067
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1068
  # Start the Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1069
  print HTML qq{<table border="1" cellpadding="0" cellspacing="0" width="100%">\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1070
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1071
  # Print the Header Row
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1072
  print HTML qq{\t<th width="50%">$iC1Title</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1073
  print HTML qq{\t<th width="15%">Time</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1074
  print HTML qq{\t<th width="8%">Errors</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1075
  print HTML qq{\t<th width="8%">Warnings</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1076
  print HTML qq{\t<th width="8%">Advisory Notes</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1077
  print HTML qq{\t<th width="8%">Remarks</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1078
  print HTML qq{\t<th width="8%">Migration Notes</th>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1079
  print HTML qq{</tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1080
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1081
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1082
# HTMLTableCell
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1083
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1084
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1085
# $iType	(errors,warnings,remarks,migration_notes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1086
# $iCount	(number of errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1087
# $iLink	(empty string or linktype)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1088
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1089
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1090
# Returns HTML table data element with appropriate link & background color
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1091
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1092
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1093
# Constructs HTML table element - used by HTMLTableRow to handle the formatting
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1094
# of the data cells, complete with colouring and links where appropriate.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1095
sub HTMLTableCell
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1096
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1097
   my ($iType,$iCount,$iLink)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1098
   my $td = qq{td width="8%" align="center"};	# implied by the TH elements already?
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1099
   if ($iCount != 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1100
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1101
	  $td = "$td BGCOLOR=$htmlColours{$iType}";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1102
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1103
   if ($iLink eq "" || $iCount == 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1104
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1105
      return qq{<$td>$iCount</td>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1106
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1107
   $iLink = $iType."By".$iLink;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1108
   return qq{<$td><a href="#$iLink">$iCount</a></td>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1109
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1110
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1111
# HTMLTableRow
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1112
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1113
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1114
# $iTitle (Need to differentiate between command and component to provide correct anchors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1115
# $iC1Data(Column 1 Data)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1116
# $iC2Data(Column 2 Data) (Time in seconds)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1117
# $iC3Data(Column 3 Data) (Number of errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1118
# $iC4Data(Column 4 Data) (Number of warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1119
# $iC5Data(Column 5 Data) (Number of Advisory notes )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1120
# $iC6Data(Column 6 Data) (Number of remarks )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1121
# $iC7Data(Column 7 Data) (Number of migration notes )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1122
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1123
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1124
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1125
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1126
# This function prints a line of the HTML Table
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1127
sub HTMLTableRow
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1128
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1129
  my ($iTitle,$iC1Data, $iC2Data, $iC3Data, $iC4Data,$iC5Data, $iC6Data, $iC7Data) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1130
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1131
  #print "$iC2Data\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1132
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1133
  # Convert the seconds in hh:mm:ss format
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1134
  $iC2Data = &ConvertSeconds($iC2Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1135
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1136
  # HTML encode the text
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1137
  encode_entities($iC1Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1138
  encode_entities($iC2Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1139
  encode_entities($iC3Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1140
  encode_entities($iC4Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1141
  encode_entities($iC5Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1142
  encode_entities($iC6Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1143
  encode_entities($iC7Data);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1144
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1145
  my $linkname = "$iTitle"."_"."$iC1Data";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1146
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1147
  # Print the Row, including summary in a script comment
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1148
  print HTML qq{<tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1149
  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
  1150
  print HTML qq{\t<td width="50%">$iC1Data</td>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1151
  print HTML qq{\t<td width="15%" align="center">$iC2Data</td>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1152
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1153
  print HTML "\t",&HTMLTableCell("errors",  $iC3Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1154
  print HTML "\t",&HTMLTableCell("warnings",$iC4Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1155
  print HTML "\t",&HTMLTableCell("AdvisoryNotes", $iC5Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1156
  print HTML "\t",&HTMLTableCell("remarks", $iC6Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1157
  print HTML "\t",&HTMLTableCell("migrationNotes", $iC7Data,$linkname),"\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1158
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1159
  print HTML qq{</tr>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1160
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1161
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1162
# ConvertSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1163
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1164
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1165
# $iSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1166
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1167
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1168
# $iString (seconds in hh:mm:ss)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1169
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1170
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1171
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1172
sub ConvertSeconds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1173
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1174
  my ($iSeconds) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1175
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1176
  my ($iString);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1177
  my ($ih) = int($iSeconds/3600);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1178
  my ($im) = int(($iSeconds-($ih*3600))/60);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1179
  my ($is) = $iSeconds-($ih*3600)-($im*60);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1180
  # 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
  1181
  if ($is =~ /\d+\.\d+/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1182
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1183
    $iString = sprintf "%d:%02d:%06.3f", $ih, $im, $is;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1184
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1185
    $iString = sprintf "%d:%02d:%02d", $ih, $im, $is;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1186
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1187
  return $iString;
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
# ProcessCommandLine
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1191
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1192
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1193
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1194
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1195
# $iOutput (Output filename)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1196
# $iVerbose (Verbose Level)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1197
# $iLogs (Log files to process)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1198
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1199
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1200
# This function processes the commandline
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1201
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1202
sub ProcessCommandLine {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1203
  my ($iHelp, @iLogs, $iOutput, $iTitle, $iVerbose, $iDiff, $iHistory, $iClass, $iHistoryHelp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1204
  GetOptions('h' => \$iHelp, 'l=s' =>\@iLogs, 'o=s' => \$iOutput, 't=s' => \$iTitle, 'v+' => \$iVerbose, 'd=s' =>\$iDiff, 'c=s' =>\$iHistory, 'm=s' =>\$iClass, 'hh' => \$iHistoryHelp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1205
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1206
  if ($iHistoryHelp)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1207
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1208
    &HistoryHelp();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1209
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1210
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1211
  if (($iHelp) || (!defined @iLogs) || (!defined $iOutput))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1212
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1213
    Usage();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1214
  } elsif (-e $iOutput) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1215
    die "$iOutput already exists";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1216
  } elsif (-e $iDiff) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1217
    die "$iDiff already exists";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1218
  } elsif (-e $iWhat) {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1219
    die "$iWhat already exists";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1220
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1221
  foreach my $iLog (@iLogs)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1222
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1223
    warn "$iLog does not exist" if (! -e $iLog);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1224
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1225
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1226
  # Check the history options
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1227
  if (defined $iHistory)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1228
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1229
    if (! -e $iHistory)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1230
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1231
	    warn "$iHistory does not exist";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1232
	    undef $iHistory;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1233
    } 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1234
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1235
   	elsif (!defined $iClass)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1236
   	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1237
	    warn "No machine name to class csv file specified with -m option";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1238
	    undef $iHistory;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1239
   	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1240
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1241
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1242
  # Set default title
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1243
  if ($iTitle eq '')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1244
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1245
    $iTitle = "Log File Summary";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1246
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1247
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1248
  return($iOutput, $iTitle, $iVerbose, $iDiff, $iWhat, $iHistory, $iClass, @iLogs);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1249
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1250
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1251
# Usage
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1252
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1253
# Output Usage Information.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1254
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1255
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1256
sub Usage {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1257
  print <<USAGE_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1258
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1259
    Usage: Scanlog.pl [options]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1260
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1261
    options:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1262
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1263
    -h  help
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1264
    -l  Log file to scan [Multiple allowed]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1265
    -o  Output file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1266
    -v  Increments Verbose level [Maximum Level = 2]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1267
    -t  Title to add to the Summary
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1268
    -d  Filename for Logfile with Time Information removed [Optional]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1269
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1270
    History options [Optional]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1271
    -hh More help on History options and file formats
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1272
    -c  History csv to add summary to
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1273
    -m  Machine name to class csv data file [required if using -c]
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1274
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1275
USAGE_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1276
	exit 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1277
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1278
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1279
# HistoryHelp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1280
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1281
# Output History Help Information.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1282
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1283
sub HistoryHelp{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1284
  print <<HISTORY_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1285
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1286
  History Description:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1287
  The History function collates the timing summary information of the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1288
  components from multiple builds. As the timing data varies between
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1289
  machines of different specifications, htmlscanlog tries to identify
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1290
  the machines hostname from the logs so it can identify which class
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1291
  of machine it belongs to (the machine class is used to group multiple
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1292
  machines with identical specifications). If it is not able to identify
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1293
  a machine name (and class) it uses the first entry in the Machine name
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1294
  to class csv.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1295
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1296
  History csv file format:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1297
  The csv format is for easy loading into spreadsheet programs for
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1298
  generating charts. The first line contains the column headings, the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1299
  first column headings is the machine class, machine name, Title,
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1300
  the last time entry in all the logs processed, then the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1301
  component names. Removed components will cause empty entries, new
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1302
  components will be added at the end.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1303
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1304
  Machine name to class csv data file format:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1305
  The csv format contains two columns with no headings, first column is
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1306
  the class name, the second is the machine name.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1307
    
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1308
HISTORY_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1309
	exit 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1310
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1311
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1312
# PrintHTMLHeader
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1313
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1314
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1315
# $iTitle (Title for Log file)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1316
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1317
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1318
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1319
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1320
# This function print the HTML Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1321
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1322
sub PrintHTMLHeader {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1323
  my ($iTitle) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1324
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1325
   print HTML <<HTML_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1326
<HTML>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1327
<HEAD>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1328
<TITLE>$iTitle</TITLE>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1329
</HEAD>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1330
<BODY BGCOLOR="FFFFFF">
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1331
<FONT FACE="Courier New">
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1332
HTML_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1333
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1334
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1335
# PrintHTMLFooter
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1336
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1337
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1338
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1339
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1340
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1341
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1342
# This function print the HTML Footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1343
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1344
sub PrintHTMLFooter {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1345
   print HTML <<HTML_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1346
</FONT>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1347
</BODY>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1348
</HTML>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1349
HTML_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1350
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1351
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1352
#  DiffDateTime
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1353
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1354
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1355
# $StartDateTime (Start Date/Time String)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1356
# $EndDateTime (End Date/Time String)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1357
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1358
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1359
# $Duration (Difference in seconds bertween the two dates/Times)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1360
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1361
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1362
# This function calculate the difference between to dates and times
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1363
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1364
sub DiffDateTime {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1365
  my ($String1, $String2) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1366
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1367
  my ($err, $delta);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1368
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1369
  $delta=&DateCalc($String1,$String2,\$err);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1370
  if ($err)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1371
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1372
    print "WARNING: DiffDateTime encountered and error\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1373
    return "0";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1374
  } else { 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1375
    # Convert into seconds to aid additions
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1376
    return &Delta_Format($delta,'0',"%sh");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1377
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1378
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1379
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1380
sub do_remarks()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1381
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1382
	my ($iLog) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1383
	# Store remarks by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1384
	if (!defined $CmdRemarks{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1385
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1386
		$CmdRemarks{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1387
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1388
	push @{$CmdRemarks{$command}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1389
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1390
	# Store remarks by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1391
	if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1392
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1393
		$remarks{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1394
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1395
	push @{$remarks{$component}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1396
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1397
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1398
sub do_warning()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1399
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1400
	my ($iLog) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1401
	# Store warning by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1402
	if (!defined $CmdWarnings{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1403
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1404
		$CmdWarnings{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1405
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1406
	push @{$CmdWarnings{$command}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1407
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1408
	# Store warning by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1409
	if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1410
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1411
		$warnings{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1412
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1413
	push @{$warnings{$component}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1414
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1415
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1416
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1417
sub do_migrationNotes()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1418
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1419
  my ($iLog)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1420
  # Store Migration Notes by command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1421
  if (!defined $CmdMigrationNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1422
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1423
    $CmdMigrationNotes{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1424
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1425
  push @{$CmdMigrationNotes{$command}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1426
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1427
  # Store Migration Notes by Componen
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1428
  if (!defined $migrationNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1429
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1430
    $migrationNotes{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1431
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1432
  push @{$migrationNotes{$component}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1433
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1434
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1435
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1436
sub do_AdvisoryNotes()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1437
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1438
  my ($iLog)= @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1439
  # Store Advisory Notes by command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1440
  if (!defined $CmdAdvisoryNotes{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1441
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1442
    $CmdAdvisoryNotes{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1443
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1444
  push @{$CmdAdvisoryNotes{$command}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1445
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1446
  # Store Advisory Notes by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1447
  if (!defined $AdvisoryNotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1448
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1449
    $AdvisoryNotes{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1450
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1451
  push @{$AdvisoryNotes{$component}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1452
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1453
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1454
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1455
sub do_error()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1456
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1457
  my ($iLog) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1458
	# Store Errors by Command
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1459
	if (!defined $CmdErrors{$command})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1460
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1461
		$CmdErrors{$command} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1462
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1463
	push @{$CmdErrors{$command}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1464
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1465
	# Store Errors by Component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1466
	if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1467
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1468
		$errors{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1469
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1470
	push @{$errors{$component}}, "$iLog:"."$.".">$line";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1471
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1472
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1473
# Read a number of lines in the log ignoreing the content
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1474
sub do_slurp()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1475
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1476
  my ($num_lines) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1477
  for (my $i = 0; $i < $num_lines; $i++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1478
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1479
    <LOG>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1480
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
  1481
}