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