# HG changeset patch # User Brendan Donegan brendand@symbian.org # Date 1249043658 -3600 # Node ID e22ebfc477147154a193876f1220e1805143b172 # Parent 737aeceb580d0e277b840686f183d6c01c1e4317# Parent 2168508ed1656d88a4fadb50c99deae129247da4 Caught up diff -r 737aeceb580d -r e22ebfc47714 common/common_props.ant.xml --- a/common/common_props.ant.xml Fri Jul 31 13:22:56 2009 +0100 +++ b/common/common_props.ant.xml Fri Jul 31 13:34:18 2009 +0100 @@ -78,7 +78,7 @@ - + diff -r 737aeceb580d -r e22ebfc47714 common/tools/analysis/yarp.pl --- a/common/tools/analysis/yarp.pl Fri Jul 31 13:22:56 2009 +0100 +++ b/common/tools/analysis/yarp.pl Fri Jul 31 13:34:18 2009 +0100 @@ -20,7 +20,7 @@ # # Notes: # Currently it won't tell you any info about why it fails, with the exception of arm licence issues. -# 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. +# XML::Simple leaks memory, so there is now a manual parsing mode which is enabled by the '$manualparsing' global variable. # Writing output to a file is hacked in, so it's not too pretty. use strict; @@ -28,6 +28,7 @@ use Data::Dumper; my @header = qw(line layer component name armlicence platform phase code bldinf mmp target source); +my $manualparsing = 1; #XML::Simple leaks memory. Manual parsing doesn't, but may not be as robust if Raptor changes it's output... main(); @@ -63,12 +64,13 @@ my $filename = shift; # print "Scanning $filename\n"; open(FILE,"<$filename") or die "Couldn't open filename\n"; - my $recipe; + my $recipe = undef; my %attempts; my %licenceattempts; my $counter = 0; my $licence = 0; my $failures = 0; + while( my $line = ) { if(defined $recipe) @@ -82,7 +84,7 @@ ++$counter; if($line =~ m/^/) { - $recipe = XMLin($line.""); + $recipe = parseline($line.""); $recipe->{'line'} = $counter; my @content; push(@content, $line); @@ -118,7 +120,7 @@ } elsif($line =~ m/()/) { - my $status = XMLin($1); + my $status = parseline($1); if(defined $recipe) { $recipe->{'exit'} = $status->{'exit'}; @@ -181,3 +183,39 @@ #print Dumper($recipe); } + +sub parseline($line) +{ + my $line = shift; +# print "\t$line\n"; + my $val; + if($manualparsing) + { + my $strippedline; + if($line =~ m/<\S+(.+)\/>/) + { + $strippedline = $1; + } + elsif($line =~ m/<\S+(.+)>\s*<\/\S+>/) + { + $strippedline = $1; + } +# print $strippedline."\n"; + my @stuff = split('\s+', $strippedline); + my %results; + foreach my $pair (@stuff) + { +# print $pair."\n"; + if($pair =~ m/^(\S+)=\'(\S+)\'$/) + { + $results{$1}=$2; + } + } + $val = \%results; + } + else + { + $val = XMLin($line); + } + return $val; +} \ No newline at end of file