common/tools/raptor/package_what.pl
author Dario Sestito <darios@symbian.org>
Tue, 30 Jun 2009 13:58:29 +0100
changeset 222 1d9c60a4e308
permissions -rw-r--r--
Adding extraction of whatlog information into "deliverables" files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
222
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
#
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
#
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
# Contributors:
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    11
#
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
# Description:
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
# Extracts whatlog information from a raptor log file
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
use strict;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
use XML::SAX;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
use RaptorSAXHandler;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
use Getopt::Long;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
my @logfiles;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
my $basedir = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
my $append = 0;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
my $help = 0;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
GetOptions((
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
	'log:s' => \@logfiles,
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
	'basedir:s' => \$basedir,
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
	'append!' => \$append,
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
	'help!' => \$help
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
));
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
$help = 1 if (!@logfiles);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
if ($help)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
	print "Extracts whatlog information from a raptor log file\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
	print "Usage: perl package_what.pl --log=FILE1 --log=FILE2 [OPTIONS]\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
	print "where OPTIONS are:\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
	print "\t--basedir=DIR Generate info files under DIR\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    40
	print "\t--append Do not stop if basedir exists but append newly extracted info to already existing.\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
	exit(0);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    44
my $reset_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    45
my $buildlog_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
my $whatlog_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
my $bitmap_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
my $resource_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    49
my $build_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    50
my $export_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
my $stringtable_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
my $archive_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    53
my $archive_member_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    54
my $whatlog_default_status = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    56
$reset_status->{name} = 'reset_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    57
$reset_status->{next_status} = {buildlog=>$buildlog_status};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    58
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
$buildlog_status->{name} = 'buildlog_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
$buildlog_status->{next_status} = {whatlog=>$whatlog_status};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
$whatlog_status->{name} = 'whatlog_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    63
$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};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    64
$whatlog_status->{on_start} = 'main::on_start_whatlog';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    65
$whatlog_status->{on_end} = 'main::on_end_whatlog';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    66
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    67
$bitmap_status->{name} = 'bitmap_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
$bitmap_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    69
$bitmap_status->{on_start} = 'main::on_start_bitmap';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    70
$bitmap_status->{on_end} = 'main::on_end_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    71
$bitmap_status->{on_chars} = 'main::on_chars_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    72
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    73
$resource_status->{name} = 'resource_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
$resource_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    75
$resource_status->{on_start} = 'main::on_start_resource';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    76
$resource_status->{on_end} = 'main::on_end_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    77
$resource_status->{on_chars} = 'main::on_chars_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    78
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
$build_status->{name} = 'build_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    80
$build_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    81
$build_status->{on_start} = 'main::on_start_build';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    82
$build_status->{on_end} = 'main::on_end_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    83
$build_status->{on_chars} = 'main::on_chars_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    84
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    85
$stringtable_status->{name} = 'stringtable_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    86
$stringtable_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    87
$stringtable_status->{on_start} = 'main::on_start_stringtable';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    88
$stringtable_status->{on_end} = 'main::on_end_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
$stringtable_status->{on_chars} = 'main::on_chars_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    90
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
$archive_status->{name} = 'archive_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    92
$archive_status->{next_status} = {member=>$archive_member_status};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    93
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    94
$archive_member_status->{name} = 'archive_member_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
$archive_member_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    96
$archive_member_status->{on_start} = 'main::on_start_archive_member';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    97
$archive_member_status->{on_end} = 'main::on_end_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    98
$archive_member_status->{on_chars} = 'main::on_chars_whatlog_subtag';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   100
$export_status->{name} = 'export_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   101
$export_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   102
$export_status->{on_start} = 'main::on_start_export';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   103
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   104
$whatlog_default_status->{name} = 'whatlog_default_status';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
$whatlog_default_status->{next_status} = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
$whatlog_default_status->{on_start} = 'main::on_start_whatlog_default';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
my $whatlog_info = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
my $curbldinf = 'unknown';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   110
my $curconfig = 'unknown';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
my $curfiletype = 'unknown';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
my $characters = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
if (!$basedir)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   116
	$basedir = time;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   117
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
	print "Using $basedir as basedir.\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   120
