uh_parser/RaptorCommon.pm
author William Roberts <williamr@symbian.org>
Thu, 30 Sep 2010 11:54:42 +0100
changeset 325 28c70cc5e86f
parent 293 a02973783e64
permissions -rw-r--r--
Add --norev option to ignore the revision information in packagelists (mostly for the default hg pull behaviour) Improve the csv file parsing to allow spaces in the comma-separated information Remove the export_control_special_case in line with the main website practice Add a distinct hostname for the pushurl, so we pull from "developer.symbian.org" and push to "developer-secure.symbian.org"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
# Contributors:
258
08436a227940 Add author information. Reviewed descriptions
Dario Sestito <darios@symbian.org>
parents: 186
diff changeset
    11
# Dario Sestito <darios@symbian.org>
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
#
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
# Description:
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
# Common constants for the raptor parser suite
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
package RaptorCommon;
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
our $SEVERITY_CRITICAL = 'critical';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
our $SEVERITY_MAJOR = 'major';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
our $SEVERITY_MINOR = 'minor';
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
sub init
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
	my $filename = "$::raptorbitsdir/summary.csv";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
	if (!-f$filename)
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
	{
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
		print "Writing summary file $filename\n";
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
		open(SUMMARY, ">$filename");
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
		close(SUMMARY);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
	}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
sub dump_fault
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
{
186
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    35
	my ($category, $subcategory, $severity, $location, $component, $mmp, $phase, $recipe, $file) = @_;
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    36
	
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    37
	$::failure_item_number++;
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
	
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
	open(SUMMARY, ">>$::raptorbitsdir/summary.csv");
186
b76adfbc6648 Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents: 177
diff changeset
    40
	print SUMMARY "$category,$subcategory,$severity,$location,$component,$mmp,$phase,$recipe,$file,$::failure_item_number\n";
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
	close(SUMMARY);
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
}
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
293
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    44
sub normalize_bldinf_path
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    45
{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    46
	my ($bldinfref) = @_;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    47
	
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    48
	${$bldinfref} = lc(${$bldinfref});
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    49
	${$bldinfref} =~ s,^[A-Za-z]:,,;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    50
	${$bldinfref} =~ s,[\\],/,g;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    51
}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    52
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    53
sub get_package_subpath
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    54
{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    55
	my ($bldinf) = @_;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    56
	
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    57
	my $package = '';
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    58
	
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    59
	if ($bldinf =~ m,(unknown/unknown),)
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    60
	{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    61
		$package = 'unknown/unknown';
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    62
	}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    63
	elsif ($bldinf =~ m,^/+?([^/]*?/[^/]*?/[^/]*?)/,)
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    64
	{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    65
		$package = $1;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    66
	}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    67
	#elsif ($bldinf =~ m,^/+?([^/]*?/[^/]*?)/,)
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    68
	#{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    69
	#	$package = $1;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    70
	#}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    71
	#elsif ($bldinf =~ m,^/+?([^/]*?)/,)
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    72
	#{
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    73
	#	$package = $1;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    74
	#}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    75
	
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    76
	return $package;
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    77
}
a02973783e64 Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents: 258
diff changeset
    78
177
6d3c3db11e72 Add Raptor uh parser
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
1;