common/tools/raptor/releaseables.pm
author Simon Howkins <simonh@symbian.org>
Fri, 04 Dec 2009 11:00:13 +0000
changeset 806 d6151ad46381
parent 791 9054e820b1e6
permissions -rw-r--r--
Updated framework for packaging SDK headers so the contents to zip can be set by a project property (or it can zip everything together if it's not set).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
# Raptor parser module.
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
# Extract releaseable (whatlog) information
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
package releaseables;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
use strict;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
our $reset_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
my $buildlog_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
my $whatlog_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
my $bitmap_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
my $resource_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
my $build_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
my $export_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
my $stringtable_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
my $archive_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
my $archive_member_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
my $whatlog_default_status = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
$reset_status->{name} = 'reset_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
$reset_status->{next_status} = {buildlog=>$buildlog_status};
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
$buildlog_status->{name} = 'buildlog_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
$buildlog_status->{next_status} = {whatlog=>$whatlog_status};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
$buildlog_status->{on_start} = 'releaseables::on_start_buildlog';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
$whatlog_status->{name} = 'whatlog_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    40
$whatlog_status->{next_status} = {bitmap=>$bitmap_status, resource=>$resource_status, build=>$build_status, export=>$export_status, stringtable=>$stringtable_status, archive=>$archive_status, '?default?'=>$whatlog_default_status};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
$whatlog_status->{on_start} = 'releaseables::on_start_whatlog';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
$whatlog_status->{on_end} = 'releaseables::on_end_whatlog';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    44
$bitmap_status->{name} = 'bitmap_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    45
$bitmap_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
$bitmap_status->{on_start} = 'releaseables::on_start_bitmap';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
$bitmap_status->{on_end} = 'releaseables::on_end_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
$bitmap_status->{on_chars} = 'releaseables::on_chars_whatlog_subtag';
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
$resource_status->{name} = 'resource_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
$resource_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
$resource_status->{on_start} = 'releaseables::on_start_resource';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    53
$resource_status->{on_end} = 'releaseables::on_end_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    54
$resource_status->{on_chars} = 'releaseables::on_chars_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    56
$build_status->{name} = 'build_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    57
$build_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    58
$build_status->{on_start} = 'releaseables::on_start_build';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
$build_status->{on_end} = 'releaseables::on_end_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
$build_status->{on_chars} = 'releaseables::on_chars_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
$stringtable_status->{name} = 'stringtable_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    63
$stringtable_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    64
$stringtable_status->{on_start} = 'releaseables::on_start_stringtable';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    65
$stringtable_status->{on_end} = 'releaseables::on_end_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    66
$stringtable_status->{on_chars} = 'releaseables::on_chars_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    67
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
$archive_status->{name} = 'archive_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    69
$archive_status->{next_status} = {member=>$archive_member_status};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    70
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    71
$archive_member_status->{name} = 'archive_member_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    72
$archive_member_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    73
$archive_member_status->{on_start} = 'releaseables::on_start_archive_member';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
$archive_member_status->{on_end} = 'releaseables::on_end_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    75
$archive_member_status->{on_chars} = 'releaseables::on_chars_whatlog_subtag';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    76
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    77
$export_status->{name} = 'export_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    78
$export_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
$export_status->{on_start} = 'releaseables::on_start_export';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    80
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    81
$whatlog_default_status->{name} = 'whatlog_default_status';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    82
$whatlog_default_status->{next_status} = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    83
$whatlog_default_status->{on_start} = 'releaseables::on_start_whatlog_default';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    84
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    85
my $whatlog_info = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    86
my $curbldinf = 'unknown';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    87
my $curconfig = 'unknown';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    88
my $curfiletype = 'unknown';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
my $characters = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    90
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
sub on_start_buildlog
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    92
{
791
9054e820b1e6 Fix releaseables are missing. Fix stray call to summarize.pl
Dario Sestito <darios@symbian.org>
parents: 764
diff changeset
    93
	
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    94
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    96
sub on_start_whatlog
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    97
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    98
	my ($el) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   100
	$whatlog_info = {};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   101
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   102
	my $bldinf = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   103
	my $config = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   104
	my $attributes = $el->{Attributes};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
	for (keys %{$attributes})
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
		#print "reading attribute $_\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
		if ($attributes->{$_}->{'LocalName'} eq 'bldinf')
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
		{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   110
			$bldinf = $attributes->{$_}->{'Value'};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
			#print "bldinf=$bldinf\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
		}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
		elsif ($attributes->{$_}->{'LocalName'} eq 'config')
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
		{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
			$config = $attributes->{$_}->{'Value'};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   116
			$config =~ s,\.whatlog$,,;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   117
		}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   120
	if ($bldinf eq '')
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
		print "WARNING: whatlog tag with no bldinf attribute. Skipping\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
		return;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
	$curbldinf = $bldinf;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
	$curconfig = $config;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   128
	$whatlog_info->{$curbldinf} = {} if (!defined $whatlog_info->{$curbldinf});
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   129
	$whatlog_info->{$curbldinf}->{$curconfig} = {} if (!defined $whatlog_info->{$curbldinf}->{$curconfig});
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   130
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   131
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
sub on_start_whatlog_subtag
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
	my ($ft) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
	$curfiletype = $ft;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
	$characters = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
	$whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype} = [] if (! defined $whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype});
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   140
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   141
sub on_chars_whatlog_subtag
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   142
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   143
	my ($ch) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
	$characters .= $ch->{Data};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   146
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
	#print "characters is now -->$characters<--\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   148
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   149
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   150
sub on_end_whatlog_subtag
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
	$characters = normalize_filepath($characters);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
	push(@{$whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype}}, $characters);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   155
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   156
	$curfiletype = 'unknown';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
	$characters = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   159
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   160
sub on_start_bitmap
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   161
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   162
	on_start_whatlog_subtag('bitmap');
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   163
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   164
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
sub on_start_resource
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
	on_start_whatlog_subtag('resource');
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
sub on_start_build
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   172
	on_start_whatlog_subtag('build');
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   173
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   174
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   175
sub on_start_stringtable
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
	on_start_whatlog_subtag('stringtable');
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   179
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   180
sub on_start_archive_member
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   181
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   182
	on_start_whatlog_subtag('export');
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   183
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   184
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   185
sub on_start_export
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   186
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
	my ($el) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   188
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   189
	$whatlog_info->{$curbldinf}->{$curconfig}->{export} = [] if (! defined $whatlog_info->{$curbldinf}->{$curconfig}->{export});
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   190
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   191
	my $destination = '';
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   192
	my $attributes = $el->{Attributes};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   193
	for (keys %{$attributes})
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   194
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   195
		#print "reading attribute $_\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   196
		if ($attributes->{$_}->{'LocalName'} eq 'destination')
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   197
		{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
			$destination = $attributes->{$_}->{'Value'};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   199
			#print "destination=$destination\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   200
			last;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   201
		}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   202
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   203
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   204
	if ($destination eq '')
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   205
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   206
		print "WARNING: export tag with no destination attribute. Skipping\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   207
		return;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   208
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   209
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   210
	$destination = normalize_filepath($destination);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   211
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   212
	push(@{$whatlog_info->{$curbldinf}->{$curconfig}->{export}}, $destination);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   213
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   214
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   215
sub on_end_whatlog
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   216
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   217
	my $unknown_counter = 0;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   218
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   219
	for my $bldinf (keys %{$whatlog_info})
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   220
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   221
		for my $config (keys %{$whatlog_info->{$bldinf}})
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   222
		{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   223
			my $normalized = lc($bldinf);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   224
			$normalized =~ s,^[A-Za-z]:,,;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   225
			$normalized =~ s,[\\],/,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   226
			
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   227
			$normalized =~ m,^/sf/([^/]+)/([^/]+)/,;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
			my $layer = $1;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
			my $package = $2;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
			
791
9054e820b1e6 Fix releaseables are missing. Fix stray call to summarize.pl
Dario Sestito <darios@symbian.org>
parents: 764
diff changeset
   231
			mkdir("$::basedir/releaseables/$layer");
9054e820b1e6 Fix releaseables are missing. Fix stray call to summarize.pl
Dario Sestito <darios@symbian.org>
parents: 764
diff changeset
   232
			mkdir("$::basedir/releaseables/$layer/$package");
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
			
791
9054e820b1e6 Fix releaseables are missing. Fix stray call to summarize.pl
Dario Sestito <darios@symbian.org>
parents: 764
diff changeset
   234
			my $filename = "$::basedir/releaseables/$layer/$package/info.tsv";
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
			
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
			print "Writing info file $filename\n" if (!-f$filename);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   237
			open(FILE, ">>$filename");
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
			
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   239
			for my $filetype (keys %{$whatlog_info->{$bldinf}->{$config}})
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   240
			{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   241
				for (sort(@{$whatlog_info->{$bldinf}->{$config}->{$filetype}}))
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
				{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
					print FILE "$_\t$filetype\t$config\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
				}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
			}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
			
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   247
			close(FILE);
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   248
		}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   249
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   250
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   252
sub normalize_filepath
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   253
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   254
	my ($filepath) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   255
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   256
	if ($filepath =~ m,[^\s^\r^\n]+(.*)[\r\n]+(.*)[^\s^\r^\n]+,)
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   257
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   258
		print "WARNING: file path string extends over multiple line: $filepath. Removing all NL's and CR's\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   259
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   260
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
	# strip all CR's and NL's
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
	$filepath =~ s,[\r\n],,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
	# strip all whitespaces at string start/end
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
	$filepath =~ s,^\s+,,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
	$filepath =~ s,\s+$,,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   267
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   268
	# remove drive letter and colon from the beginning of the string
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
	$filepath =~ s,^[A-Za-z]:,,;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   270
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
	# normalize slashes
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   272
	$filepath =~ s,\\,/,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   273
	$filepath =~ s,//,/,g;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   274
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   275
	if ($filepath !~ m,^/epoc32/,i)
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   276
	{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
		print "WARNING: file '$filepath' doesn't seem valid. Writing to info file anyway\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
	}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   280
	return $filepath;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   281
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   282
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
sub on_start_whatlog_default
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   284
{
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   285
	my ($el) = @_;
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   286
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
	my $tagname = $el->{LocalName};
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
	
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   289
	print "WARNING: unsupported tag '$tagname' in <whatlog> context\n";
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   290
}
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   291
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   292
1;