uh_parser/uh.pl
author Dario Sestito <darios@symbian.org>
Mon, 12 Apr 2010 13:26:38 +0100
changeset 216 907120563fce
parent 209 ba90e30c0f3c
child 227 f0ed429f31b7
permissions -rw-r--r--
Add new variant_file_does_not_exist category for Raptor errors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
# Contributors:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    11
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
# Description:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
# Unite and HTML-ize Raptor log files
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
use strict;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
use FindBin;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
use lib $FindBin::Bin;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
use RaptorError;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
use RaptorWarning;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
use RaptorInfo;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
use RaptorUnreciped;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
use RaptorRecipe;
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    23
use releaseables;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
use XML::SAX;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
use RaptorSAXHandler;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
use Getopt::Long;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
186
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    29
use CGI;
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    30
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
our $raptorbitsdir = 'raptorbits';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
our $basedir = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
my $outputdir = "html";
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    34
our $releaseablesdir = "releaseables";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
our $raptor_config = 'dummy_config';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
our $current_log_file = '';
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    37
our $missing = 0;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
my $help = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
GetOptions((
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    40
	'missing!' => \$missing,
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
	'basedir=s' => \$basedir,
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
	'help!' => \$help
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
));
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    44
my @logfiles = @ARGV;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    45
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
$help = 1 if (!@logfiles);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
if ($help)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    49
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    50
	print "Unite and HTML-ize Raptor log files.\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
	print "Usage: perl uh.pl [OPTIONS] FILE1 FILE2 ...\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
	print "where OPTIONS are:\n";
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    53
	print "\t-m, --missing\tAlso add the list of missing binaries (Raptor log should include whatlog info).\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    54
	print "\t\t\tCheck is done against the epoc tree at the root of the current drive\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    55
	print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    56
	exit(0);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    57
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    58
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
if ($basedir)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
	$raptorbitsdir = "$basedir/raptorbits";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
	$outputdir = "$basedir/html";
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    63
	$releaseablesdir = "$basedir/releaseables";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    64
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    65
mkdir($basedir) if (!-d$basedir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    66
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    67
$raptorbitsdir =~ s,/,\\,g; # this is because rmdir doens't cope correctly with the forward slashes
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    69
system("rmdir /S /Q $raptorbitsdir") if (-d $raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    70
mkdir($raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    71
#print "Created dir $raptorbitsdir.\n";
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    72
system("rmdir /S /Q $releaseablesdir") if (-d $releaseablesdir);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    73
mkdir("$releaseablesdir");
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    75
our $failure_item_number = 0;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    76
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    77
# create empty summary file anyway
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    78
open(SUMMARY, ">$raptorbitsdir/summary.csv");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
close(SUMMARY);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    80
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    81
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    82
my $saxhandler = RaptorSAXHandler->new();
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    83
$saxhandler->add_observer('RaptorError', $RaptorError::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    84
$saxhandler->add_observer('RaptorWarning', $RaptorWarning::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    85
$saxhandler->add_observer('RaptorInfo', $RaptorInfo::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    86
$saxhandler->add_observer('RaptorUnreciped', $RaptorUnreciped::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    87
$saxhandler->add_observer('RaptorRecipe', $RaptorRecipe::reset_status);
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    88
$saxhandler->add_observer('releaseables', $releaseables::reset_status);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    90
our $allbldinfs = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    92
my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    93
for (@logfiles)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    94
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
	print "Reading file: $_\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    96
	$current_log_file = $_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    97
	$parser->parse_uri($_);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    98
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   100
releaseables::remove_missing_duplicates();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   101
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   102
my @allpackages = distinct_packages($allbldinfs);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   103
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   104
print "Generating HTML...\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
system("rd /S /Q $outputdir") if (-d $outputdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
mkdir ($outputdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
my $raptor_errors = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   110
my $raptor_warnings = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
my $raptor_unreciped = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
my $general_failures_num_by_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
my $general_failures_by_category_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
my $recipe_failures_num_by_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
my $recipe_failures_by_package_severity = {};
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   116
my $missing_by_package = {};
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   117
#my $severities = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
my @severities = ('critical', 'major', 'minor', 'unknown');
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   120
# READ SUMMARY.CSV FILE
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
my $csv_file = "$raptorbitsdir/summary.csv";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
my $csv_linenum = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
open(CSV, $csv_file);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
while(<CSV>)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
	$csv_linenum ++;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
	my $line = $_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   128
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   129
	if ($line =~ /([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)/)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   130
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   131
		my $failure = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
		$failure->{category} = $1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
		$failure->{subcategory} = $2;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
		$failure->{severity} = $3;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
		$failure->{config} = $4;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
		$failure->{component} = $5;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
		$failure->{mmp} = $6;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
		$failure->{phase} = $7;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
		$failure->{recipe} = $8;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   140
		$failure->{file} = $9;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   141
		$failure->{linenum} = $10;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   142
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   143
		my $failure_package = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
		if (!$failure->{category})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   146
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
			print "WARNING: summary line without a category at $csv_file line $csv_linenum. Skipping\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   148
			next;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   149
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   150
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
		if ($failure->{category} =~ m,^recipe_failure$,i and !$failure->{component})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
			print "WARNING: recipe_failure with component field empty at $csv_file line $csv_linenum. Skipping\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
			next;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   155
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   156
		if ($failure->{component})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
			if ($failure->{component} =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   159
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   160
				$failure_package = $1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   161
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   162
			else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   163
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   164
				print "WARNING: summary line with wrong component path at $csv_file line $csv_linenum. Skipping\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
				next;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
		$failure->{subcategory} = 'uncategorized' if (!$failure->{subcategory});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
		$failure->{severity} = 'unknown' if (!$failure->{severity});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
		$failure->{mmp} = '-' if (!$failure->{mmp});
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   172
		$failure->{phase} = '-' if (!$failure->{phase});
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   173
		$failure->{recipe} = '-' if (!$failure->{recipe});
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   174
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   175
		# populate severities dynamically.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
		#$severities->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
		# put failure items into their category container
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   179
		if ($failure->{category} =~ /^recipe_failure$/i || $failure->{category} =~ /^raptor_(error|warning|unreciped)$/i && $failure_package)
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   180
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   181
			$recipe_failures_num_by_severity->{$failure_package} = {} if (!defined $recipe_failures_num_by_severity->{$failure_package});
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   182
			my $package_failure = $recipe_failures_num_by_severity->{$failure_package};
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   183
			
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   184
			if (!defined $package_failure->{$failure->{severity}})
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   185
			{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   186
				$package_failure->{$failure->{severity}} = 1;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   187
			}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   188
			else
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   189
			{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   190
				$package_failure->{$failure->{severity}} ++;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   191
			}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   192
			
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   193
			$recipe_failures_by_package_severity->{$failure_package} = {} if (!defined $recipe_failures_by_package_severity->{$failure_package});
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   194
			$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}} = [] if (!defined $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}});
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   195
			push(@{$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}}}, $failure);
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   196
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 206
diff changeset
   197
		elsif ($failure->{category} =~ /^raptor_(error|warning|unreciped)$/i)
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   199
			$general_failures_num_by_severity->{$failure->{category}} = {} if (!defined $general_failures_num_by_severity->{$failure->{category}});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   200
			my $general_failure = $general_failures_num_by_severity->{$failure->{category}};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   201
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   202
			if (!defined $general_failure->{$failure->{severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   203
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   204
				$general_failure->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   205
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   206
			else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   207
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   208
				$general_failure->{$failure->{severity}} ++;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   209
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   210
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   211
			$general_failures_by_category_severity->{$failure->{category}} = {} if (!defined $general_failures_by_category_severity->{$failure->{category}});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   212
			$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}} = [] if (!defined $general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   213
			push(@{$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}}}, $failure);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   214
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   215
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   216
	else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   217
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   218
		print "WARNING: line does not match expected format at $csv_file line $csv_linenum. Skipping\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   219
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   220
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   221
close(CSV);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   222
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   223
# PRINT HTML SUMMARY
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   224
my $aggregated_html = "$outputdir/index.html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   225
open(AGGREGATED, ">$aggregated_html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   226
print AGGREGATED "RAPTOR BUILD SUMMARY<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   227
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
print AGGREGATED "<br/>GENERAL FAILURES<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
my $tableheader = "<tr><th>category</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   231
for (@severities) { $tableheader .= "<th>$_</th>"; }
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   232
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   234
for my $category (keys %{$general_failures_num_by_severity})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
	print_category_specific_summary($category, $general_failures_by_category_severity->{$category});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   237
	my $categoryline = "<tr><td><a href='$category.html'>$category</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
	for (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   239
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   240
		my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   241
		$failuresbyseverity = $general_failures_num_by_severity->{$category}->{$_} if (defined $general_failures_num_by_severity->{$category}->{$_});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
		$categoryline .= "<td>$failuresbyseverity</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
	$categoryline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
	print AGGREGATED "$categoryline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   247
print AGGREGATED "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   248
print AGGREGATED "<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   249
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   250
print AGGREGATED "<br/>PACKAGE-SPECIFIC FAILURES<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   252
$tableheader = "<tr><th>package</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   253
for (@severities) { $tableheader .= "<th>$_</th>"; }
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   254
$tableheader .= "<th>missing</th>" if ($missing);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   255
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   256
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   257
for my $package (@allpackages)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   258
{
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   259
	my $mustlink = print_package_specific_summary($package);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   260
	if ($mustlink)
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
		my $packagesummaryhtml = $package;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
		$packagesummaryhtml =~ s,/,_,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
		$packagesummaryhtml .= ".html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
		my $packageline = "<tr><td><a href='$packagesummaryhtml'>$package</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
		for (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   267
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   268
			my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
			$failuresbyseverity = $recipe_failures_num_by_severity->{$package}->{$_} if (defined $recipe_failures_num_by_severity->{$package}->{$_});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   270
			$packageline .= "<td>$failuresbyseverity</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
		}
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   272
		$packageline .= "<td>".$missing_by_package->{$package}."</td>" if ($missing);
204
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 201
diff changeset
   273
		$packageline .= "</tr>\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   274
		print AGGREGATED "$packageline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   275
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   276
	else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
		my $packageline = "<tr><td>$package</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
		for (@severities) { $packageline .= "<td>0</td>"; }
204
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 201
diff changeset
   280
		$packageline .= "<td>0</td>" if ($missing);
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 201
diff changeset
   281
		$packageline .= "</tr>\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   282
		print AGGREGATED "$packageline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   284
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   285
print AGGREGATED "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   286
close(AGGREGATED);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
translate_detail_files_to_html();
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   289
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   290
print "OK, done. Please open $outputdir/index.html.\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   291
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   292
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   293
sub print_category_specific_summary
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   294
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   295
	my ($category, $failures_by_severity) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   296
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   297
	my $filenamebase = $category;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   298
	$filenamebase =~ s,/,_,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   299
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   300
	open(SPECIFIC, ">$outputdir/$filenamebase.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   301
	print SPECIFIC "FAILURES FOR CATEGORY $category<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   302
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   303
	for my $severity (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   304
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   305
		if (defined $failures_by_severity->{$severity})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   306
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   307
			print SPECIFIC "<br/>".uc($severity)."<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   308
			print SPECIFIC "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   309
			# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   310
			my $tableheader = "<tr><th>category</th><th>log file</th><th>log snippet</th></tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   311
			print SPECIFIC "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   312
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   313
			for my $failure (@{$failures_by_severity->{$severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   314
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   315
				my $failureline = "<tr><td>$failure->{subcategory}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   316
				$failureline .= "<td>$failure->{config}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   317
				$failureline .= "<td><a href='$filenamebase\_failures.html#failure_item_$failure->{linenum}'>item $failure->{linenum}</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   318
				$failureline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   319
				print SPECIFIC "$failureline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   320
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   321
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   322
			print SPECIFIC "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   323
			print SPECIFIC "<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   324
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   325
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   326
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   327
	close(SPECIFIC);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   328
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   329
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   330
sub print_package_specific_summary
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   331
{
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   332
	my ($package) = @_;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   333
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   334
	my $anyfailures = 0;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   335
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   336
	my $filenamebase = $package;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   337
	$filenamebase =~ s,/,_,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   338
	
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   339
	if (defined $recipe_failures_by_package_severity->{$package})
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   340
	{
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   341
		$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   342
		
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   343
		my $failures_by_severity = $recipe_failures_by_package_severity->{$package};
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   344
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   345
		open(SPECIFIC, ">$outputdir/$filenamebase.html");	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   346
		print SPECIFIC "FAILURES FOR PACKAGE $package<br/>\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   347
			
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   348
		for my $severity (@severities)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   349
		{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   350
			if (defined $failures_by_severity->{$severity})
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   351
			{
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   352
				print SPECIFIC "<br/>".uc($severity)."<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   353
				print SPECIFIC "<table border='1'>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   354
				# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   355
				my $tableheader = "<tr><th>category</th><th>configuration</th><th>mmp</th><th>phase</th><th>recipe</th><th>log snippet</th></tr>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   356
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   357
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   358
				for my $failure (@{$failures_by_severity->{$severity}})
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   359
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   360
					my $failureline = "<tr><td>$failure->{subcategory}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   361
					$failureline .= "<td>$failure->{config}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   362
					$failureline .= "<td>$failure->{mmp}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   363
					$failureline .= "<td>$failure->{phase}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   364
					$failureline .= "<td>$failure->{recipe}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   365
					$failureline .= "<td><a href='$filenamebase\_failures.html#failure_item_$failure->{linenum}'>item $failure->{linenum}</a></td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   366
					$failureline .= "</tr>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   367
					print SPECIFIC "$failureline\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   368
				}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   369
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   370
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   371
				print SPECIFIC "<br/>\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   372
			}
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   373
		}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   374
		close(SPECIFIC);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   375
	}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   376
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   377
	if ($missing)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   378
	{
206
fb5bc19e742d Fix '0' as number of missing is not shown if there are errors but no missing
Dario Sestito <darios@symbian.org>
parents: 204
diff changeset
   379
		$missing_by_package->{$package} = 0;
fb5bc19e742d Fix '0' as number of missing is not shown if there are errors but no missing
Dario Sestito <darios@symbian.org>
parents: 204
diff changeset
   380
		
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   381
		my $missinglistfile = $package;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   382
		$missinglistfile =~ s,/,_,;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   383
		$missinglistfile .= "_missing.txt";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   384
		if (open(MISSINGLIST, "$::raptorbitsdir/$missinglistfile"))
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   385
		{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   386
			my @list = ();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   387
			while(<MISSINGLIST>)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   388
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   389
				my $missingfile = $_;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   390
				chomp $missingfile;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   391
				$missingfile =~ s,^\s+,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   392
				$missingfile =~ s,\s+$,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   393
				push(@list, $missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   394
			}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   395
			close(MISSINGLIST);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   396
			
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   397
			$missing_by_package->{$package} = scalar(@list);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   398
			
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   399
			if ($missing_by_package->{$package} > 0)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   400
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   401
				open(SPECIFIC, ">>$outputdir/$filenamebase.html");
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   402
				print SPECIFIC "FAILURES FOR PACKAGE $package<br/>\n" if(!$anyfailures);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   403
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   404
				$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   405
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   406
				print SPECIFIC "<br/>MISSING<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   407
				print SPECIFIC "<table border='1'>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   408
				# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   409
				my $tableheader = "<tr><th>file</th></tr>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   410
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   411
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   412
				for my $missingfile (sort {$a cmp $b} @list)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   413
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   414
					$missingfile = CGI::escapeHTML($missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   415
					print SPECIFIC "<tr><td>$missingfile</td></tr>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   416
				}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   417
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   418
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   419
				print SPECIFIC "<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   420
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   421
				close(SPECIFIC);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   422
			}
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   423
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   424
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   425
	
201
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   426
	return $anyfailures;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   427
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   428
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   429
sub translate_detail_files_to_html
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   430
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   431
	opendir(DIR, $raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   432
	my @failurefiles = readdir(DIR);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   433
	closedir(DIR);	
204
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 201
diff changeset
   434
	@failurefiles = grep($_ =~ /\.txt$/ && $_ !~ /_missing\.txt$/, @failurefiles);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   435
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   436
	for my $file (@failurefiles)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   437
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   438
		$file =~ /(.*)\.txt$/;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   439
		my $filenamebase = $1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   440
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   441
		my $filecontent = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   442
		open(FILE, "$raptorbitsdir/$file");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   443
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   444
			local $/=undef;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   445
			$filecontent = <FILE>;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   446
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   447
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   448
		
186
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   449
		$filecontent = CGI::escapeHTML($filecontent);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   450
		$filecontent =~ s,---(failure_item_\d+)---,<a name="$1">---$1---</a>,g;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   451
		$filecontent = "<pre>$filecontent</pre>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   452
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   453
		open(FILE, ">$outputdir/$filenamebase\_failures.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   454
		print FILE $filecontent;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   455
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   456
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   457
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   458
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   459
sub distinct_packages
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   460
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   461
	my ($allbldinfs) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   462
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   463
	my $allpackages = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   464
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   465
	for my $bldinf (keys %{$allbldinfs})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   466
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   467
		# normalize bldinf path
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   468
		$bldinf = lc($bldinf);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   469
		$bldinf =~ s,^[A-Za-z]:,,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   470
		$bldinf =~ s,[\\],/,g;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   471
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   472
		my $package = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   473
		if ($bldinf =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   474
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   475
			$package = $1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   476
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   477
		else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   478
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   479
			print "WARNING: can't understand bldinf attribute of recipe: $bldinf. Won't dump to failed recipes file.\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   480
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   481
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   482
		$allpackages->{$package} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   483
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   484
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   485
	return sort {$a cmp $b} keys %{$allpackages};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   486
}