common/tools/analysis/yarp.pl
author Matt Davies <mattd@symbian.org>
Wed, 29 Jul 2009 11:56:35 +0100
changeset 284 e5f3b53baae0
parent 205 863cc9c0bf03
child 288 58affcc6c40e
permissions -rw-r--r--
Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     1
#!/usr/bin/perl
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     2
# Copyright (c) 2009 Symbian Foundation Ltd
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     7
#
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
     9
# Symbian Foundation Ltd - initial contribution.
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    10
#
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    11
# Contributors:
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    12
# Matt Davies <mattd@symbian.org>
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    13
#
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    14
# Description:
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    15
# YARP - Yet Another Recipe Parser
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    16
# This tool parses Raptor logs looking for failures, and writes a CSV file of the results
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    17
#
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    18
# Usage:
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    19
# perl yarp.pl <logfile> <csvfile>
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    20
#
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    21
# Notes:
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    22
# Currently it won't tell you any info about why it fails, with the exception of arm licence issues.
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    23
# It also uses a lot of memory, so while there is a subroutine for doing multiple files, it's not used, and is out of date.
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    24
# Writing output to a file is hacked in, so it's not too pretty.
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    25
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    26
use strict;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    27
use XML::Simple;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    28
use Data::Dumper;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    29
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    30
my @header = qw(line layer component name armlicence platform phase code bldinf mmp target source);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    31
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    32
main();
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    33
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    34
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    35
sub main()
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    36
{
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    37
  my $filename = shift @ARGV;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    38
  my $output = shift @ARGV;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    39
  open(OUT,">$output") or die "Coudn't open $output\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    40
  foreach my $key (@header)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    41
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    42
    print OUT $key.",";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    43
  } 
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    44
  print OUT "\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    45
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    46
  parsefile($filename);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    47
  close OUT;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    48
}
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    49
sub scandir()
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    50
{
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    51
  my $path = shift @ARGV;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    52
  my @files = glob($path."/*compile.log");
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    53
   
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    54
  foreach my $filename (@files)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    55
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    56
#    print $filename."\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    57
    parsefile($filename);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    58
  }  
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    59
}
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    60
  
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    61
sub  parsefile($filename)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    62
{
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    63
    my $filename = shift;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    64
#    print "Scanning $filename\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    65
    open(FILE,"<$filename") or die "Couldn't open filename\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    66
    my $recipe;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    67
    my %attempts;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    68
    my %licenceattempts;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    69
    my $counter = 0;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    70
    my $licence = 0;
203
011f16c9778b Yarp to print failures
Dario Sestito <darios@symbian.org>
parents: 138
diff changeset
    71
    my $failures = 0;
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    72
    while( my $line = <FILE>)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    73
    {
284
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    74
      if(defined $recipe)
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    75
      {
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    76
        if(defined $recipe->{'content'})
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    77
        {
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    78
          my $ref = $recipe->{'content'}; 
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    79
          push(@$ref, $line);
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    80
        }
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    81
      }
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    82
      ++$counter;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    83
      if($line =~ m/^<recipe\s+(\S.+)>/)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    84
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    85
        $recipe = XMLin($line."</recipe>");
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    86
        $recipe->{'line'} = $counter;
284
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    87
        my @content;
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    88
        push(@content, $line);
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    89
        $recipe->{'content'} = \@content;
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
    90
        
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    91
#        print Dumper($recipe);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    92
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    93
      elsif($line =~ m/<\/recipe>/)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    94
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    95
        if(defined $recipe)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    96
        {         
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    97
#          if($recipe->{'exit'} !~ m/ok/)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    98
          if($recipe->{'exit'} =~ m/failed/)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    99
          {
203
011f16c9778b Yarp to print failures
Dario Sestito <darios@symbian.org>
parents: 138
diff changeset
   100
	          ++$failures;
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   101
#            if($recipe->{'target'} =~ m/\S:epoc32\//i) 
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   102
#               && $recipe->{'target'} !~ m/\S:epoc32\/build/i)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   103
            {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   104
              DumpRecipe($recipe);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   105
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   106
            }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   107
          }         
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   108
        $recipe = undef;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   109
        }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   110
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   111
      elsif($line =~ m/Error:\sC3397E:\s/) #ARM Licence error code...
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   112
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   113
        ++$licence;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   114
        if(defined $recipe)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   115
        {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   116
          $recipe->{'armlicence'} = 1;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   117
        }  
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   118
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   119
      elsif($line =~ m/(<status\s.+\/>)/)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   120
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   121
        my $status = XMLin($1);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   122
        if(defined $recipe)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   123
        {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   124
          $recipe->{'exit'} = $status->{'exit'};
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   125
          $recipe->{'attempt'} = $status->{'attempt'};
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   126
          if(defined $status->{'code'})
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   127
          {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   128
            $recipe->{'code'} = $status->{'code'}; 
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   129
          }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   130
          if(!defined $attempts{$status->{'attempt'}})
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   131
            {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   132
              $attempts{$status->{'attempt'}} = 0;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   133
            }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   134
          $attempts{$status->{'attempt'}} = $attempts{$status->{'attempt'}} + 1;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   135
          if(defined $recipe->{'armlicence'})
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   136
          {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   137
            if(!defined $licenceattempts{$status->{'attempt'}})
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   138
              {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   139
                $licenceattempts{$status->{'attempt'}} = 0;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   140
              }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   141
            $licenceattempts{$status->{'attempt'}} = $licenceattempts{$status->{'attempt'}} + 1;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   142
          }               
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   143
        }      
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   144
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   145
    }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   146
  close FILE;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   147
  print OUT "\n\nSummaries\n\n";
203
011f16c9778b Yarp to print failures
Dario Sestito <darios@symbian.org>
parents: 138
diff changeset
   148
  
205
863cc9c0bf03 Added output stream to failures line in yarp. Made the failure string more robust
Dario Sestito <darios@symbian.org>
parents: 203
diff changeset
   149
  print OUT "Raptor recipe failures: $failures\n";
863cc9c0bf03 Added output stream to failures line in yarp. Made the failure string more robust
Dario Sestito <darios@symbian.org>
parents: 203
diff changeset
   150
  
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   151
  foreach my $attempt (sort keys %attempts)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   152
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   153
    print OUT "Overall attempts: $attempt,".$attempts{$attempt}.",\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   154
  }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   155
  foreach my $attempt (sort keys %licenceattempts)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   156
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   157
    print OUT "ARM Licence Fail attempts: $attempt,".$licenceattempts{$attempt}.",\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   158
  }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   159
  print OUT "Total ARM Licence failures,$licence\n";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   160
  
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   161
   
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   162
}
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   163
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   164
sub DumpRecipe($)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   165
{
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   166
  my $recipe = shift;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   167
  foreach my $key (@header)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   168
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   169
    if(defined $recipe->{$key})
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   170
    {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   171
      print OUT $recipe->{$key};
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   172
    }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   173
    print OUT ",";
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   174
  }
284
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   175
  print OUT "\n";
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   176
  my $content = $recipe->{'content'};
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   177
  for my $line (@$content)
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   178
  {
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   179
    print $line;
e5f3b53baae0 Yarp - Modified to output failed recipes to STDOUT instead of having to use dump_recipe_at_line.pl, and modified build.xml to save these logs.
Matt Davies <mattd@symbian.org>
parents: 205
diff changeset
   180
  }              
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   181
  #print Dumper($recipe);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   182
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   183
}