uh_parser/RaptorUnreciped.pm
changeset 233 cf1d34408de3
parent 232 0244765a8d6f
child 236 8a3d46cfe8b5
equal deleted inserted replaced
232:0244765a8d6f 233:cf1d34408de3
   137 }
   137 }
   138 
   138 
   139 sub on_start_buildlog
   139 sub on_start_buildlog
   140 {
   140 {
   141 	RaptorCommon::init();
   141 	RaptorCommon::init();
   142 	
       
   143 	$filename = "$::raptorbitsdir/raptor_unreciped.txt";
       
   144 	if (!-f$filename)
       
   145 	{
       
   146 		print "Writing unreciped file $filename\n";
       
   147 		open(FILE, ">$filename");
       
   148 		close(FILE);
       
   149 	}
       
   150 }
   142 }
   151 
   143 
   152 sub on_chars_buildlog
   144 sub on_chars_buildlog
   153 {
   145 {
   154 	my ($ch) = @_;
   146 	my ($ch) = @_;
   178 	#print "characters is -->$characters<--\n";
   170 	#print "characters is -->$characters<--\n";
   179 	
   171 	
   180 	my @lines = split(/[\r\n]/, $characters);
   172 	my @lines = split(/[\r\n]/, $characters);
   181 	for my $line (@lines)
   173 	for my $line (@lines)
   182 	{
   174 	{
       
   175 		my $package = '';
       
   176 		my $guessed_bldinf = '';
       
   177 		# if bldinf attribute is not available then heuristically attempt to determine the package
       
   178 		if ($line =~ m,.*?(([/\\]sf)?[/\\](os|mw|app|tools|ostools|adaptation)[/\\][^/^\\]*[/\\]),s)
       
   179 		{
       
   180 			$guessed_bldinf = "$1... (guessed)";
       
   181 		}
       
   182 		
       
   183 		if ($guessed_bldinf)
       
   184 		{
       
   185 			$::allbldinfs->{$guessed_bldinf} = 1;
       
   186 			
       
   187 			# normalize bldinf path
       
   188 			$guessed_bldinf = lc($guessed_bldinf);
       
   189 			$guessed_bldinf =~ s,^[A-Za-z]:,,;
       
   190 			$guessed_bldinf =~ s,[\\],/,g;
       
   191 			
       
   192 			if ($guessed_bldinf =~ m,/((os|mw|app|tools|ostools|adaptation)/[^/]*),)
       
   193 			{
       
   194 				$package = $1;
       
   195 				$package =~ s,/,_,;
       
   196 			}
       
   197 		}
       
   198 			
   183 		if ($line =~ m,[^\s^\r^\n],)
   199 		if ($line =~ m,[^\s^\r^\n],)
   184 		{
   200 		{
   185 			my $dumped = process($line, $::current_log_file, '', '', '', '', "raptor_unreciped.txt");
   201 			$filename = "$::raptorbitsdir/raptor_unreciped.txt";
       
   202 			$filename = "$::raptorbitsdir/$package.txt" if ($package);
       
   203 			my $filenamewnopath = "raptor_unreciped.txt";
       
   204 			$filenamewnopath = "$package.txt" if ($package);
       
   205 			
       
   206 			if (!-f$filename)
       
   207 			{
       
   208 				print "Writing file $filename\n";
       
   209 				open(FILE, ">$filename");
       
   210 				close(FILE);
       
   211 			}
       
   212 		
       
   213 			my $dumped = process($line, $::current_log_file, $guessed_bldinf, '', '', '', $filenamewnopath);
   186 			
   214 			
   187 			if ($dumped)
   215 			if ($dumped)
   188 			{
   216 			{
   189 				open(FILE, ">>$filename");
   217 				open(FILE, ">>$filename");
   190 				print FILE "---failure_item_$::failure_item_number\---\n";
   218 				print FILE "---failure_item_$::failure_item_number\---\n";