author | William Roberts <williamr@symbian.org> |
Mon, 01 Jun 2009 15:26:59 +0100 | |
changeset 2 | a600c1a596f7 |
child 3 | 8b87ea768cb8 |
permissions | -rw-r--r-- |
2
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
1 |
#! perl |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
2 |
|
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
3 |
# Copyright (c) 2009 Symbian Foundation Ltd |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
4 |
# This component and the accompanying materials are made available |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
5 |
# under the terms of the License "Eclipse Public License v1.0" |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
6 |
# which accompanies this distribution, and is available |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
8 |
# |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
9 |
# Initial Contributors: |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
10 |
# Symbian Foundation Ltd - initial contribution. |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
11 |
# |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
12 |
# Contributors: |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
13 |
# |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
14 |
# Description: |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
15 |
# Filter an SBSv2 log to keep only recipes which match a specified RE |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
16 |
|
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
17 |
use strict; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
18 |
|
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
19 |
my $expression = shift @ARGV; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
20 |
my $line; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
21 |
my $skipping = 1; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
22 |
|
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
23 |
while ($line =<>) |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
24 |
{ |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
25 |
if (substr($line,0,9) eq "</recipe>") |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
26 |
{ |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
27 |
print $line if ($skipping == 0); |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
28 |
$skipping = 1; # set this to 0 to get the "between recipes" stuff |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
29 |
next; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
30 |
} |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
31 |
if (substr($line,0,8) eq "<recipe ") |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
32 |
{ |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
33 |
if ($line =~ /$expression/io) |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
34 |
{ |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
35 |
$skipping = 0; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
36 |
} |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
37 |
else |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
38 |
{ |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
39 |
$skipping = 1; |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
40 |
} |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
41 |
} |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
42 |
print $line if ($skipping == 0); |
a600c1a596f7
Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff
changeset
|
43 |
} |