author | Dario Sestito <darios@symbian.org> |
Wed, 16 Jun 2010 11:44:46 +0100 | |
changeset 287 | 598059d917c3 |
parent 258 | 08436a227940 |
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:
254
diff
changeset
|
11 |
# Dario Sestito <darios@symbian.org> |
177 | 12 |
# |
13 |
# Description: |
|
14 |
# Raptor parser module. |
|
15 |
# Extract, analyzes and dumps raptor info text i.e. content of <info> tags from a raptor log file |
|
16 |
||
17 |
package RaptorInfo; |
|
18 |
||
19 |
use strict; |
|
20 |
use RaptorCommon; |
|
21 |
||
22 |
our $reset_status = {}; |
|
23 |
my $buildlog_status = {}; |
|
24 |
my $buildlog_info_status = {}; |
|
25 |
||
26 |
$reset_status->{name} = 'reset_status'; |
|
27 |
$reset_status->{next_status} = {buildlog=>$buildlog_status}; |
|
28 |
||
29 |
$buildlog_status->{name} = 'buildlog_status'; |
|
30 |
$buildlog_status->{next_status} = {info=>$buildlog_info_status}; |
|
31 |
||
32 |
$buildlog_info_status->{name} = 'buildlog_info_status'; |
|
33 |
$buildlog_info_status->{next_status} = {}; |
|
34 |
$buildlog_info_status->{on_start} = 'RaptorInfo::on_start_buildlog_info'; |
|
35 |
$buildlog_info_status->{on_end} = 'RaptorInfo::on_end_buildlog_info'; |
|
36 |
$buildlog_info_status->{on_chars} = 'RaptorInfo::on_chars_buildlog_info'; |
|
37 |
||
38 |
my $characters = ''; |
|
39 |
||
40 |
my $category = $RaptorCommon::CATEGORY_RAPTORINFO; |
|
41 |
||
42 |
sub process |
|
43 |
{ |
|
44 |
my ($text) = @_; |
|
45 |
||
254
fde18ad07a01
Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents:
177
diff
changeset
|
46 |
if ($text =~ m,Buildable configuration '(.*)',) |
177 | 47 |
{ |
254
fde18ad07a01
Add parsed logs and built configs at the top of the main page
Dario Sestito <darios@symbian.org>
parents:
177
diff
changeset
|
48 |
$::allconfigs->{$1}=1; |
177 | 49 |
} |
50 |
} |
|
51 |
||
52 |
sub on_start_buildlog_info |
|
53 |
{ |
|
54 |
my $filename = "$::raptorbitsdir/info.txt"; |
|
55 |
print "Writing info file $filename\n" if (!-f$filename); |
|
56 |
open(FILE, ">>$filename"); |
|
57 |
} |
|
58 |
||
59 |
sub on_chars_buildlog_info |
|
60 |
{ |
|
61 |
my ($ch) = @_; |
|
62 |
||
63 |
#print "on_chars_buildlog_info\n"; |
|
64 |
||
65 |
$characters .= $ch->{Data}; |
|
66 |
||
67 |
#print "characters is now -->$characters<--\n"; |
|
68 |
} |
|
69 |
||
70 |
sub on_end_buildlog_info |
|
71 |
{ |
|
72 |
#print "on_end_buildlog_info\n"; |
|
73 |
||
74 |
process($characters); |
|
75 |
||
76 |
print FILE $characters if ($characters =~ m,[^\s^\r^\n],); |
|
77 |
print FILE "\n" if ($characters !~ m,[\r\n]$, ); |
|
78 |
||
79 |
$characters = ''; |
|
80 |
||
81 |
close(FILE); |
|
82 |
} |
|
83 |
||
84 |
||
85 |
1; |