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.
authorMatt Davies <mattd@symbian.org>
Wed, 29 Jul 2009 11:56:35 +0100
changeset 311 e5f3b53baae0
parent 308 001db0b4dd89
child 312 2796eb7c8c41
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.
common/build.xml
common/tools/analysis/yarp.pl
--- a/common/build.xml	Tue Jul 28 12:11:23 2009 +0100
+++ b/common/build.xml	Wed Jul 29 11:56:35 2009 +0100
@@ -875,7 +875,7 @@
           <propertyregex override="yes" property="yarpfile"  input="@{logfile}" regexp=".*[\\|\/](.*)_compile\.log" replace="\1_yarp.csv"/>
           <propertyregex override="yes" property="yarpfile_short"  input="${yarpfile}" regexp="[^_]*_[^_]*_[^_]*_(.+)_[^_]*_yarp\.csv" replace="YARP_\1"/>
           <echo message="Yarping @{logfile}..."/>
-          <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_yarp.log" append="true">
+          <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${yarpfile}.log" append="true">
             <arg value="${sf.common.config.dir}/tools/analysis/yarp.pl"/>
             <arg value="@{logfile}"/>
             <arg value="${build.log.dir}/analysis/${yarpfile}"/>
--- a/common/tools/analysis/yarp.pl	Tue Jul 28 12:11:23 2009 +0100
+++ b/common/tools/analysis/yarp.pl	Wed Jul 29 11:56:35 2009 +0100
@@ -71,11 +71,23 @@
     my $failures = 0;
     while( my $line = <FILE>)
     {
+      if(defined $recipe)
+      {
+        if(defined $recipe->{'content'})
+        {
+          my $ref = $recipe->{'content'}; 
+          push(@$ref, $line);
+        }
+      }
       ++$counter;
       if($line =~ m/^<recipe\s+(\S.+)>/)
       {
         $recipe = XMLin($line."</recipe>");
         $recipe->{'line'} = $counter;
+        my @content;
+        push(@content, $line);
+        $recipe->{'content'} = \@content;
+        
 #        print Dumper($recipe);
       }
       elsif($line =~ m/<\/recipe>/)
@@ -160,7 +172,12 @@
     }
     print OUT ",";
   }
-  print OUT "\n";            
+  print OUT "\n";
+  my $content = $recipe->{'content'};
+  for my $line (@$content)
+  {
+    print $line;
+  }              
   #print Dumper($recipe);
 
 }