Use the bldinf attribute to assign Raptor errors and warnings to the related package
--- a/uh_parser/RaptorError.pm Wed Apr 07 16:07:31 2010 +0100
+++ b/uh_parser/RaptorError.pm Wed Apr 07 17:31:01 2010 +0100
@@ -37,6 +37,8 @@
my $filename = '';
+my $raptor_error_info = {};
+
my $characters = '';
my $CATEGORY_RAPTORERROR = 'raptor_error';
@@ -135,18 +137,22 @@
sub on_start_buildlog
{
RaptorCommon::init();
-
- $filename = "$::raptorbitsdir/raptor_error.txt";
- if (!-f$filename)
- {
- print "Writing errors file $filename\n";
- open(FILE, ">$filename");
- close(FILE);
- }
}
sub on_start_buildlog_error
{
+ my ($el) = @_;
+
+ #print "on_start_buildlog_error\n";
+
+ $raptor_error_info = {};
+
+ my $attributes = $el->{Attributes};
+ for (keys %{$attributes})
+ {
+ $raptor_error_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'};
+ #print "$_ -> $attributes->{$_}->{'Value'}\n";
+ }
}
sub on_chars_buildlog_error
@@ -164,12 +170,51 @@
{
#print "on_end_buildlog_error\n";
+ my $package = '';
+ if ($raptor_error_info->{bldinf})
+ {
+ $::allbldinfs->{$raptor_error_info->{bldinf}} = 1;
+
+ # normalize bldinf path
+ $raptor_error_info->{bldinf} = lc($raptor_error_info->{bldinf});
+ $raptor_error_info->{bldinf} =~ s,^[A-Za-z]:,,;
+ $raptor_error_info->{bldinf} =~ s,[\\],/,g;
+
+ if ($raptor_error_info->{bldinf} =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
+ {
+ $package = $1;
+ $package =~ s,/,_,;
+ }
+ else
+ {
+ print "WARNING: can't understand bldinf attribute of raptor error: $raptor_error_info->{bldinf}. Won't associate to package.\n";
+ }
+ }
+
$characters =~ s,^[\r\n]*,,;
$characters =~ s,[\r\n]*$,,;
if ($characters =~ m,[^\s^\r^\n],)
- {
- my $dumped = process($characters, $::current_log_file, '', '', '', '', "raptor_error.txt");
+ {
+ my $bldinf_field = '';
+ if ($package)
+ {
+ $filename = "$::raptorbitsdir/$package.txt";
+ $bldinf_field = $raptor_error_info->{bldinf};
+ }
+ else
+ {
+ $filename = "$::raptorbitsdir/raptor_error.txt";
+ }
+
+ if (!-f$filename)
+ {
+ print "Writing file $filename\n";
+ open(FILE, ">$filename");
+ close(FILE);
+ }
+
+ my $dumped = process($characters, $::current_log_file, $bldinf_field, '', '', '', "$package.txt");
if ($dumped)
{
--- a/uh_parser/RaptorWarning.pm Wed Apr 07 16:07:31 2010 +0100
+++ b/uh_parser/RaptorWarning.pm Wed Apr 07 17:31:01 2010 +0100
@@ -37,6 +37,8 @@
my $filename = '';
+my $raptor_warning_info = {};
+
my $characters = '';
my $CATEGORY_RAPTORWARNING = 'raptor_warning';
@@ -76,18 +78,20 @@
sub on_start_buildlog
{
RaptorCommon::init();
-
- $filename = "$::raptorbitsdir/raptor_warning.txt";
- if (!-f$filename)
- {
- print "Writing warnings file $filename\n";
- open(FILE, ">$filename");
- close(FILE);
- }
}
+
sub on_start_buildlog_warning
{
- open(FILE, ">>$filename");
+ my ($el) = @_;
+
+ $raptor_warning_info = {};
+
+ my $attributes = $el->{Attributes};
+ for (keys %{$attributes})
+ {
+ $raptor_warning_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'};
+ #print "$_ -> $attributes->{$_}->{'Value'}\n";
+ }
}
sub on_chars_buildlog_warning
@@ -105,12 +109,51 @@
{
#print "on_end_buildlog_warning\n";
+ my $package = '';
+ if ($raptor_warning_info->{bldinf})
+ {
+ $::allbldinfs->{$raptor_warning_info->{bldinf}} = 1;
+
+ # normalize bldinf path
+ $raptor_warning_info->{bldinf} = lc($raptor_warning_info->{bldinf});
+ $raptor_warning_info->{bldinf} =~ s,^[A-Za-z]:,,;
+ $raptor_warning_info->{bldinf} =~ s,[\\],/,g;
+
+ if ($raptor_warning_info->{bldinf} =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
+ {
+ $package = $1;
+ $package =~ s,/,_,;
+ }
+ else
+ {
+ print "WARNING: can't understand bldinf attribute of raptor warning: $raptor_warning_info->{bldinf}. Won't associate to package.\n";
+ }
+ }
+
$characters =~ s,^[\r\n]*,,;
$characters =~ s,[\r\n]*$,,;
if ($characters =~ m,[^\s^\r^\n],)
{
- my $dumped = process($characters, $::current_log_file, '', '', '', '', "raptor_warning.txt");
+ my $bldinf_field = '';
+ if ($package)
+ {
+ $filename = "$::raptorbitsdir/$package.txt";
+ $bldinf_field = $raptor_warning_info->{bldinf};
+ }
+ else
+ {
+ $filename = "$::raptorbitsdir/raptor_warning.txt";
+ }
+
+ if (!-f$filename)
+ {
+ print "Writing file $filename\n";
+ open(FILE, ">$filename");
+ close(FILE);
+ }
+
+ my $dumped = process($characters, $::current_log_file, $bldinf_field, '', '', '', "$package.txt");
if ($dumped)
{
--- a/uh_parser/uh.pl Wed Apr 07 16:07:31 2010 +0100
+++ b/uh_parser/uh.pl Wed Apr 07 17:31:01 2010 +0100
@@ -169,12 +169,32 @@
$failure->{subcategory} = 'uncategorized' if (!$failure->{subcategory});
$failure->{severity} = 'unknown' if (!$failure->{severity});
$failure->{mmp} = '-' if (!$failure->{mmp});
+ $failure->{phase} = '-' if (!$failure->{phase});
+ $failure->{recipe} = '-' if (!$failure->{recipe});
# populate severities dynamically.
#$severities->{$failure->{severity}} = 1;
# put failure items into their category container
- if ($failure->{category} =~ /^raptor_(error|warning|unreciped)$/i)
+ if ($failure->{category} =~ /^recipe_failure$/i || $failure->{category} =~ /^raptor_(error|warning|unreciped)$/i && $failure_package)
+ {
+ $recipe_failures_num_by_severity->{$failure_package} = {} if (!defined $recipe_failures_num_by_severity->{$failure_package});
+ my $package_failure = $recipe_failures_num_by_severity->{$failure_package};
+
+ if (!defined $package_failure->{$failure->{severity}})
+ {
+ $package_failure->{$failure->{severity}} = 1;
+ }
+ else
+ {
+ $package_failure->{$failure->{severity}} ++;
+ }
+
+ $recipe_failures_by_package_severity->{$failure_package} = {} if (!defined $recipe_failures_by_package_severity->{$failure_package});
+ $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}} = [] if (!defined $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}});
+ push(@{$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}}}, $failure);
+ }
+ elsif ($failure->{category} =~ /^raptor_(error|warning|unreciped)$/i)
{
$general_failures_num_by_severity->{$failure->{category}} = {} if (!defined $general_failures_num_by_severity->{$failure->{category}});
my $general_failure = $general_failures_num_by_severity->{$failure->{category}};
@@ -192,24 +212,6 @@
$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}} = [] if (!defined $general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}});
push(@{$general_failures_by_category_severity->{$failure->{category}}->{$failure->{severity}}}, $failure);
}
- elsif ($failure->{category} =~ /^recipe_failure$/i)
- {
- $recipe_failures_num_by_severity->{$failure_package} = {} if (!defined $recipe_failures_num_by_severity->{$failure_package});
- my $package_failure = $recipe_failures_num_by_severity->{$failure_package};
-
- if (!defined $package_failure->{$failure->{severity}})
- {
- $package_failure->{$failure->{severity}} = 1;
- }
- else
- {
- $package_failure->{$failure->{severity}} ++;
- }
-
- $recipe_failures_by_package_severity->{$failure_package} = {} if (!defined $recipe_failures_by_package_severity->{$failure_package});
- $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}} = [] if (!defined $recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}});
- push(@{$recipe_failures_by_package_severity->{$failure_package}->{$failure->{severity}}}, $failure);
- }
}
else
{