uh_parser/RaptorError.pm
author Simon Howkins <simonh@symbian.org>
Thu, 13 May 2010 12:34:20 +0100
changeset 239 d01a4084d621
parent 238 09b83ca8e0cf
child 249 06db82e8efc6
permissions -rw-r--r--
Extended to put the preferred column headings into the table. Also made a few other simplifications.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
# Contributors:
236
08436a227940 Add author information. Reviewed descriptions
Dario Sestito <darios@symbian.org>
parents: 232
diff changeset
    11
# Dario Sestito <darios@symbian.org>
176
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
# Raptor parser module.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
# Extract, analyzes and dumps raptor errors i.e. content of <error> tags from a raptor log file
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
package RaptorError;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
use strict;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
use RaptorCommon;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
our $reset_status = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
my $buildlog_status = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
my $buildlog_error_status = {};
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
$reset_status->{name} = 'reset_status';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
$reset_status->{next_status} = {buildlog=>$buildlog_status};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
$buildlog_status->{name} = 'buildlog_status';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
$buildlog_status->{next_status} = {error=>$buildlog_error_status};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
$buildlog_status->{on_start} = 'RaptorError::on_start_buildlog';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
$buildlog_error_status->{name} = 'buildlog_error_status';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
$buildlog_error_status->{next_status} = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
$buildlog_error_status->{on_start} = 'RaptorError::on_start_buildlog_error';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
$buildlog_error_status->{on_end} = 'RaptorError::on_end_buildlog_error';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
$buildlog_error_status->{on_chars} = 'RaptorError::on_chars_buildlog_error';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
my $filename = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    40
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    41
my $raptor_error_info = {};
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    42
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
my $characters = '';
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 $CATEGORY_RAPTORERROR = 'raptor_error';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
my $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION = 'cannot_process_schema_version';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
my $CATEGORY_RAPTORERROR_NOBLDINFFOUND = 'no_bld_inf_found';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
my $CATEGORY_RAPTORERROR_CANTFINDMMPFILE = 'cant_find_mmp_file';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    49
my $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS = 'make_exited_with_errors';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    50
my $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION = 'tool_didnot_return_version';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
my $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG = 'unknown_build_config';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
my $CATEGORY_RAPTORERROR_NOBUILDCONFIGSGIVEN = 'no_build_configs_given';
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
    53
my $CATEGORY_RAPTORERROR_COULDNOTEXPORT = 'missing_source_file';
212
914d8060176c Rename missing_bld_inf_file category to cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents: 211
diff changeset
    54
my $CATEGORY_RAPTORERROR_CPPEXENOSUCHFILEORDIRECTORY = 'cpp_exe_no_such_file_or_directory';
211
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    55
my $CATEGORY_RAPTORERROR_FAILEDTOPARSEXMLFILE = 'failed_to_parse_xml_file';
216
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
    56
