uh_parser/RaptorWarning.pm
author Shabe Razvi <shaber@symbian.org>
Tue, 11 May 2010 13:39:54 +0100
changeset 237 dfa3d8557c61
parent 236 08436a227940
child 238 09b83ca8e0cf
permissions -rw-r--r--
Update uh_parser to understand sftools/dev packages
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: 230
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 warnings i.e. content of <warning> 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 RaptorWarning;
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_warning_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} = {warning=>$buildlog_warning_status};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
$buildlog_status->{on_start} = 'RaptorWarning::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_warning_status->{name} = 'buildlog_warning_status';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
$buildlog_warning_status->{next_status} = {};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
$buildlog_warning_status->{on_start} = 'RaptorWarning::on_start_buildlog_warning';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
$buildlog_warning_status->{on_end} = 'RaptorWarning::on_end_buildlog_warning';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
$buildlog_warning_status->{on_chars} = 'RaptorWarning::on_chars_buildlog_warning';
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_warning_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_RAPTORWARNING = 'raptor_warning';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
my $CATEGORY_RAPTORWARNING_MISSINGFLAGABIV2 = 'missing_enable_abiv2_mode';
182
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    47
my $CATEGORY_RAPTORWARNING_WHILESEARCHINGFORDEFFILEFILENOTFOUND = 'while_searching_for_deffile_file_not_found';
210
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    48
my $CATEGORY_RAPTORWARNING_EXPORTUNFROZENPRESENT = 'exportunfrozen_present';
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    49
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    50
sub process
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    52
	my ($text, $logfile, $component, $mmp, $phase, $recipe, $file) = @_;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    53
	
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    54
	my $dumped = 1;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    56
	my $category = $CATEGORY_RAPTORWARNING;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    57
	my $severity = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    58
	my $subcategory = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
	if ($text =~ m,missing flag ENABLE_ABIV2_MODE,)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
		$severity = $RaptorCommon::SEVERITY_MINOR;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    63
		my $subcategory = $CATEGORY_RAPTORWARNING_MISSINGFLAGABIV2;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    64
		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
    65
	}
182
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    66
	elsif ($text =~ m,While Searching for a SPECIFIED DEFFILE: file not found: .*,)
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    67
	{
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    68
		$severity = $RaptorCommon::SEVERITY_MINOR;
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    69
		my $subcategory = $CATEGORY_RAPTORWARNING_WHILESEARCHINGFORDEFFILEFILENOTFOUND;
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    70
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
182
20288e22722e Add while_searching_for_deffile_file_not_found category for warning failures
Dario Sestito <darios@symbian.org>
parents: 176
diff changeset
    71
	}
210
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    72
	elsif ($text =~ m,EXPORTUNFROZEN present in .*,)
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    73
	{
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    74
		$severity = $RaptorCommon::SEVERITY_MAJOR;
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    75
		my $subcategory = $CATEGORY_RAPTORWARNING_EXPORTUNFROZENPRESENT;
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    76
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
6669177dab54 Add new exportunfrozen_present category for Raptor warnings
Dario Sestito <darios@symbian.org>
parents: 209
diff changeset
    77
	}
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    78
	else # log everything by default
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
	{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    80
		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
    81
	}
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    82
	
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
    83
	return $dumped;
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    84
}
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
sub on_start_buildlog
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
	RaptorCommon::init();
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
}
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
    90
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
sub on_start_buildlog_warning
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    92
{
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
    93
	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
    94
	
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    95
	$raptor_warning_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
    96
	
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
    97
	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
    98
	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
    99
	{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   100
		$raptor_warning_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
   101
		#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
   102
	}
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
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
sub on_chars_buildlog_warning
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
	my ($ch) = @_;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
	#print "on_chars_buildlog_warning\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   110
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
	$characters .= $ch->{Data};
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
	#print "characters is now -->$characters<--\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   116
sub on_end_buildlog_warning
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   117
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
	#print "on_end_buildlog_warning\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
	
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   120
	$characters =~ s,^[\r\n]*,,;
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   121
	$characters =~ s,[\r\n]*$,,;
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   122
	
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
   123
	my $package = '';
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   124
	# 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: 210
diff changeset
   125
	if (!$raptor_warning_info->{bldinf} &&
237
dfa3d8557c61 Update uh_parser to understand sftools/dev packages
Shabe Razvi <shaber@symbian.org>
parents: 236
diff changeset
   126
		$characters =~ m,.*?([/\\]sf|sftools[/\\](os|mw|app|tools|ostools|adaptation|dev)[/\\][a-zA-Z]+[/\\]?),s)
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   127
	{
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   128
		$raptor_warning_info->{bldinf} = "$1... (guessed)";
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   129
	}
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   130
	
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
   131
	if ($raptor_warning_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
   132
	{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   133
		$::allbldinfs->{$raptor_warning_info->{bldinf}} = 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
   134
		
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   135
		# normalize bldinf path
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   136
		$raptor_warning_info->{bldinf} = lc($raptor_warning_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
   137
		$raptor_warning_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
   138
		$raptor_warning_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
   139
		
237
dfa3d8557c61 Update uh_parser to understand sftools/dev packages
Shabe Razvi <shaber@symbian.org>
parents: 236
diff changeset
   140
		if ($raptor_warning_info->{bldinf} =~ m,/((os|mw|app|tools|ostools|adaptation|dev)/[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
   141
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   142
			$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
   143
			$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
   144
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   145
		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
   146
		{
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   147
			print "WARNING: can't understand bldinf attribute of raptor warning: $raptor_warning_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
   148
		}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   149
	}
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   150
	
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
	if ($characters =~ m,[^\s^\r^\n],)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
	{
213
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   153
		$filename = "$::raptorbitsdir/raptor_warning.txt";
0244765a8d6f Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents: 210
diff changeset
   154
		$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
   155
		my $filenamewnopath = "raptor_warning.txt";
cf1d34408de3 Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents: 213
diff changeset
   156
		$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
   157
		
ba90e30c0f3c Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents: 185
diff changeset
   158
		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
   159
		{
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
			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
   161
			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
   162
			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
   163
		}
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
		
214
cf1d34408de3 Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents: 213
diff changeset
   165
		my $dumped = process($characters, $::current_log_file, $raptor_warning_info->{bldinf}, '', '', '', $filenamewnopath);
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
   166
		
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
   167
		if ($dumped)
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
		{
185
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
   169
			open(FILE, ">>$filename");
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
   170
			print FILE "---failure_item_$::failure_item_number\---\n";
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 182
diff changeset
   171
			print FILE "$characters\n\n";
176
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   172
			close(FILE);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   173
		}
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
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
	$characters = '';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
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
1;