common/tools/raptor/releaseables.pl
changeset 764 d00048f1b036
child 791 9054e820b1e6
equal deleted inserted replaced
763:5fdd5e70280d 764:d00048f1b036
       
     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:
       
    11 #
       
    12 # Description:
       
    13 # Extract releaseable (whatlog) information from Raptor log files
       
    14 
       
    15 use strict;
       
    16 use releaseables;
       
    17 use FindBin;
       
    18 use lib $FindBin::Bin;
       
    19 use XML::SAX;
       
    20 use RaptorSAXHandler;
       
    21 use Getopt::Long;
       
    22 
       
    23 our $basedir = '.';
       
    24 my $help = 0;
       
    25 GetOptions((
       
    26 	'basedir=s' => \$basedir,
       
    27 	'help!' => \$help
       
    28 ));
       
    29 my @logfiles = @ARGV;
       
    30 
       
    31 $help = 1 if (!@logfiles);
       
    32 
       
    33 if ($help)
       
    34 {
       
    35 	print "Extract releaseable (whatlog) information from Raptor log files\n";
       
    36 	print "Usage: perl releaseables.pl [OPTIONS] FILE1 FILE2 ...\n";
       
    37 	print "where OPTIONS are:\n";
       
    38 	print "\t--basedir=DIR Generate output under DIR (defaults to current dir)\n";
       
    39 	exit(0);
       
    40 }
       
    41 
       
    42 my $saxhandler = RaptorSAXHandler->new();
       
    43 $saxhandler->add_observer('releaseables', $releaseables::reset_status);
       
    44 
       
    45 my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler);
       
    46 for (@logfiles)
       
    47 {
       
    48 	$parser->parse_uri($_);
       
    49 }
       
    50