Fixed handling or regular expression strings, so the regular expression functiuonality works, not just substring detection!
authorSimon Howkins <simonh@symbian.org>
Mon, 05 Oct 2009 10:20:32 +0100
changeset 578 75fa4158340a
parent 577 424a5ad9bc7d
child 579 78b42fd9e2c4
Fixed handling or regular expression strings, so the regular expression functiuonality works, not just substring detection! Added special handling if the severity marker is "ignore". Unsuprisingly, it ignores that line.
common/tools/brag/logToBRAG.pl
--- a/common/tools/brag/logToBRAG.pl	Fri Oct 02 17:41:04 2009 +0100
+++ b/common/tools/brag/logToBRAG.pl	Mon Oct 05 10:20:32 2009 +0100
@@ -84,7 +84,7 @@
 	next unless $line;
 	my @terms = split m{\t+}, $line;
 	die "Rules file not formatted as expected at line $.\n" unless scalar @terms == 2;
-	push @rules, { regexp => $terms[0], severity => $terms[1] };
+	push @rules, { regexp => qr{$terms[0]}, severity => $terms[1] };
 }	
 
 # Iterate through all the lines of all the files in @ARGV
@@ -95,6 +95,7 @@
 	{
 		if ($line =~ m[$rule->{regexp}])
 		{
+			last if $rule->{severity} eq "ignore";
 			# We found a match
 			my $failure = bless{ Kids => [ bless { Text => $line }, "Characters" ] }, "failure";
 			# Ensure we have a <failures> tag for this severity