author | Dario Sestito <darios@symbian.org> |
Wed, 16 Jun 2010 11:44:46 +0100 | |
changeset 287 | 598059d917c3 |
parent 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: |
|
258
08436a227940
Add author information. Reviewed descriptions
Dario Sestito <darios@symbian.org>
parents:
177
diff
changeset
|
11 |
# Dario Sestito <darios@symbian.org> |
177 | 12 |
# |
13 |
# Description: |
|
14 |
# Extract releaseable (whatlog) information from Raptor log files |
|
15 |
||
16 |
use strict; |
|
17 |
use releaseables; |
|
18 |
use FindBin; |
|
19 |
use lib $FindBin::Bin; |
|
20 |
use XML::SAX; |
|
21 |
use RaptorSAXHandler; |
|
22 |
use Getopt::Long; |
|
23 |
||
24 |
our $basedir = '.'; |
|
25 |
my $help = 0; |
|
26 |
GetOptions(( |
|
27 |
'basedir=s' => \$basedir, |
|
28 |
'help!' => \$help |
|
29 |
)); |
|
30 |
my @logfiles = @ARGV; |
|
31 |
||
32 |
$help = 1 if (!@logfiles); |
|
33 |
||
34 |
if ($help) |
|
35 |
{ |
|
36 |
print "Extract releaseable (whatlog) information from Raptor log files\n"; |
|
37 |
print "Usage: perl releaseables.pl [OPTIONS] FILE1 FILE2 ...\n"; |
|
38 |
print "where OPTIONS are:\n"; |
|
39 |
print "\t--basedir=DIR Generate output under DIR (defaults to current dir)\n"; |
|
40 |
exit(0); |
|
41 |
} |
|
42 |
||
43 |
my $releaseablesdir = "$::basedir/releaseables"; |
|
44 |
$releaseablesdir =~ s,/,\\,g; # this is because rmdir doens't cope correctly with the forward slashes |
|
45 |
system("rmdir /S /Q $releaseablesdir") if (-d "$releaseablesdir"); |
|
46 |
mkdir("$releaseablesdir"); |
|
47 |
||
48 |
my $saxhandler = RaptorSAXHandler->new(); |
|
49 |
$saxhandler->add_observer('releaseables', $releaseables::reset_status); |
|
50 |
||
51 |
my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler); |
|
52 |
for (@logfiles) |
|
53 |
{ |
|
54 |
$parser->parse_uri($_); |
|
55 |
} |
|
56 |