uh_parser/uh.pl
author Dario Sestito <darios@symbian.org>
Mon, 28 Jun 2010 14:13:42 +0100
changeset 294 60fee4a35d67
parent 293 a02973783e64
child 295 a215187752cf
permissions -rw-r--r--
Comment out some debug info
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:
258
08436a227940 Add author information. Reviewed descriptions
Dario Sestito <darios@symbian.org>
parents: 257
diff changeset
    11
# Dario Sestito <darios@symbian.org>
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
# Description:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
# Unite and HTML-ize Raptor log files
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
use strict;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
use FindBin;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
use lib $FindBin::Bin;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
use RaptorError;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
use RaptorWarning;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
use RaptorInfo;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
use RaptorUnreciped;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
use RaptorRecipe;
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    24
use releaseables;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
use XML::SAX;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
use RaptorSAXHandler;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
use Getopt::Long;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
187
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    30
use CGI;
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    31
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
our $raptorbitsdir = 'raptorbits';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
our $basedir = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
my $outputdir = "html";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    35
our $releaseablesdir = "releaseables";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
our $raptor_config = 'dummy_config';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
our $current_log_file = '';
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    38
our $missing = 0;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
my $help = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    40
GetOptions((
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    41
	'missing!' => \$missing,
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
	'basedir=s' => \$basedir,
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
	'help!' => \$help
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    44
));
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    45
my @logfiles = @ARGV;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
if ($help)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
{
282
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    49
print <<_EOH;
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    50
UH parser
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    51
Reads one or more Raptor log files, extracts the interesting bits and puts them into a
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    52
set of HTML files, making it easy to spot the failures and see the related log snippets.
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    53
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    54
Usage: uh.pl [options] [files]
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    55
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    56
Options:
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    57
  -h, --help            Show this help message and exit
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    58
  -m, --missing         Add report on missing binaries. Check is done against the epoc
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    59
                        tree at the root of the current drive
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    60
                        (Note: it requires Raptor log to include whatlog info)
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    61
  -b OUTDIR, --basedir OUTDIR
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    62
                        Generate output under OUTDIR (defaults to current dir)
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    63
  
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    64
Files:
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    65
  Accepts one or a list of raptor log files (separated by a space)
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    66
  If no file argument is provided then take the most recent log under \\epoc32\\build
83443e6675cd Restructure help text
Dario Sestito <darios@symbian.org>
parents: 260
diff changeset
    67
_EOH
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
	exit(0);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    69
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    70
249
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    71
if (!@logfiles)
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    72
{
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    73
	if (-d "\\epoc32\\build")
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    74
	{
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    75
		opendir(BUILDDIR, "\\epoc32\\build");
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    76
		my @allfoundlogfiles = grep(/^Makefile.\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}\.log$/, readdir(BUILDDIR));
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    77
		@allfoundlogfiles = sort {$b cmp $a} @allfoundlogfiles;
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    78
		push @logfiles, "\\epoc32\\build\\" . shift @allfoundlogfiles;
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    79
	}
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    80
}
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    81
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    82
if (!@logfiles)
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    83
{
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    84
	print "No files to parse.\n";
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    85
	exit(0);
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    86
}
f0ed429f31b7 Make UH parse the latest file under \epoc32\build by default
Dario Sestito <darios@symbian.org>
parents: 228
diff changeset
    87
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    88
if ($basedir)
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
	$raptorbitsdir = "$basedir/raptorbits";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
	$outputdir = "$basedir/html";
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
    92
	$releaseablesdir = "$basedir/releaseables";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    93
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    94
mkdir($basedir) if (!-d$basedir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    96
$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
    97
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    98
system("rmdir /S /Q $raptorbitsdir") if (-d $raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
mkdir($raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   100
#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
   101
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
   102
mkdir("$releaseablesdir");
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   103
186
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
   104
our $failure_item_number = 0;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
   105
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
# create empty summary file anyway
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
open(SUMMARY, ">$raptorbitsdir/summary.csv");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
close(SUMMARY);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   110
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
my $saxhandler = RaptorSAXHandler->new();
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
$saxhandler->add_observer('RaptorError', $RaptorError::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
$saxhandler->add_observer('RaptorWarning', $RaptorWarning::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
$saxhandler->add_observer('RaptorInfo', $RaptorInfo::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
$saxhandler->add_observer('RaptorUnreciped', $RaptorUnreciped::reset_status);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   116
$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
   117
$saxhandler->add_observer('releaseables', $releaseables::reset_status);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
our $allbldinfs = {};
254
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   120
our $allconfigs = {};
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
for (@logfiles)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
	print "Reading file: $_\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
	$current_log_file = $_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
	$parser->parse_uri($_);
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
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   130
releaseables::remove_missing_duplicates();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   131
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
my @allpackages = distinct_packages($allbldinfs);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
print "Generating HTML...\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
system("rd /S /Q $outputdir") if (-d $outputdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
mkdir ($outputdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
my $raptor_errors = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   140
my $raptor_warnings = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   141
my $raptor_unreciped = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   142
my $general_failures_num_by_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   143
my $general_failures_by_category_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
my $recipe_failures_num_by_severity = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
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
   146
my $missing_by_package = {};
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
#my $severities = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   148
my @severities = ('critical', 'major', 'minor', 'unknown');
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
# READ SUMMARY.CSV FILE
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
my $csv_file = "$raptorbitsdir/summary.csv";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
my $csv_linenum = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
open(CSV, $csv_file);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
while(<CSV>)
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
	$csv_linenum ++;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
	my $line = $_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   159
	if ($line =~ /([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)/)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   160
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   161
		my $failure = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   162
		$failure->{category} = $1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   163
		$failure->{subcategory} = $2;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   164
		$failure->{severity} = $3;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
		$failure->{config} = $4;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
		$failure->{component} = $5;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
		$failure->{mmp} = $6;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
		$failure->{phase} = $7;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
		$failure->{recipe} = $8;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
		$failure->{file} = $9;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
		$failure->{linenum} = $10;
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
		my $failure_package = '';
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
		if (!$failure->{category})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
			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
   178
			next;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   179
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   180
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   181
		if ($failure->{category} =~ m,^recipe_failure$,i and !$failure->{component})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   182
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   183
			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
   184
			next;
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
		if ($failure->{component})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
		{
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   188
			$failure_package = RaptorCommon::get_package_subpath($failure->{component});
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   189
			if (!$failure_package)
177
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
				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
   192
				next;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   193
			}
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
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   196
		$failure->{subcategory} = 'uncategorized' if (!$failure->{subcategory});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   197
		$failure->{severity} = 'unknown' if (!$failure->{severity});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
		$failure->{mmp} = '-' if (!$failure->{mmp});
228
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   199
		$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: 225
diff changeset
   200
		$failure->{recipe} = '-' if (!$failure->{recipe});
177
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
		# populate severities dynamically.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   203
		#$severities->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   204
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   205
		# put failure items into their category container
228
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   206
		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: 225
diff changeset
   207
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   208
			$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: 225
diff changeset
   209
			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: 225
diff changeset
   210
			
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   211
			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: 225
diff changeset
   212
			{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   213
				$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: 225
diff changeset
   214
			}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   215
			else
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   216
			{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   217
				$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: 225
diff changeset
   218
			}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   219
			
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   220
			$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: 225
diff changeset
   221
			$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: 225
diff changeset
   222
			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: 225
diff changeset
   223
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 225
diff changeset
   224
		elsif ($failure->{category} =~ /^raptor_(error|warning|unreciped)$/i)
177
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
			$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
   227
			my $general_failure = $general_failures_num_by_severity->{$failure->{category}};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
			if (!defined $general_failure->{$failure->{severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   231
				$general_failure->{$failure->{severity}} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   232
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
			else
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   234
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
				$general_failure->{$failure->{severity}} ++;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
			}
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
			$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
   239
			$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
   240
			push(@{$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}}}, $failure);
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
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
	else
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 "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
   246
	}
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
close(CSV);
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 HTML SUMMARY
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
my $aggregated_html = "$outputdir/index.html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   252
open(AGGREGATED, ">$aggregated_html");
254
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   253
print AGGREGATED "RAPTOR BUILD SUMMARY<br/><br/>\n";
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   254
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   255
my $allconfigsstring = '';
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   256
for my $raptorconfig (sort {$a cmp $b} keys %{$allconfigs}) { $allconfigsstring .= ", $raptorconfig"; }
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 253
diff changeset
   257
$allconfigsstring =~ s/^, //;
255
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   258
print AGGREGATED "BUILT CONFIGS:<br/>$allconfigsstring<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   259
257
0cefd1662676 Ren 'general failures' title into more appropriate 'floating failures'
Dario Sestito <darios@symbian.org>
parents: 256
diff changeset
   260
print AGGREGATED "<br/>FLOATING FAILURES<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
my $tableheader = "<tr><th>category</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
for (@severities) { $tableheader .= "<th>$_</th>"; }
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
for my $category (keys %{$general_failures_num_by_severity})
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
	print_category_specific_summary($category, $general_failures_by_category_severity->{$category});
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
	my $categoryline = "<tr><td><a href='$category.html'>$category</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   270
	for (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   272
		my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   273
		$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
   274
		$categoryline .= "<td>$failuresbyseverity</td>";
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
	$categoryline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
	print AGGREGATED "$categoryline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
print AGGREGATED "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   280
print AGGREGATED "<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   281
256
788d181d70a4 Do not display the unknown/unknown package unless there are associated failures
Dario Sestito <darios@symbian.org>
parents: 255
diff changeset
   282
print AGGREGATED "PACKAGE-SPECIFIC FAILURES<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
print AGGREGATED "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   284
$tableheader = "<tr><th>package</th>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   285
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
   286
$tableheader .= "<th>missing</th>" if ($missing);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
$tableheader .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
print AGGREGATED "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   289
for my $package (@allpackages)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   290
{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   291
	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
   292
	if ($mustlink)
177
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 $packagesummaryhtml = $package;
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   295
		$packagesummaryhtml =~ s,/,_,g;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   296
		$packagesummaryhtml .= ".html";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   297
		my $packageline = "<tr><td><a href='$packagesummaryhtml'>$package</a></td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   298
		for (@severities)
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
			my $failuresbyseverity = 0;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   301
			$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
   302
			$packageline .= "<td>$failuresbyseverity</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   303
		}
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   304
		$packageline .= "<td>".$missing_by_package->{$package}."</td>" if ($missing);
223
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 216
diff changeset
   305
		$packageline .= "</tr>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   306
		print AGGREGATED "$packageline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   307
	}
256
788d181d70a4 Do not display the unknown/unknown package unless there are associated failures
Dario Sestito <darios@symbian.org>
parents: 255
diff changeset
   308
	# don't display the unknown/unknown package unless there are associated failures
788d181d70a4 Do not display the unknown/unknown package unless there are associated failures
Dario Sestito <darios@symbian.org>
parents: 255
diff changeset
   309
	elsif ($package eq 'unknown/unknown') {}
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   310
	else
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 $packageline = "<tr><td>$package</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   313
		for (@severities) { $packageline .= "<td>0</td>"; }
223
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 216
diff changeset
   314
		$packageline .= "<td>0</td>" if ($missing);
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 216
diff changeset
   315
		$packageline .= "</tr>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   316
		print AGGREGATED "$packageline\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 AGGREGATED "</table>\n";
255
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   320
print AGGREGATED "<br/>\n";
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   321
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   322
my $allfilesstring = '';
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   323
for my $raptorfile (sort {$a cmp $b} @logfiles) { $allfilesstring .= "<br/>$raptorfile"; }
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   324
print AGGREGATED "PARSED LOGS:$allfilesstring<br/>\n";
71dcc4963b58 Move PARSED FILES section to the bottom. Minor cosmetic changes
Dario Sestito <darios@symbian.org>
parents: 254
diff changeset
   325
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   326
close(AGGREGATED);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   327
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   328
translate_detail_files_to_html();
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
print "OK, done. Please open $outputdir/index.html.\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   331
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
sub print_category_specific_summary
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   334
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   335
	my ($category, $failures_by_severity) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   336
	
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   337
	my $filenamebase = $category; 
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   338
	$filenamebase =~ s,/,_,g;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   339
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   340
	open(SPECIFIC, ">$outputdir/$filenamebase.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   341
	print SPECIFIC "FAILURES FOR CATEGORY $category<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   342
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   343
	for my $severity (@severities)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   344
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   345
		if (defined $failures_by_severity->{$severity})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   346
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   347
			print SPECIFIC "<br/>".uc($severity)."<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   348
			print SPECIFIC "<table border='1'>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   349
			# $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   350
			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
   351
			print SPECIFIC "$tableheader\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   352
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   353
			for my $failure (@{$failures_by_severity->{$severity}})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   354
			{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   355
				my $failureline = "<tr><td>$failure->{subcategory}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   356
				$failureline .= "<td>$failure->{config}</td>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   357
				$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
   358
				$failureline .= "</tr>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   359
				print SPECIFIC "$failureline\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   360
			}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   361
			
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   362
			print SPECIFIC "</table>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   363
			print SPECIFIC "<br/>\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   364
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   365
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   366
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   367
	close(SPECIFIC);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   368
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   369
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   370
sub print_package_specific_summary
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   371
{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   372
	my ($package) = @_;
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
	my $anyfailures = 0;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   375
	
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   376
	my $filenamebase = $package; 
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   377
	$filenamebase =~ s,/,_,g;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   378
	
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   379
	if (defined $recipe_failures_by_package_severity->{$package})
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   380
	{
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   381
		$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   382
		
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   383
		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
   384
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   385
		open(SPECIFIC, ">$outputdir/$filenamebase.html");	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   386
		print SPECIFIC "FAILURES FOR PACKAGE $package<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   387
			
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   388
		for my $severity (@severities)
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
			if (defined $failures_by_severity->{$severity})
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
				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
   393
				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
   394
				# $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
   395
				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
   396
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   397
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   398
				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
   399
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   400
					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
   401
					$failureline .= "<td>$failure->{config}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   402
					$failureline .= "<td>$failure->{mmp}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   403
					$failureline .= "<td>$failure->{phase}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   404
					$failureline .= "<td>$failure->{recipe}</td>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   405
					$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
   406
					$failureline .= "</tr>";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   407
					print SPECIFIC "$failureline\n";
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
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   410
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   411
				print SPECIFIC "<br/>\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   412
			}
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   413
		}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   414
		close(SPECIFIC);
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
	
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   417
	if ($missing)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   418
	{
225
fb5bc19e742d Fix '0' as number of missing is not shown if there are errors but no missing
Dario Sestito <darios@symbian.org>
parents: 223
diff changeset
   419
		$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: 223
diff changeset
   420
		
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   421
		my $missinglistfile = $package;
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   422
		$missinglistfile =~ s,/,_,g;
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   423
		$missinglistfile .= "_missing.txt";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   424
		if (open(MISSINGLIST, "$::raptorbitsdir/$missinglistfile"))
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   425
		{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   426
			my @list = ();
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   427
			while(<MISSINGLIST>)
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   428
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   429
				my $missingfile = $_;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   430
				chomp $missingfile;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   431
				$missingfile =~ s,^\s+,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   432
				$missingfile =~ s,\s+$,,g;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   433
				push(@list, $missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   434
			}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   435
			close(MISSINGLIST);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   436
			
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   437
			$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
   438
			
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   439
			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
   440
			{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   441
				open(SPECIFIC, ">>$outputdir/$filenamebase.html");
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   442
				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
   443
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   444
				$anyfailures = 1;
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   445
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   446
				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
   447
				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
   448
				# $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
   449
				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
   450
				print SPECIFIC "$tableheader\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   451
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   452
				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
   453
				{
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   454
					$missingfile = CGI::escapeHTML($missingfile);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   455
					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
   456
				}
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   457
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   458
				print SPECIFIC "</table>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   459
				print SPECIFIC "<br/>\n";
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   460
				
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   461
				close(SPECIFIC);
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   462
			}
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   463
		}
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
	
216
2c2dbe93b84b Uh parser to report on list of missing releaseables
Dario Sestito <darios@symbian.org>
parents: 187
diff changeset
   466
	return $anyfailures;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   467
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   468
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   469
sub translate_detail_files_to_html
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   470
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   471
	opendir(DIR, $raptorbitsdir);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   472
	my @failurefiles = readdir(DIR);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   473
	closedir(DIR);	
223
604012c39141 Minor adjustments to UH parser
Dario Sestito <darios@symbian.org>
parents: 216
diff changeset
   474
	@failurefiles = grep($_ =~ /\.txt$/ && $_ !~ /_missing\.txt$/, @failurefiles);
177
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
	for my $file (@failurefiles)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   477
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   478
		$file =~ /(.*)\.txt$/;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   479
		my $filenamebase = $1;
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
		my $filecontent = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   482
		open(FILE, "$raptorbitsdir/$file");
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
			local $/=undef;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   485
			$filecontent = <FILE>;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   486
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   487
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   488
		
187
ec83a06d23a8 HTML escape failures so that they can be viewed correctly
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
   489
		$filecontent = CGI::escapeHTML($filecontent);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   490
		$filecontent =~ s,---(failure_item_\d+)---,<a name="$1">---$1---</a>,g;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   491
		$filecontent = "<pre>$filecontent</pre>";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   492
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   493
		open(FILE, ">$outputdir/$filenamebase\_failures.html");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   494
		print FILE $filecontent;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   495
		close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   496
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   497
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   498
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   499
sub distinct_packages
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   500
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   501
	my ($allbldinfs) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   502
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   503
	my $allpackages = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   504
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   505
	for my $bldinf (keys %{$allbldinfs})
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   506
	{
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   507
		RaptorCommon::normalize_bldinf_path(\$bldinf);
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   508
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   509
		my $package = '';
294
60fee4a35d67 Comment out some debug info
Dario Sestito <darios@symbian.org>
parents: 293
diff changeset
   510
		#print "bldinf: $bldinf\n";
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   511
		$package = RaptorCommon::get_package_subpath($bldinf);
294
60fee4a35d67 Comment out some debug info
Dario Sestito <darios@symbian.org>
parents: 293
diff changeset
   512
		#print "package: $package\n";
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 282
diff changeset
   513
		if (!$package)
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   514
		{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   515
			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
   516
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   517
		
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   518
		$allpackages->{$package} = 1;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   519
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   520
	
252
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   521
	# sort packages, but set unknown first
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   522
	my @sorted = ();
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   523
	if (defined $allpackages->{'unknown/unknown'})
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   524
	{
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   525
		push @sorted, 'unknown/unknown';
253
b59a964f37ef Fix: package unknown/unknown appears twice
Dario Sestito <darios@symbian.org>
parents: 252
diff changeset
   526
		delete $allpackages->{'unknown/unknown'};
252
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   527
	}
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   528
	push @sorted, sort {$a cmp $b} keys %{$allpackages};
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   529
	
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   530
	return @sorted;
f593b7acdb37 Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents: 249
diff changeset
   531
}