diff -r a1d3b0c3227b -r 5af7cc0d44a1 common/tools/brag/raptorToBRAG.pl --- a/common/tools/brag/raptorToBRAG.pl Fri Oct 02 12:17:26 2009 +0100 +++ b/common/tools/brag/raptorToBRAG.pl Thu Oct 01 17:21:32 2009 +0100 @@ -37,9 +37,23 @@ # Start to build structure to be output as XML (same format as XML::Parser would create for us) my $xmlNewline = bless { Text => "\n" }, "Characters"; -my $data = [bless {name => "build", Kids => [ $xmlNewline ] }, "stage"]; +my $buildStatus = +[ + bless + { + Kids => + [ + $xmlNewline, + bless + { + name => "build", + Kids => [ $xmlNewline ] + }, "phase", + ] + }, "buildStatus" +]; # Get a shortcut reference to the bit we will use a lot -my $buildStage = $data->[0]; +my $buildPhase = $buildStatus->[0]->{Kids}->[-1]; # READ SUMMARY.CSV FILE open(CSV, $raptorSummary); @@ -83,7 +97,7 @@ # Look through the steps to see if we already have one to match this config my $step; - foreach (@{$buildStage->{Kids}}) + foreach (@{$buildPhase->{Kids}}) { next unless ref $_ eq "step"; if ($_->{name} eq $failure->{config}) @@ -96,7 +110,7 @@ { # First item found in this step - create step entry $step = bless { name => $failure->{config}, Kids => [ $xmlNewline ] }, "step"; - push @{$buildStage->{Kids}}, $step, $xmlNewline; + push @{$buildPhase->{Kids}}, $step, $xmlNewline; # Also create empty tags with severities in a sensible order foreach my $severity (qw{critical major minor}) { @@ -140,7 +154,7 @@ # Print XML print "\n"; print "\n"; -printTree($data->[0]); +printTree($buildStatus->[0]); print "\n"; exit(0);