deprecated/buildtools/buildsystemtools/scanlog/scanlog.pl
author jascui
Tue, 16 Nov 2010 15:56:27 +0800
changeset 683 8e0eb519ef53
parent 655 3f65fd25dfd4
permissions -rw-r--r--
Solve incorrect handling of ExportName=SymbolName@Ordinal syntax
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
# summarise an automated build log
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
# documentation available in generic\tools\e32toolp\docs\scanlog.txt
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
# please update the documentation when modifying this file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
# RegEx's in Scanlog Module
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
# 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
use strict;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
use FindBin;		# for FindBin::Bin
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
# Add the directory contain this perl script into the path to find modules
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
use lib $FindBin::Bin;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
use Scanlog;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
my $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
my $iSlurp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
my $phase;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
my $match_phase='';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
my $command='???';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
my $starttime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
my $duration;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
my $errorcount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
my $component='???';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
my %errors;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
my %missing;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
my %not_built;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
my $totalduration = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
my $totalerrors = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
my $warningcount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
my %warnings;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
my $totalwarnings = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
my $remarkscount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
my %remarks;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
my $totalremarks = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
my $migrationnotescount=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
my %migrationnotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
my $totalmigrationnotes = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
my ($iStatus, $iName);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
my $verbose = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
my $argc = scalar(@ARGV);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
if ($argc>0 and $ARGV[0]=~/^\s*\-v\s*$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
	$verbose = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
	shift @ARGV;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
elsif ($argc>0 and $ARGV[0]=~/^\s*\-V\s*$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
	$verbose = 2;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
	shift @ARGV;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
sub do_remarks()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
	$remarkscount += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
	if (!defined $remarks{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
		$remarks{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
	push @{$remarks{$component}}, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
sub do_migrationnotes()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
	$migrationnotescount += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
	if (!defined $migrationnotes{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
		$migrationnotes{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
	push @{$migrationnotes{$component}}, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
sub do_warning()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
	$warningcount += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
	if (!defined $warnings{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
		$warnings{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
	push @{$warnings{$component}}, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
sub do_error()
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
	$errorcount += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
	if (!defined $errors{$component})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
		$errors{$component} = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
	push @{$errors{$component}}, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
# Read a number of lines in the log ignoreing the content
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
sub do_slurp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
  my ($num_lines) =@_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
  for (my $i = 0; $i < $num_lines; $i++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
    <>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
sub print_command_summary($;$)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
	my ($command, $duration) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
	return if ($command eq '???' && $errorcount==0 && $warningcount==0 && $remarkscount==0 && $migrationnotescount==0 );
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
	my $elapsed = '??:??:??';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
	if (defined($duration))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
		$totalduration += $duration;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
		my ($sec,$min,$hour) = gmtime($duration);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
		$elapsed = sprintf("%02d:%02d:%02d", $hour, $min, $sec);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
	printf "%-28s\t%s\t%6d\t%6d\t%6d\t%6d\n", $command, $elapsed, $errorcount, $warningcount, $remarkscount, $migrationnotescount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
	$totalerrors += $errorcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
	$totalwarnings += $warningcount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
	$totalremarks += $remarkscount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
	$totalmigrationnotes += $migrationnotescount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
	$errorcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
	$warningcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
	$remarkscount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
	$migrationnotescount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
printf "%-28s\t%-8s\t%-6s\t%-6s\t%-6s\t%-6s   %s\n", 'Command', 'Time', 'Errors', 'Warning','Remarks','Migration-Notes';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
while ($line=<>)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
	# ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
	# === baseline_bldfiles   
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
	# ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
	# === bldfiles started Sat Jul 24 01:38:03 1999.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
	if ($line =~ /^===------/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
		print_command_summary($command);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
		$line = <>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
		$line =~ /=== (.*)$/;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   157
		$command = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   158
		<>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   159
		$line = <>;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
		$line =~ /^=== (.+) started ... ... .. (..):(..):(..)/;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
		$phase = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
		$starttime = ($2*60 + $3)*60 + $4;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
		$match_phase=$phase;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
		$match_phase=~s-\\-\\\\-go;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
	# === bldfiles finished Sat Jul 24 01:38:56 1999.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
	if ($line =~ /^=== $match_phase finished ... ... .. (..):(..):(..)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
		$duration = ($1*60 + $2)*60 + $3 - $starttime;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
		if ($duration < 0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
			$duration += 24*60*60;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
		
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
		print_command_summary($command,$duration);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
		$command = '???';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
		$component = '???';
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
	# === resource == gdtran 036
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
	if ($line =~ /=== $match_phase == (\S+)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
		$component = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
		$component =~ /(.*)[\\]$/;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
		$component = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
	# Lines to Ignore
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
  ($iStatus) =&Scanlog::CheckForIgnore($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
	if($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
	# migrationnotes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
  ($iStatus, $iSlurp) =&Scanlog::CheckForMigrationNotes($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
		do_migrationnotes();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
    do_slurp($iSlurp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
	# Remarks
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
  ($iStatus, $iSlurp) =&Scanlog::CheckForRemarks($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
		do_remarks();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
    do_slurp($iSlurp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
	# Errors
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
  ($iStatus) =&Scanlog::CheckForErrors($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
		do_error();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
	# Warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
  ($iStatus) =&Scanlog::CheckForWarnings($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
		do_warning();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
	# Things Not Built
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
  ($iStatus, $iName) =&Scanlog::CheckForNotBuilt($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
		do_error();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
		$not_built{$iName} = "$component";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
	# Things missing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
  ($iStatus, $iName) =&Scanlog::CheckForMissing($line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
	if ($iStatus)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
		do_error();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
		$missing{$iName} += 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
print_command_summary($command);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
print "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
my ($sec,$min,$hour, $mday) = gmtime($totalduration);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
$hour+=($mday-1)*24;	# to allow for builds taking longer than 24 hours!
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
printf "%-28s\t%02d:%02d:%02d\t%6d\t%6d\t%6d\t%6d\n\n", "Total", $hour, $min, $sec, $totalerrors, $totalwarnings, $totalremarks, $totalmigrationnotes;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
if (scalar %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
	print "Fatal Errors by Component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
	$errorcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
	foreach $component (sort keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
		printf "%-16s\t%6d\n", $component, scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
		$errorcount += scalar(@{$errors{$component}});
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
	if ($verbose>0)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
		print "\nError details";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
		foreach $component (sort keys %errors)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
			print "\n----------------------------\n$component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
			foreach $line (@{$errors{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
				print $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
if (scalar %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
	print "\nDon't know how to make...\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
	foreach my $file (sort keys %missing)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
		printf "%d\t%s\n", $missing{$file}, $file;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
if (scalar %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
	print "\nThings not built...\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
	foreach my $file (sort keys %not_built)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
		print "MISSING: $file ($not_built{$file})\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
	print "\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
if (scalar %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
	print "\nWarnings by Component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
	$warningcount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
	foreach $component (sort keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
		printf "%-16s\t%6d\n", $component, scalar @{$warnings{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
	if ($verbose>1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
		print "\nWarning details";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
		foreach $component (sort keys %warnings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
			print "\n----------------------------\n$component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
			foreach $line (@{$warnings{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
				print $line;
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
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
if (scalar %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
	print "\nRemarks by Component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
	$remarkscount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
	foreach $component (sort keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
		printf "%-16s\t%6d\n", $component, scalar @{$remarks{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
	if ($verbose>1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
		print "\nRemarks details";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
		foreach $component (sort keys %remarks)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   334
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   335
			print "\n----------------------------\n$component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   336
			foreach $line (@{$remarks{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
				print $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
		}
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
if (scalar %migrationnotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
	print "\nMigration Notes by Component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
	$migrationnotescount = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
	foreach $component (sort keys %migrationnotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
		printf "%-16s\t%6d\n", $component, scalar @{$migrationnotes{$component}};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
	if ($verbose>1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
		print "\nMigration Notes Details";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
		foreach $component (sort keys %migrationnotes)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
			print "\n----------------------------\n$component\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
			foreach $line (@{$migrationnotes{$component}})
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
				print $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365