uh_parser/uh.pl
author MattD <mattd@symbian.org>
Wed, 24 Mar 2010 17:04:41 +0000
changeset 222 7d674ef4b3c2
parent 216 2c2dbe93b84b
child 223 604012c39141
permissions -rw-r--r--
Catchup merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
177
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;
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    23
use releaseables;
177
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
187
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    29
use CGI;
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    30
177
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";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    34
our $releaseablesdir = "releaseables";
177
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 = '';
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    37
our $missing = 0;
177
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((
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    40
	'missing!' => \$missing,
177
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";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
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: 187
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: 187
diff changeset
    55
	print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
177
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";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    63
	$releaseablesdir = "$basedir/releaseables";
177
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";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
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: 187
diff changeset
    73
mkdir("$releaseablesdir");
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
186
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    75
our $failure_item_number = 0;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    76
177
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
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    81
177
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);
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    88
$saxhandler->add_observer('releaseables', $releaseables::reset_status);
177
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
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   100
releaseables::remove_missing_duplicates();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   101
177
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 = {};
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   116
my $missing_by_package = {};
177
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});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   172
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   173
		# populate severities dynamically.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   174
		#$severities->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   175
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
		# put failure items into their category container
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
		if ($failure->{category} =~ /^raptor_(error|warning|unreciped)$/i)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   179
			$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
   180
			my $general_failure = $general_failures_num_by_severity->{$failure->{category}};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   181
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   182
			if (!defined $general_failure->{$failure->{severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   183
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   184
				$general_failure->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   185
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   186
			else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   188
				$general_failure->{$failure->{severity}} ++;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   189
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   190
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   191
			$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
   192
			$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
   193
			push(@{$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}}}, $failure);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   194
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   195
		elsif ($failure->{category} =~ /^recipe_failure$/i)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   196
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   197
			$recipe_failures_num_by_severity->{$failure_package} = {} if (!defined $recipe_failures_num_by_severity->{$failure_package});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
			my $package_failure = $recipe_failures_num_by_severity->{$failure_package};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   199
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   200
			if (!defined $package_failure->{$failure->{severity}})
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
				$package_failure->{$failure->{severity}} = 1;
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
			else
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
				$package_failure->{$failure->{severity}} ++;
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
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   209
			$recipe_failures_by_package_severity->{$failure_package} = {} if (!defined $recipe_failures_by_package_severity->{$failure_package});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   210
			$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}} = [] if (!defined $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   211
			push(@{$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}}}, $failure);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   212
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   213
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   214
	else
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
		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
   217
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   218
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   219
close(CSV);
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
# PRINT HTML SUMMARY
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   222
my $aggregated_html = "$outputdir/index.html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   223
open(AGGREGATED, ">$aggregated_html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   224
print AGGREGATED "RAPTOR BUILD SUMMARY<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   225
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   226
print AGGREGATED "<br/>GENERAL FAILURES<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   227
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
my $tableheader = "<tr><th>category</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
for (@severities) { $tableheader .= "<th>$_</th>"; }
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   231
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   232
for my $category (keys %{$general_failures_num_by_severity})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   234
	print_category_specific_summary($category, $general_failures_by_category_severity->{$category});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
	my $categoryline = "<tr><td><a href='$category.html'>$category</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
	for (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   237
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
		my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   239
		$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
   240
		$categoryline .= "<td>$failuresbyseverity</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   241
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
	$categoryline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
	print AGGREGATED "$categoryline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
print AGGREGATED "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
print AGGREGATED "<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   247
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   248
print AGGREGATED "<br/>PACKAGE-SPECIFIC FAILURES<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   249
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   250
$tableheader = "<tr><th>package</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
for (@severities) { $tableheader .= "<th>$_</th>"; }
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   252
$tableheader .= "<th>missing</th>" if ($missing);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   253
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   254
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   255
for my $package (@allpackages)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   256
{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   257
	my $mustlink = print_package_specific_summary($package);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   258
	if ($mustlink)
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   259
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   260
		my $packagesummaryhtml = $package;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
		$packagesummaryhtml =~ s,/,_,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
		$packagesummaryhtml .= ".html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
		my $packageline = "<tr><td><a href='$packagesummaryhtml'>$package</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
		for (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
			my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   267
			$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
   268
			$packageline .= "<td>$failuresbyseverity</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
		}
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   270
		$packageline .= "<td>".$missing_by_package->{$package}."</td>" if ($missing);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
		$packageline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   272
		print AGGREGATED "$packageline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   273
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   274
	else
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
		my $packageline = "<tr><td>$package</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
		for (@severities) { $packageline .= "<td>0</td>"; }
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
		$packageline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
		print AGGREGATED "$packageline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   280
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   281
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   282
print AGGREGATED "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
close(AGGREGATED);
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
translate_detail_files_to_html();
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   286
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
print "OK, done. Please open $outputdir/index.html.\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
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
sub print_category_specific_summary
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
	my ($category, $failures_by_severity) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   293
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   294
	my $filenamebase = $category;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   295
	$filenamebase =~ s,/,_,;
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
	open(SPECIFIC, ">$outputdir/$filenamebase.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   298
	print SPECIFIC "FAILURES FOR CATEGORY $category<br/>\n";
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
	for my $severity (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   301
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   302
		if (defined $failures_by_severity->{$severity})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   303
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   304
			print SPECIFIC "<br/>".uc($severity)."<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   305
			print SPECIFIC "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   306
			# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   307
			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
   308
			print SPECIFIC "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   309
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   310
			for my $failure (@{$failures_by_severity->{$severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   311
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   312
				my $failureline = "<tr><td>$failure->{subcategory}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   313
				$failureline .= "<td>$failure->{config}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   314
				$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
   315
				$failureline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   316
				print SPECIFIC "$failureline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   317
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   318
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   319
			print SPECIFIC "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   320
			print SPECIFIC "<br/>\n";
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
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   323
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   324
	close(SPECIFIC);
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
sub print_package_specific_summary
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   328
{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   329
	my ($package) = @_;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   330
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   331
	my $anyfailures = 0;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   332
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   333
	my $filenamebase = $package;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   334
	$filenamebase =~ s,/,_,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   335
	
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   336
	if (defined $recipe_failures_by_package_severity->{$package})
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   337
	{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   338
		$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   339
		
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   340
		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: 187
diff changeset
   341
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   342
		open(SPECIFIC, ">$outputdir/$filenamebase.html");	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   343
		print SPECIFIC "FAILURES FOR PACKAGE $package<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   344
			
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   345
		for my $severity (@severities)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   346
		{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   347
			if (defined $failures_by_severity->{$severity})
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   348
			{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   349
				print SPECIFIC "<br/>".uc($severity)."<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   350
				print SPECIFIC "<table border='1'>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   351
				# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   352
				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: 187
diff changeset
   353
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   354
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   355
				for my $failure (@{$failures_by_severity->{$severity}})
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   356
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   357
					my $failureline = "<tr><td>$failure->{subcategory}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   358
					$failureline .= "<td>$failure->{config}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   359
					$failureline .= "<td>$failure->{mmp}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   360
					$failureline .= "<td>$failure->{phase}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   361
					$failureline .= "<td>$failure->{recipe}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   362
					$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: 187
diff changeset
   363
					$failureline .= "</tr>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   364
					print SPECIFIC "$failureline\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   365
				}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   366
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   367
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   368
				print SPECIFIC "<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   369
			}
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   370
		}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   371
		close(SPECIFIC);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   372
	}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   373
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   374
	if ($missing)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   375
	{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   376
		my $missinglistfile = $package;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   377
		$missinglistfile =~ s,/,_,;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   378
		$missinglistfile .= "_missing.txt";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   379
		if (open(MISSINGLIST, "$::raptorbitsdir/$missinglistfile"))
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   380
		{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   381
			my @list = ();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   382
			while(<MISSINGLIST>)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   383
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   384
				my $missingfile = $_;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   385
				chomp $missingfile;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   386
				$missingfile =~ s,^\s+,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   387
				$missingfile =~ s,\s+$,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   388
				push(@list, $missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   389
			}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   390
			close(MISSINGLIST);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   391
			
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   392
			$missing_by_package->{$package} = scalar(@list);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   393
			
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   394
			if ($missing_by_package->{$package} > 0)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   395
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   396
				open(SPECIFIC, ">>$outputdir/$filenamebase.html");
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   397
				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: 187
diff changeset
   398
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   399
				$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   400
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   401
				print SPECIFIC "<br/>MISSING<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   402
				print SPECIFIC "<table border='1'>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   403
				# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   404
				my $tableheader = "<tr><th>file</th></tr>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   405
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   406
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   407
				for my $missingfile (sort {$a cmp $b} @list)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   408
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   409
					$missingfile = CGI::escapeHTML($missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   410
					print SPECIFIC "<tr><td>$missingfile</td></tr>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   411
				}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   412
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   413
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   414
				print SPECIFIC "<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   415
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   416
				close(SPECIFIC);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   417
			}
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   418
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   419
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   420
	
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   421
	return $anyfailures;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   422
}
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
sub translate_detail_files_to_html
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   425
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   426
	opendir(DIR, $raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   427
	my @failurefiles = readdir(DIR);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   428
	closedir(DIR);	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   429
	@failurefiles = grep(/\.txt$/, @failurefiles);
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
	for my $file (@failurefiles)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   432
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   433
		$file =~ /(.*)\.txt$/;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   434
		my $filenamebase = $1;
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
		my $filecontent = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   437
		open(FILE, "$raptorbitsdir/$file");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   438
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   439
			local $/=undef;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   440
			$filecontent = <FILE>;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   441
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   442
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   443
		
187
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   444
		$filecontent = CGI::escapeHTML($filecontent);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   445
		$filecontent =~ s,---(failure_item_\d+)---,<a name="$1">---$1---</a>,g;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   446
		$filecontent = "<pre>$filecontent</pre>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   447
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   448
		open(FILE, ">$outputdir/$filenamebase\_failures.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   449
		print FILE $filecontent;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   450
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   451
	}
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
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   454
sub distinct_packages
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   455
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   456
	my ($allbldinfs) = @_;
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
	my $allpackages = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   459
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   460
	for my $bldinf (keys %{$allbldinfs})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   461
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   462
		# normalize bldinf path
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   463
		$bldinf = lc($bldinf);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   464
		$bldinf =~ s,^[A-Za-z]:,,;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   465
		$bldinf =~ s,[\\],/,g;
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
		my $package = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   468
		if ($bldinf =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   469
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   470
			$package = $1;
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
		else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   473
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   474
			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
   475
		}
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
		$allpackages->{$package} = 1;
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
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   480
	return sort {$a cmp $b} keys %{$allpackages};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   481
}