author | Simon Howkins <simonh@symbian.org> |
Thu, 06 May 2010 12:47:02 +0100 | |
changeset 229 | 3487e8b7ed38 |
parent 217 | 8a3d46cfe8b5 |
child 230 | f593b7acdb37 |
permissions | -rw-r--r-- |
176 | 1 |
# Copyright (c) 2009 Symbian Foundation Ltd |
2 |
# This component and the accompanying materials are made available |
|
3 |
# under the terms of the License "Eclipse Public License v1.0" |
|
4 |
# which accompanies this distribution, and is available |
|
5 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
6 |
# |
|
7 |
# Initial Contributors: |
|
8 |
# Symbian Foundation Ltd - initial contribution. |
|
9 |
# |
|
10 |
# Contributors: |
|
11 |
# |
|
12 |
# Description: |
|
13 |
# Raptor parser module. |
|
14 |
# Extract, analyzes and dumps raptor errors i.e. content of <error> tags from a raptor log file |
|
15 |
||
16 |
package RaptorError; |
|
17 |
||
18 |
use strict; |
|
19 |
use RaptorCommon; |
|
20 |
||
21 |
our $reset_status = {}; |
|
22 |
my $buildlog_status = {}; |
|
23 |
my $buildlog_error_status = {}; |
|
24 |
||
25 |
$reset_status->{name} = 'reset_status'; |
|
26 |
$reset_status->{next_status} = {buildlog=>$buildlog_status}; |
|
27 |
||
28 |
$buildlog_status->{name} = 'buildlog_status'; |
|
29 |
$buildlog_status->{next_status} = {error=>$buildlog_error_status}; |
|
30 |
$buildlog_status->{on_start} = 'RaptorError::on_start_buildlog'; |
|
31 |
||
32 |
$buildlog_error_status->{name} = 'buildlog_error_status'; |
|
33 |
$buildlog_error_status->{next_status} = {}; |
|
34 |
$buildlog_error_status->{on_start} = 'RaptorError::on_start_buildlog_error'; |
|
35 |
$buildlog_error_status->{on_end} = 'RaptorError::on_end_buildlog_error'; |
|
36 |
$buildlog_error_status->{on_chars} = 'RaptorError::on_chars_buildlog_error'; |
|
37 |
||
38 |
my $filename = ''; |
|
39 |
||
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
|
40 |
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
|
41 |
|
176 | 42 |
my $characters = ''; |
43 |
||
44 |
my $CATEGORY_RAPTORERROR = 'raptor_error'; |
|
45 |
my $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION = 'cannot_process_schema_version'; |
|
46 |
my $CATEGORY_RAPTORERROR_NOBLDINFFOUND = 'no_bld_inf_found'; |
|
47 |
my $CATEGORY_RAPTORERROR_CANTFINDMMPFILE = 'cant_find_mmp_file'; |
|
48 |
my $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS = 'make_exited_with_errors'; |
|
49 |
my $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION = 'tool_didnot_return_version'; |
|
50 |
my $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG = 'unknown_build_config'; |
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
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
|
55 |
my $CATEGORY_RAPTORERROR_VARIANTFILEDOESNOTEXIST = 'variant_file_does_not_exist'; |
176 | 56 |
|
57 |
sub process |
|
58 |
{ |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
59 |
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
|
60 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
61 |
my $dumped = 1; |
176 | 62 |
|
63 |
my $category = $CATEGORY_RAPTORERROR; |
|
64 |
my $severity = ''; |
|
65 |
my $subcategory = ''; |
|
66 |
||
67 |
if ($text =~ m,Cannot process schema version .* of file,) |
|
68 |
{ |
|
69 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
|
70 |
$subcategory = $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
71 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 72 |
} |
73 |
elsif ($text =~ m,No bld\.inf found at,) |
|
74 |
{ |
|
75 |
$severity = $RaptorCommon::SEVERITY_MAJOR; |
|
76 |
$subcategory = $CATEGORY_RAPTORERROR_NOBLDINFFOUND; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
77 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 78 |
} |
79 |
elsif ($text =~ m,Can't find mmp file,) |
|
80 |
{ |
|
180
314156ec7d7c
Can't find mmp file should be severity Major
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
81 |
$severity = $RaptorCommon::SEVERITY_MAJOR; |
176 | 82 |
$subcategory = $CATEGORY_RAPTORERROR_CANTFINDMMPFILE; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
83 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 84 |
} |
85 |
elsif ($text =~ m,The make-engine exited with errors,) |
|
86 |
{ |
|
87 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
|
88 |
$subcategory = $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
89 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 90 |
} |
91 |
elsif ($text =~ m,tool .* from config .* did not return version .* as required,) |
|
92 |
{ |
|
93 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
|
94 |
$subcategory = $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
95 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 96 |
} |
97 |
elsif ($text =~ m,Unknown build configuration '.*',) |
|
98 |
{ |
|
99 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
|
100 |
$subcategory = $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
101 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 102 |
} |
103 |
elsif ($text =~ m,No build configurations given,) |
|
104 |
{ |
|
105 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
|
106 |
$subcategory = $CATEGORY_RAPTORERROR_NOBUILDCONFIGSGIVEN; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
107 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 108 |
} |
211
c01247054e72
Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents:
209
diff
changeset
|
109 |
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
|
110 |
{ |
c01247054e72
Add new failed_to_parse_xml_file category for Raptor errors
Dario Sestito <darios@symbian.org>
parents:
209
diff
changeset
|
111 |
$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
|
112 |
$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
|
113 |
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
|
114 |
} |
216
907120563fce
Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents:
214
diff
changeset
|
115 |
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
|
116 |
{ |
907120563fce
Add new variant_file_does_not_exist category for Raptor errors
Dario Sestito <darios@symbian.org>
parents:
214
diff
changeset
|
117 |
$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
|
118 |
$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
|
119 |
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
|
120 |
} |
184
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
121 |
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
|
122 |
{ |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
123 |
$severity = $RaptorCommon::SEVERITY_MAJOR; |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
124 |
$subcategory = $CATEGORY_RAPTORERROR_COULDNOTEXPORT; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
125 |
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
|
126 |
} |
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
|
127 |
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
|
128 |
{ |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
129 |
$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
|
130 |
$subcategory = $CATEGORY_RAPTORERROR_CPPEXENOSUCHFILEORDIRECTORY; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
131 |
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
|
132 |
} |
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
|
133 |
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
|
134 |
{ |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
135 |
# don't dump |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
136 |
$dumped = 0; |
184
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
137 |
} |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
138 |
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
|
139 |
{ |
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
140 |
# don't dump |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
141 |
$dumped = 0; |
184
978ef35b4e5f
Add more categories for unreciped and raptor error failures
Dario Sestito <darios@symbian.org>
parents:
180
diff
changeset
|
142 |
} |
176 | 143 |
else # log everything by default |
144 |
{ |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
145 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file); |
176 | 146 |
} |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
147 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
148 |
return $dumped; |
176 | 149 |
} |
150 |
||
151 |
sub on_start_buildlog |
|
152 |
{ |
|
153 |
RaptorCommon::init(); |
|
154 |
} |
|
155 |
||
156 |
sub on_start_buildlog_error |
|
157 |
{ |
|
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
|
158 |
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
|
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 "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
|
161 |
|
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 |
$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
|
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 |
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
|
165 |
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
|
166 |
{ |
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 |
$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
|
168 |
#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
|
169 |
} |
176 | 170 |
} |
171 |
||
172 |
sub on_chars_buildlog_error |
|
173 |
{ |
|
174 |
my ($ch) = @_; |
|
175 |
||
176 |
#print "on_chars_buildlog_error\n"; |
|
177 |
||
178 |
$characters .= $ch->{Data}; |
|
179 |
||
180 |
#print "characters is now -->$characters<--\n"; |
|
181 |
} |
|
182 |
||
183 |
sub on_end_buildlog_error |
|
184 |
{ |
|
185 |
#print "on_end_buildlog_error\n"; |
|
186 |
||
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
187 |
$characters =~ s,^[\r\n]*,,; |
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 |
|
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
|
190 |
my $package = ''; |
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
191 |
# 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
|
192 |
if (!$raptor_error_info->{bldinf} && |
217
8a3d46cfe8b5
Fix heuristic matches tool path instead of file path
Dario Sestito <darios@symbian.org>
parents:
216
diff
changeset
|
193 |
$characters =~ m,.*?([/\\]sf[/\\](os|mw|app|tools|ostools|adaptation)[/\\][^/^\\]*[/\\]),s) |
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
194 |
{ |
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
195 |
$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
|
196 |
} |
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
197 |
|
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
|
198 |
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
|
199 |
{ |
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
200 |
$::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
|
201 |
|
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
202 |
# 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
|
203 |
$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
|
204 |
$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
|
205 |
$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
|
206 |
|
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 |
if ($raptor_error_info->{bldinf} =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),) |
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 |
{ |
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 |
$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
|
210 |
$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
|
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 |
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
|
213 |
{ |
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 |
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
|
215 |
} |
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
216 |
} |
176 | 217 |
|
218 |
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
|
219 |
{ |
213
0244765a8d6f
Add heuristic determination of package for Raptor errors and warnings
Dario Sestito <darios@symbian.org>
parents:
212
diff
changeset
|
220 |
$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
|
221 |
$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
|
222 |
my $filenamewnopath = "raptor_error.txt"; |
cf1d34408de3
Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents:
213
diff
changeset
|
223 |
$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
|
224 |
|
ba90e30c0f3c
Use the bldinf attribute to assign Raptor errors and warnings to the related package
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
225 |
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
|
226 |
{ |
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 |
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
|
228 |
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
|
229 |
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
|
230 |
} |
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 |
|
214
cf1d34408de3
Add heuristic determination of package for Raptor unreciped text
Dario Sestito <darios@symbian.org>
parents:
213
diff
changeset
|
232 |
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
|
233 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
234 |
if ($dumped) |
176 | 235 |
{ |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
236 |
open(FILE, ">>$filename"); |
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
184
diff
changeset
|
237 |
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
|
238 |
print FILE "$characters\n\n"; |
176 | 239 |
close(FILE); |
240 |
} |
|
241 |
} |
|
242 |
||
243 |
$characters = ''; |
|
244 |
} |
|
245 |
||
246 |
||
247 |
1; |