my $CATEGORY_RAPTORERROR_VARIANTFILEDOESNOTEXIST = 'variant_file_does_not_exist';
176
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
sub process
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    60
	my ($text, $logfile, $component, $mmp, $phase, $recipe, $file) = @_;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    61
	
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    62
	my $dumped = 1;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    63
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    64
	my $category = $CATEGORY_RAPTORERROR;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    65
	my $severity = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    66
	my $subcategory = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    67
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
	if ($text =~ m,Cannot process schema version .* of file,)
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
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    71
		$subcategory = $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    72
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    73
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
	elsif ($text =~ m,No bld\.inf found at,)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    75
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    76
		$severity = $RaptorCommon::SEVERITY_MAJOR;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    77
		$subcategory = $CATEGORY_RAPTORERROR_NOBLDINFFOUND;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    78
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    80
	elsif ($text =~ m,Can't find mmp file,)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    81
	{
180
314156ec7d7c Can't find mmp file should be severity Major
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    82
		$severity = $RaptorCommon::SEVERITY_MAJOR;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    83
		$subcategory = $CATEGORY_RAPTORERROR_CANTFINDMMPFILE;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    84
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    85
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    86
	elsif ($text =~ m,The make-engine exited with errors,)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    87
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    88
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
		$subcategory = $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    90
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
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
	elsif ($text =~ m,tool .* from config .* did not return version .* as required,)
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
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
		$subcategory = $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
    96
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
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
	elsif ($text =~ m,Unknown build configuration '.*',)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   100
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   101
		$subcategory = $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   102
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
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
	elsif ($text =~ m,No build configurations given,)
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
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
		$subcategory = $CATEGORY_RAPTORERROR_NOBUILDCONFIGSGIVEN;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   108
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
	}
211
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   110
	elsif ($text =~ m,Failed to parse XML file,)
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   111
	{
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   112
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   113
		$subcategory = $CATEGORY_RAPTORERROR_FAILEDTOPARSEXMLFILE;
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   114
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
c01247054e72 Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
   115
	}
216
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   116
	elsif ($text =~ m,Variant file .* does not exist,)
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   117
	{
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   118
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   119
		$subcategory = $CATEGORY_RAPTORERROR_VARIANTFILEDOESNOTEXIST;
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   120
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
907120563fce Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents: 214
diff changeset
   121
	}
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   122
	elsif ($text =~ m,Could not export .* to .* : \[Errno 2\] No such file or directory: .*,)
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   123
	{
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   124
		$severity = $RaptorCommon::SEVERITY_MAJOR;
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   125
		$subcategory = $CATEGORY_RAPTORERROR_COULDNOTEXPORT;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   126
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   127
	}
212
914d8060176c Rename missing_bld_inf_file category to cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents: 211
diff changeset
   128
	elsif ($text =~ m,win32/mingw/bin/cpp\.exe:.*:.*: No such file or directory,)
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   129
	{
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   130
		$severity = $RaptorCommon::SEVERITY_MAJOR;
212
914d8060176c Rename missing_bld_inf_file category to cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents: 211
diff changeset
   131
		$subcategory = $CATEGORY_RAPTORERROR_CPPEXENOSUCHFILEORDIRECTORY;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   132
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   133
	}
212
914d8060176c Rename missing_bld_inf_file category to cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents: 211
diff changeset
   134
	elsif ($text =~ m,^Preprocessor exception: ''Errors in .*'' : in command,)
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   135
	{
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   136
		# don't dump
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   137
		$dumped = 0;
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   138
	}
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   139
	elsif ($text =~ m,Source of export does not exist: .*,)
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   140
	{
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   141
		# don't dump
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   142
		$dumped = 0;
184
978ef35b4e5f Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents: 180
diff changeset
   143
	}
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
	else # log everything by default
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
	{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   146
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
	}
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   148
	
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   149
	return $dumped;
176
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
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
sub on_start_buildlog
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
	RaptorCommon::init();
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
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
sub on_start_buildlog_error
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
{
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   159
  my ($el) = @_;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   160
	
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   161
	#print "on_start_buildlog_error\n";
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   162
	
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   163
	$raptor_error_info = {};
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   164
	
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   165
	my $attributes = $el->{Attributes};
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   166
	for (keys %{$attributes})
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   167
	{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   168
		$raptor_error_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'};
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   169
		#print "$_ -> $attributes->{$_}->{'Value'}\n";
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   170
	}
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
}
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
sub on_chars_buildlog_error
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
	my ($ch) = @_;
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 "on_chars_buildlog_error\n";
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
	$characters .= $ch->{Data};
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
	#print "characters is now -->$characters<--\n";
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
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   184
sub on_end_buildlog_error
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
	#print "on_end_buildlog_error\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
	
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   188
	$characters =~ s,^[\r\n]*,,;
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   189
	$characters =~ s,[\r\n]*$,,;
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   190
	
232
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 230
diff changeset
   191
	#print "error: -->$characters<--\n";
fde18ad07a01 Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents: 230
diff changeset
   192
	
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   193
	my $package = '';
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   194
	# if bldinf attribute is not available then heuristically attempt to determine the package
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   195
	if (!$raptor_error_info->{bldinf} &&
238
09b83ca8e0cf Revert to version 236 as 237 breaks the parser
Dario Sestito <darios@symbian.org>
parents: 237
diff changeset
   196
		$characters =~ m,.*?([/\\]sf[/\\](os|mw|app|tools|ostools|adaptation)[/\\][a-zA-Z]+[/\\]?),s)
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   197
	{
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   198
		$raptor_error_info->{bldinf} = "$1... (guessed)";
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   199
	}
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   200
	
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   201
	if ($raptor_error_info->{bldinf})
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   202
	{
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   203
		$::allbldinfs->{$raptor_error_info->{bldinf}} = 1;
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   204
    
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   205
		# normalize bldinf path
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   206
		$raptor_error_info->{bldinf} = lc($raptor_error_info->{bldinf});
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   207
		$raptor_error_info->{bldinf} =~ s,^[A-Za-z]:,,;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   208
		$raptor_error_info->{bldinf} =~ s,[\\],/,g;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   209
		
238
09b83ca8e0cf Revert to version 236 as 237 breaks the parser
Dario Sestito <darios@symbian.org>
parents: 237
diff changeset
   210
		if ($raptor_error_info->{bldinf} =~ m,/((os|mw|app|tools|ostools|adaptation)/[a-zA-Z]+),)
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   211
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   212
			$package = $1;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   213
			$package =~ s,/,_,;
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   214
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
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: 185
diff changeset
   216
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   217
			print "WARNING: can't understand bldinf attribute of raptor error: $raptor_error_info->{bldinf}. Won't associate to package.\n";
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   218
		}
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   219
	}
176
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
	if ($characters =~ m,[^\s^\r^\n],)
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   222
	{
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   223
		$filename = "$::raptorbitsdir/raptor_error.txt";
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 212
diff changeset
   224
		$filename = "$::raptorbitsdir/$package.txt" if ($package);
214
cf1d34408de3 Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents: 213
diff changeset
   225
		my $filenamewnopath = "raptor_error.txt";
cf1d34408de3 Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents: 213
diff changeset
   226
		$filenamewnopath = "$package.txt" if ($package);
209
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   227
		
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   228
		if (!-f$filename)
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   229
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   230
			print "Writing file $filename\n";
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   231
			open(FILE, ">$filename");
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   232
			close(FILE);
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   233
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   234
		
214
cf1d34408de3 Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents: 213
diff changeset
   235
		my $dumped = process($characters, $::current_log_file, $raptor_error_info->{bldinf}, '', '', '', $filenamewnopath);
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   236
		
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   237
		if ($dumped)
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
		{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   239
			open(FILE, ">>$filename");
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   240
			print FILE "---failure_item_$::failure_item_number\---\n";
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 184
diff changeset
   241
			print FILE "$characters\n\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
			close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
		}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
	$characters = '';
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
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
1;