tools/grab_gcc_errors.pl
author arunabha
Mon, 12 Apr 2010 16:01:06 +0100
changeset 5 29cf076edbda
parent 1 fd0863fd52e5
permissions -rw-r--r--
Extending examples for some more good code bad code.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#! perl
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2010 Symbian Foundation Ltd
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# 
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# Grab the GCC package build logs from the Symbian build publishing machine
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
# NB. This doesn't do the HTTP access, so it only works inside the Symbian network
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
use strict;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
use Getopt::Long;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
my @failures_files = ();
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
my $line;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
while ($line =<>)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	# <tr><td>adaptation/beagleboard</td><td><span style='background-color:red'>R</span> <a href='http://developer.symbian.org/main/source/packages/package/build_details.php?id=4576'>beagleboard_CompilerCompatibility.007</a><br/><span style='font-size:small'>(gcce4_4_1)</span><br/><span style='font-size:small'>2010-03-16 20:15:26</span></td><td><span style='background-color:red'>R</span> <a href='http://developer.symbian.org/main/source/packages/package/build_details.php?id=4197'>beagleboard_CompilerCompatibility.003</a><br/><span style='font-size:small'>(gcce4_4_1)</span><br/><span style='font-size:small'>2010-03-11 18:11:05</span></td><td>-</td><td>-</td><td>-</td><td>-</td></tr>
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	if ($line =~/^<tr><td>([^<]+)<\/td><td>.*?>([^<]+)<\/a>/)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
		my $layer_package = $1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
		my $buildname = $2;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
		my ($layer,$package) = split /\//, $layer_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
		my $location = sprintf "SF_builds/%s/builds/CompilerCompatibility/%s/html/%s_%s_failures.html", $package, $buildname, $layer, $package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
		my $url = "http://cdn.symbian.org/" . $location;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
		my $unc = "//v800020/" . $location;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
		print "$layer_package, $buildname, $location\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
		if (-f $unc)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
			open FILE, "<$unc" or die("Cannot open $unc: $!\n");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
			my @html = <FILE>;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
			close FILE;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
			print @html;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
	}