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