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