author | Maciej Seroka <maciejs@symbian.org> |
Fri, 20 Nov 2009 13:04:41 +0000 | |
changeset 783 | b740d5b2ce61 |
parent 764 | d00048f1b036 |
child 791 | 9054e820b1e6 |
permissions | -rw-r--r-- |
764
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
1 |
# Copyright (c) 2009 Symbian Foundation Ltd |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
2 |
# This component and the accompanying materials are made available |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
3 |
# under the terms of the License "Eclipse Public License v1.0" |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
4 |
# which accompanies this distribution, and is available |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
5 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
6 |
# |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
7 |
# Initial Contributors: |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
8 |
# Symbian Foundation Ltd - initial contribution. |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
9 |
# |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
10 |
# Contributors: |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
11 |
# |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
12 |
# Description: |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
13 |
# Extract releaseable (whatlog) information from Raptor log files |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
14 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
15 |
use strict; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
16 |
use releaseables; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
17 |
use FindBin; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
18 |
use lib $FindBin::Bin; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
19 |
use XML::SAX; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
20 |
use RaptorSAXHandler; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
21 |
use Getopt::Long; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
22 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
23 |
our $basedir = '.'; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
24 |
my $help = 0; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
25 |
GetOptions(( |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
26 |
'basedir=s' => \$basedir, |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
27 |
'help!' => \$help |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
28 |
)); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
29 |
my @logfiles = @ARGV; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
30 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
31 |
$help = 1 if (!@logfiles); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
32 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
33 |
if ($help) |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
34 |
{ |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
35 |
print "Extract releaseable (whatlog) information from Raptor log files\n"; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
36 |
print "Usage: perl releaseables.pl [OPTIONS] FILE1 FILE2 ...\n"; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
37 |
print "where OPTIONS are:\n"; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
38 |
print "\t--basedir=DIR Generate output under DIR (defaults to current dir)\n"; |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
39 |
exit(0); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
40 |
} |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
41 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
42 |
my $saxhandler = RaptorSAXHandler->new(); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
43 |
$saxhandler->add_observer('releaseables', $releaseables::reset_status); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
44 |
|
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
45 |
my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
46 |
for (@logfiles) |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
47 |
{ |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
48 |
$parser->parse_uri($_); |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
49 |
} |
d00048f1b036
Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
50 |