equal
deleted
inserted
replaced
|
1 #! perl |
|
2 |
|
3 # Copyright (c) 2009 Symbian Foundation Ltd |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Symbian Foundation Ltd - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # Filter an SBSv2 log to keep only status lines, with added target and recipe names |
|
16 |
|
17 use strict; |
|
18 |
|
19 my $line; |
|
20 my $current_target = ""; |
|
21 my $recipe_name = ""; |
|
22 |
|
23 @ARGV = map {glob} @ARGV; |
|
24 |
|
25 while ($line =<>) |
|
26 { |
|
27 my $prefix = substr($line,0,8); |
|
28 if ($prefix eq "<recipe ") |
|
29 { |
|
30 $current_target = ""; |
|
31 if ($line =~ /(name='[^']+').*(target='[^']+')/) |
|
32 { |
|
33 $recipe_name = $1; |
|
34 $current_target = $2; |
|
35 } |
|
36 next; |
|
37 } |
|
38 if ($prefix eq "+ EXTMAK") |
|
39 { |
|
40 if ($line =~ / (EXTMAKEFILENAME=.*)$/) |
|
41 { |
|
42 $current_target = "comment='$1'"; # target for EXTMAKEFILE is not interesting |
|
43 } |
|
44 next; |
|
45 } |
|
46 if ($prefix eq "+ TEMPLA") |
|
47 { |
|
48 if ($line =~ / (TEMPLATE_EXTENSION_MAKEFILE=.*)$/) |
|
49 { |
|
50 $current_target = "comment='$1'"; # target for templated extensions is not interesting |
|
51 } |
|
52 next; |
|
53 } |
|
54 if ($prefix eq "<status ") |
|
55 { |
|
56 substr($line,-3) = "$recipe_name $current_target />\n"; |
|
57 print $line; |
|
58 next; |
|
59 } |
|
60 } |