diff -r 161402049aa3 -r 2c2dbe93b84b uh_parser/uh.pl
--- a/uh_parser/uh.pl Tue Mar 23 13:34:05 2010 +0000
+++ b/uh_parser/uh.pl Wed Mar 24 16:35:37 2010 +0000
@@ -20,6 +20,7 @@
use RaptorInfo;
use RaptorUnreciped;
use RaptorRecipe;
+use releaseables;
use XML::SAX;
use RaptorSAXHandler;
@@ -30,10 +31,13 @@
our $raptorbitsdir = 'raptorbits';
our $basedir = '';
my $outputdir = "html";
+our $releaseablesdir = "releaseables";
our $raptor_config = 'dummy_config';
our $current_log_file = '';
+our $missing = 0;
my $help = 0;
GetOptions((
+ 'missing!' => \$missing,
'basedir=s' => \$basedir,
'help!' => \$help
));
@@ -46,7 +50,9 @@
print "Unite and HTML-ize Raptor log files.\n";
print "Usage: perl uh.pl [OPTIONS] FILE1 FILE2 ...\n";
print "where OPTIONS are:\n";
- print "\t--basedir=DIR Generate output under DIR (defaults to current dir)\n";
+ print "\t-m, --missing\tAlso add the list of missing binaries (Raptor log should include whatlog info).\n";
+ print "\t\t\tCheck is done against the epoc tree at the root of the current drive\n";
+ print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
exit(0);
}
@@ -54,6 +60,7 @@
{
$raptorbitsdir = "$basedir/raptorbits";
$outputdir = "$basedir/html";
+ $releaseablesdir = "$basedir/releaseables";
}
mkdir($basedir) if (!-d$basedir);
@@ -62,6 +69,8 @@
system("rmdir /S /Q $raptorbitsdir") if (-d $raptorbitsdir);
mkdir($raptorbitsdir);
#print "Created dir $raptorbitsdir.\n";
+system("rmdir /S /Q $releaseablesdir") if (-d $releaseablesdir);
+mkdir("$releaseablesdir");
our $failure_item_number = 0;
@@ -69,12 +78,14 @@
open(SUMMARY, ">$raptorbitsdir/summary.csv");
close(SUMMARY);
+
my $saxhandler = RaptorSAXHandler->new();
$saxhandler->add_observer('RaptorError', $RaptorError::reset_status);
$saxhandler->add_observer('RaptorWarning', $RaptorWarning::reset_status);
$saxhandler->add_observer('RaptorInfo', $RaptorInfo::reset_status);
$saxhandler->add_observer('RaptorUnreciped', $RaptorUnreciped::reset_status);
$saxhandler->add_observer('RaptorRecipe', $RaptorRecipe::reset_status);
+$saxhandler->add_observer('releaseables', $releaseables::reset_status);
our $allbldinfs = {};
@@ -86,6 +97,8 @@
$parser->parse_uri($_);
}
+releaseables::remove_missing_duplicates();
+
my @allpackages = distinct_packages($allbldinfs);
print "Generating HTML...\n";
@@ -100,6 +113,7 @@
my $general_failures_by_category_severity = {};
my $recipe_failures_num_by_severity = {};
my $recipe_failures_by_package_severity = {};
+my $missing_by_package = {};
#my $severities = {};
my @severities = ('critical', 'major', 'minor', 'unknown');
@@ -235,13 +249,14 @@
print AGGREGATED "
\n";
$tableheader = "package | ";
for (@severities) { $tableheader .= "$_ | "; }
+$tableheader .= "missing | " if ($missing);
$tableheader .= "
";
print AGGREGATED "$tableheader\n";
for my $package (@allpackages)
{
- if (defined $recipe_failures_num_by_severity->{$package})
+ my $mustlink = print_package_specific_summary($package);
+ if ($mustlink)
{
- print_package_specific_summary($package, $recipe_failures_by_package_severity->{$package});
my $packagesummaryhtml = $package;
$packagesummaryhtml =~ s,/,_,;
$packagesummaryhtml .= ".html";
@@ -252,6 +267,7 @@
$failuresbyseverity = $recipe_failures_num_by_severity->{$package}->{$_} if (defined $recipe_failures_num_by_severity->{$package}->{$_});
$packageline .= "$failuresbyseverity | ";
}
+ $packageline .= "".$missing_by_package->{$package}." | " if ($missing);
$packageline .= "";
print AGGREGATED "$packageline\n";
}
@@ -310,42 +326,99 @@
sub print_package_specific_summary
{
- my ($package, $failures_by_severity) = @_;
+ my ($package) = @_;
+
+ my $anyfailures = 0;
my $filenamebase = $package;
$filenamebase =~ s,/,_,;
- open(SPECIFIC, ">$outputdir/$filenamebase.html");
- print SPECIFIC "FAILURES FOR PACKAGE $package
\n";
-
- for my $severity (@severities)
+ if (defined $recipe_failures_by_package_severity->{$package})
{
- if (defined $failures_by_severity->{$severity})
- {
- print SPECIFIC "
".uc($severity)."
\n";
- print SPECIFIC "\n";
- # $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
- my $tableheader = "category | configuration | mmp | phase | recipe | log snippet |
";
- print SPECIFIC "$tableheader\n";
+ $anyfailures = 1;
+
+ my $failures_by_severity = $recipe_failures_by_package_severity->{$package};
+
+ open(SPECIFIC, ">$outputdir/$filenamebase.html");
+ print SPECIFIC "FAILURES FOR PACKAGE $package
\n";
- for my $failure (@{$failures_by_severity->{$severity}})
+ for my $severity (@severities)
+ {
+ if (defined $failures_by_severity->{$severity})
{
- my $failureline = "$failure->{subcategory} | ";
- $failureline .= "$failure->{config} | ";
- $failureline .= "$failure->{mmp} | ";
- $failureline .= "$failure->{phase} | ";
- $failureline .= "$failure->{recipe} | ";
- $failureline .= "item $failure->{linenum} | ";
- $failureline .= "
";
- print SPECIFIC "$failureline\n";
+ print SPECIFIC "
".uc($severity)."
\n";
+ print SPECIFIC "\n";
+ # $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
+ my $tableheader = "category | configuration | mmp | phase | recipe | log snippet |
";
+ print SPECIFIC "$tableheader\n";
+
+ for my $failure (@{$failures_by_severity->{$severity}})
+ {
+ my $failureline = "$failure->{subcategory} | ";
+ $failureline .= "$failure->{config} | ";
+ $failureline .= "$failure->{mmp} | ";
+ $failureline .= "$failure->{phase} | ";
+ $failureline .= "$failure->{recipe} | ";
+ $failureline .= "item $failure->{linenum} | ";
+ $failureline .= "
";
+ print SPECIFIC "$failureline\n";
+ }
+
+ print SPECIFIC "
\n";
+ print SPECIFIC "
\n";
}
+ }
+ close(SPECIFIC);
+ }
+
+ if ($missing)
+ {
+ my $missinglistfile = $package;
+ $missinglistfile =~ s,/,_,;
+ $missinglistfile .= "_missing.txt";
+ if (open(MISSINGLIST, "$::raptorbitsdir/$missinglistfile"))
+ {
+ my @list = ();
+ while()
+ {
+ my $missingfile = $_;
+ chomp $missingfile;
+ $missingfile =~ s,^\s+,,g;
+ $missingfile =~ s,\s+$,,g;
+ push(@list, $missingfile);
+ }
+ close(MISSINGLIST);
- print SPECIFIC "
\n";
- print SPECIFIC "
\n";
+ $missing_by_package->{$package} = scalar(@list);
+
+ if ($missing_by_package->{$package} > 0)
+ {
+ open(SPECIFIC, ">>$outputdir/$filenamebase.html");
+ print SPECIFIC "FAILURES FOR PACKAGE $package
\n" if(!$anyfailures);
+
+ $anyfailures = 1;
+
+ print SPECIFIC "
MISSING
\n";
+ print SPECIFIC "\n";
+ # $subcategory, $severity, $mmp, $phase, $recipe, $file, $line
+ my $tableheader = "file |
\n";
+ print SPECIFIC "$tableheader\n";
+
+ for my $missingfile (sort {$a cmp $b} @list)
+ {
+ $missingfile = CGI::escapeHTML($missingfile);
+ print SPECIFIC "$missingfile |
\n";
+ }
+
+ print SPECIFIC "
\n";
+ print SPECIFIC "
\n";
+
+ close(SPECIFIC);
+ }
}
}
- close(SPECIFIC);
+ return $anyfailures;
}
sub translate_detail_files_to_html