if (-d $basedir)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
	if ($append)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
		print "Directory $basedir exists. Appending new info to it.\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
	else
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   128
		print "Directory $basedir exists. Quitting.\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   129
		exit(1);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   130
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   131
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
mkdir($basedir);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
#print "Created dir $basedir.\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
my $saxhandler = RaptorSAXHandler->new();
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
$saxhandler->set_init_status($reset_status);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
my $parser = XML::SAX::ParserFactory->parser(Handler=>$saxhandler);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
for (@logfiles)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   140
	$parser->parse_uri($_);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   141
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   142
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   143
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
sub on_start_whatlog
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   146
	my ($el) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   148
	#print "on_start_whatlog\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   149
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   150
	$whatlog_info = {};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
	my $bldinf = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
	my $config = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
	my $attributes = $el->{Attributes};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   155
	for (keys %{$attributes})
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   156
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
		#print "reading attribute $_\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
		if ($attributes->{$_}->{'LocalName'} eq 'bldinf')
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   159
		{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   160
			$bldinf = $attributes->{$_}->{'Value'};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   161
			#print "bldinf=$bldinf\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   162
		}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   163
		elsif ($attributes->{$_}->{'LocalName'} eq 'config')
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   164
		{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
			$config = $attributes->{$_}->{'Value'};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
			$config =~ s,\.whatlog$,,;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
		}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
	if ($bldinf eq '')
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   172
		print "WARNING: whatlog tag with no bldinf attribute. Skipping\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   173
		return;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   174
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   175
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
	$curbldinf = $bldinf;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
	$curconfig = $config;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
	$whatlog_info->{$curbldinf} = {} if (!defined $whatlog_info->{$curbldinf});
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   179
	$whatlog_info->{$curbldinf}->{$curconfig} = {} if (!defined $whatlog_info->{$curbldinf}->{$curconfig});
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   180
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   181
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   182
sub on_start_whatlog_subtag
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   183
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   184
	my ($ft) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   185
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   186
	$curfiletype = $ft;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
	$characters = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   188
	$whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype} = [] if (! defined $whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype});
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   189
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   190
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   191
sub on_chars_whatlog_subtag
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   192
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   193
	my ($ch) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   194
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   195
	$characters .= $ch->{Data};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   196
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   197
	#print "characters is now -->$characters<--\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   199
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   200
sub on_end_whatlog_subtag
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   201
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   202
	$characters = normalize_filepath($characters);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   203
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   204
	push(@{$whatlog_info->{$curbldinf}->{$curconfig}->{$curfiletype}}, $characters);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   205
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   206
	$curfiletype = 'unknown';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   207
	$characters = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   208
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   209
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   210
sub on_start_bitmap
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   211
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   212
	on_start_whatlog_subtag('bitmap');
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   213
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   214
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   215
sub on_start_resource
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   216
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   217
	on_start_whatlog_subtag('resource');
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   218
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   219
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   220
sub on_start_build
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   221
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   222
	on_start_whatlog_subtag('build');
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   223
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   224
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   225
sub on_start_stringtable
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   226
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   227
	on_start_whatlog_subtag('stringtable');
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
sub on_start_archive_member
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   231
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   232
	on_start_whatlog_subtag('export');
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   234
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
sub on_start_export
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   237
	my ($el) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   239
	$whatlog_info->{$curbldinf}->{$curconfig}->{export} = [] if (! defined $whatlog_info->{$curbldinf}->{$curconfig}->{export});
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   240
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   241
	my $destination = '';
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
	my $attributes = $el->{Attributes};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
	for (keys %{$attributes})
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
		#print "reading attribute $_\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
		if ($attributes->{$_}->{'LocalName'} eq 'destination')
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   247
		{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   248
			$destination = $attributes->{$_}->{'Value'};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   249
			#print "destination=$destination\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   250
			last;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
		}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   252
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   253
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   254
	if ($destination eq '')
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   255
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   256
		print "WARNING: export tag with no destination attribute. Skipping\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   257
		return;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   258
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   259
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   260
	$destination = normalize_filepath($destination);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
	push(@{$whatlog_info->{$curbldinf}->{$curconfig}->{export}}, $destination);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
sub on_end_whatlog
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   267
	my $unknown_counter = 0;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   268
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
	for my $bldinf (keys %{$whatlog_info})
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   270
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
		for my $config (keys %{$whatlog_info->{$bldinf}})
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   272
		{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   273
			my $normalized = lc($bldinf);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   274
			$normalized =~ s,^[A-Za-z]:,,;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   275
			$normalized =~ s,[\\],/,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   276
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
			$normalized =~ m,^/sf/([^/]+)/([^/]+)/,;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
			my $layer = $1;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
			my $package = $2;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   280
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   281
			mkdir("$basedir/$layer");
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   282
			mkdir("$basedir/$layer/$package");
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   284
			my $filename = "$basedir/$layer/$package/info.tsv";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   285
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   286
			print "Writing info file $filename\n" if (!-f$filename);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
			open(FILE, ">>$filename");
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   289
			for my $filetype (keys %{$whatlog_info->{$bldinf}->{$config}})
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   290
			{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   291
				for (sort(@{$whatlog_info->{$bldinf}->{$config}->{$filetype}}))
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   292
				{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   293
					print FILE "$_\t$filetype\t$config\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   294
				}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   295
			}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   296
			
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   297
			close(FILE);
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   298
		}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   299
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   300
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   301
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   302
sub normalize_filepath
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   303
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   304
	my ($filepath) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   305
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   306
	if ($filepath =~ m,[^\s^\r^\n]+(.*)[\r\n]+(.*)[^\s^\r^\n]+,)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   307
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   308
		print "WARNING: file path string extends over multiple line: $filepath. Removing all NL's and CR's\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   309
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   310
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   311
	# strip all CR's and NL's
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   312
	$filepath =~ s,[\r\n],,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   313
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   314
	# strip all whitespaces at string start/end
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   315
	$filepath =~ s,^\s+,,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   316
	$filepath =~ s,\s+$,,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   317
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   318
	# remove drive letter and colon from the beginning of the string
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   319
	$filepath =~ s,^[A-Za-z]:,,;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   320
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   321
	# normalize slashes
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   322
	$filepath =~ s,\\,/,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   323
	$filepath =~ s,//,/,g;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   324
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   325
	if ($filepath !~ m,^/epoc32/,i)
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   326
	{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   327
		print "WARNING: file '$filepath' doesn't seem valid. Writing to info file anyway\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   328
	}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   329
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   330
	return $filepath;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   331
}
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   332
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   333
sub on_start_whatlog_default
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   334
{
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   335
	my ($el) = @_;
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   336
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   337
	my $tagname = $el->{LocalName};
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   338
	
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   339
	print "WARNING: unsupported tag '$tagname' in <whatlog> context\n";
1d9c60a4e308 Adding extraction of whatlog information into "deliverables" files
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   340
}