# HG changeset patch # User Dario Sestito # Date 1270832602 -3600 # Node ID cf1d34408de3d0f33d58e3a623bc0ae4619054fd # Parent 0244765a8d6f2360eb43ab3220a5f8c26717b2d1 Add heuristic determination of package for Raptor unreciped text diff -r 0244765a8d6f -r cf1d34408de3 uh_parser/RaptorError.pm --- a/uh_parser/RaptorError.pm Fri Apr 09 17:38:33 2010 +0100 +++ b/uh_parser/RaptorError.pm Fri Apr 09 18:03:22 2010 +0100 @@ -212,6 +212,8 @@ { $filename = "$::raptorbitsdir/raptor_error.txt"; $filename = "$::raptorbitsdir/$package.txt" if ($package); + my $filenamewnopath = "raptor_error.txt"; + $filenamewnopath = "$package.txt" if ($package); if (!-f$filename) { @@ -220,7 +222,7 @@ close(FILE); } - my $dumped = process($characters, $::current_log_file, $raptor_error_info->{bldinf}, '', '', '', "$package.txt"); + my $dumped = process($characters, $::current_log_file, $raptor_error_info->{bldinf}, '', '', '', $filenamewnopath); if ($dumped) { diff -r 0244765a8d6f -r cf1d34408de3 uh_parser/RaptorUnreciped.pm --- a/uh_parser/RaptorUnreciped.pm Fri Apr 09 17:38:33 2010 +0100 +++ b/uh_parser/RaptorUnreciped.pm Fri Apr 09 18:03:22 2010 +0100 @@ -139,14 +139,6 @@ sub on_start_buildlog { RaptorCommon::init(); - - $filename = "$::raptorbitsdir/raptor_unreciped.txt"; - if (!-f$filename) - { - print "Writing unreciped file $filename\n"; - open(FILE, ">$filename"); - close(FILE); - } } sub on_chars_buildlog @@ -180,9 +172,45 @@ my @lines = split(/[\r\n]/, $characters); for my $line (@lines) { + my $package = ''; + my $guessed_bldinf = ''; + # if bldinf attribute is not available then heuristically attempt to determine the package + if ($line =~ m,.*?(([/\\]sf)?[/\\](os|mw|app|tools|ostools|adaptation)[/\\][^/^\\]*[/\\]),s) + { + $guessed_bldinf = "$1... (guessed)"; + } + + if ($guessed_bldinf) + { + $::allbldinfs->{$guessed_bldinf} = 1; + + # normalize bldinf path + $guessed_bldinf = lc($guessed_bldinf); + $guessed_bldinf =~ s,^[A-Za-z]:,,; + $guessed_bldinf =~ s,[\\],/,g; + + if ($guessed_bldinf =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),) + { + $package = $1; + $package =~ s,/,_,; + } + } + if ($line =~ m,[^\s^\r^\n],) { - my $dumped = process($line, $::current_log_file, '', '', '', '', "raptor_unreciped.txt"); + $filename = "$::raptorbitsdir/raptor_unreciped.txt"; + $filename = "$::raptorbitsdir/$package.txt" if ($package); + my $filenamewnopath = "raptor_unreciped.txt"; + $filenamewnopath = "$package.txt" if ($package); + + if (!-f$filename) + { + print "Writing file $filename\n"; + open(FILE, ">$filename"); + close(FILE); + } + + my $dumped = process($line, $::current_log_file, $guessed_bldinf, '', '', '', $filenamewnopath); if ($dumped) { diff -r 0244765a8d6f -r cf1d34408de3 uh_parser/RaptorWarning.pm --- a/uh_parser/RaptorWarning.pm Fri Apr 09 17:38:33 2010 +0100 +++ b/uh_parser/RaptorWarning.pm Fri Apr 09 18:03:22 2010 +0100 @@ -151,6 +151,8 @@ { $filename = "$::raptorbitsdir/raptor_warning.txt"; $filename = "$::raptorbitsdir/$package.txt" if ($package); + my $filenamewnopath = "raptor_warning.txt"; + $filenamewnopath = "$package.txt" if ($package); if (!-f$filename) { @@ -159,7 +161,7 @@ close(FILE); } - my $dumped = process($characters, $::current_log_file, $raptor_warning_info->{bldinf}, '', '', '', "$package.txt"); + my $dumped = process($characters, $::current_log_file, $raptor_warning_info->{bldinf}, '', '', '', $filenamewnopath); if ($dumped) {