common/tools/analysis/yarp.pl
author Louis Henry Nayegon <louisn@symbian.org>
Mon, 22 Jun 2009 16:47:52 +0100
changeset 213 6e86ffca2e31
parent 205 863cc9c0bf03
child 284 e5f3b53baae0
permissions -rw-r--r--
Add option for dynamic bc testing
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
    {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    74
      ++$counter;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    75
      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
    76
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    77
        $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
    78
        $recipe->{'line'} = $counter;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    79
#        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
    80
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    81
      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
    82
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    83
        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
    84
        {         
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    85
#          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
    86
          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
    87
          {
203
011f16c9778b Yarp to print failures
Dario Sestito <darios@symbian.org>
parents: 138
diff changeset
    88
	          ++$failures;
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    89
#            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
    90
#               && $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
    91
            {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    92
              DumpRecipe($recipe);
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    93
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
          }         
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    96
        $recipe = undef;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    97
        }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    98
      }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
    99
      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
   100
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   101
        ++$licence;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   102
        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
   103
        {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   104
          $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
   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
      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
   108
      {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   109
        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
   110
        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
   111
        {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   112
          $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
   113
          $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
   114
          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
   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->{'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
   117
          }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   118
          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
   119
            {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   120
              $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
   121
            }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   122
          $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
   123
          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
   124
          {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   125
            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
   126
              {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   127
                $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
   128
              }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   129
            $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
   130
          }               
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
      }
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
  close FILE;
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   135
  print OUT "\n\nSummaries\n\n";
203
011f16c9778b Yarp to print failures
Dario Sestito <darios@symbian.org>
parents: 138
diff changeset
   136
  
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
   137
  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
   138
  
138
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   139
  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
   140
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   141
    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
   142
  }
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   143
  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
   144
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   145
    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
   146
  }
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 "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
   148
  
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   149
   
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   150
}
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   151
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   152
sub DumpRecipe($)
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   153
{
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   154
  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
   155
  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
   156
  {
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   157
    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
   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 $recipe->{$key};
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
    print OUT ",";
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
  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
   164
  #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
   165
d3c5dd0ae0b0 Added yarp.pl - (Yet Another Raptor Parser) and dump_recipe_at_line.pl
Matt Davies <mattd@symbian.org>
parents:
diff changeset
   166
}