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