uh_parser/uh.pl
changeset 267 a02973783e64
parent 259 83443e6675cd
child 268 60fee4a35d67
--- a/uh_parser/uh.pl	Tue Jun 22 10:59:48 2010 +0100
+++ b/uh_parser/uh.pl	Mon Jun 28 11:59:20 2010 +0100
@@ -185,11 +185,8 @@
 		}
 		if ($failure->{component})
 		{
-			if ($failure->{component} =~ m,/((os|mw|app|tools|ostools|adaptation|unknown)/[a-zA-Z]+),)
-			{
-				$failure_package = $1;
-			}
-			else
+			$failure_package = RaptorCommon::get_package_subpath($failure->{component});
+			if (!$failure_package)
 			{
 				print "WARNING: summary line with wrong component path at $csv_file line $csv_linenum. Skipping\n";
 				next;
@@ -295,7 +292,7 @@
 	if ($mustlink)
 	{
 		my $packagesummaryhtml = $package;
-		$packagesummaryhtml =~ s,/,_,;
+		$packagesummaryhtml =~ s,/,_,g;
 		$packagesummaryhtml .= ".html";
 		my $packageline = "<tr><td><a href='$packagesummaryhtml'>$package</a></td>";
 		for (@severities)
@@ -337,8 +334,8 @@
 {
 	my ($category, $failures_by_severity) = @_;
 	
-	my $filenamebase = $category;
-	$filenamebase =~ s,/,_,;
+	my $filenamebase = $category; 
+	$filenamebase =~ s,/,_,g;
 	
 	open(SPECIFIC, ">$outputdir/$filenamebase.html");
 	print SPECIFIC "FAILURES FOR CATEGORY $category<br/>\n";
@@ -376,8 +373,8 @@
 	
 	my $anyfailures = 0;
 	
-	my $filenamebase = $package;
-	$filenamebase =~ s,/,_,;
+	my $filenamebase = $package; 
+	$filenamebase =~ s,/,_,g;
 	
 	if (defined $recipe_failures_by_package_severity->{$package})
 	{
@@ -422,7 +419,7 @@
 		$missing_by_package->{$package} = 0;
 		
 		my $missinglistfile = $package;
-		$missinglistfile =~ s,/,_,;
+		$missinglistfile =~ s,/,_,g;
 		$missinglistfile .= "_missing.txt";
 		if (open(MISSINGLIST, "$::raptorbitsdir/$missinglistfile"))
 		{
@@ -507,17 +504,13 @@
 	
 	for my $bldinf (keys %{$allbldinfs})
 	{
-		# normalize bldinf path
-		$bldinf = lc($bldinf);
-		$bldinf =~ s,^[A-Za-z]:,,;
-		$bldinf =~ s,[\\],/,g;
+		RaptorCommon::normalize_bldinf_path(\$bldinf);
 		
 		my $package = '';
-		if ($bldinf =~ m,/((os|mw|app|tools|ostools|adaptation|unknown)/[a-zA-Z]+),)
-		{
-			$package = $1;
-		}
-		else
+		print "bldinf: $bldinf\n";
+		$package = RaptorCommon::get_package_subpath($bldinf);
+		print "package: $package\n";
+		if (!$package)
 		{
 			print "WARNING: can't understand bldinf attribute of recipe: $bldinf. Won't dump to failed recipes file.\n";
 		}