uh_parser/RaptorUnreciped.pm
changeset 186 b76adfbc6648
parent 185 978ef35b4e5f
child 188 dbf40764ca6a
equal deleted inserted replaced
185:978ef35b4e5f 186:b76adfbc6648
    35 $buildlog_subtag_status->{next_status} = {};
    35 $buildlog_subtag_status->{next_status} = {};
    36 $buildlog_subtag_status->{on_start} = 'RaptorUnreciped::on_start_buildlog_subtag';
    36 $buildlog_subtag_status->{on_start} = 'RaptorUnreciped::on_start_buildlog_subtag';
    37 $buildlog_subtag_status->{on_end} = 'RaptorUnreciped::on_end_buildlog_subtag';
    37 $buildlog_subtag_status->{on_end} = 'RaptorUnreciped::on_end_buildlog_subtag';
    38 
    38 
    39 my $filename = '';
    39 my $filename = '';
    40 my $failure_item = 0;
       
    41 
    40 
    42 my $characters = '';
    41 my $characters = '';
    43 my $store_chars = 1;
    42 my $store_chars = 1;
    44 
    43 
    45 my $CATEGORY_RAPTORUNRECIPED = 'raptor_unreciped';
    44 my $CATEGORY_RAPTORUNRECIPED = 'raptor_unreciped';
    52 my $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGETNEEDEDBY = 'make_no_rule_to_make_target_needed_by';
    51 my $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGETNEEDEDBY = 'make_no_rule_to_make_target_needed_by';
    53 my $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGET = 'make_no_rule_to_make_target';
    52 my $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGET = 'make_no_rule_to_make_target';
    54 
    53 
    55 sub process
    54 sub process
    56 {
    55 {
    57 	my ($text, $logfile, $component, $mmp, $phase, $recipe, $file, $line) = @_;
    56 	my ($text, $logfile, $component, $mmp, $phase, $recipe, $file) = @_;
       
    57 	
       
    58 	my $dumped = 1;
    58 
    59 
    59 	my $category = $CATEGORY_RAPTORUNRECIPED;	
    60 	my $category = $CATEGORY_RAPTORUNRECIPED;	
    60 	my $severity = '';
    61 	my $severity = '';
    61 	my $subcategory = '';
    62 	my $subcategory = '';
    62 	
    63 	
    63 	if ($text =~ m,make\.exe: \*\*\* No rule to make target,)
    64 	if ($text =~ m,make\.exe: \*\*\* No rule to make target,)
    64 	{
    65 	{
    65 		$severity = $RaptorCommon::SEVERITY_MAJOR;
    66 		$severity = $RaptorCommon::SEVERITY_MAJOR;
    66 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_NORULETOMAKETARGET;
    67 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_NORULETOMAKETARGET;
    67 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
    68 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
    68 	}
    69 	}
    69 	elsif ($text =~ m,make\.exe: Target .* not remade because of errors,)
    70 	elsif ($text =~ m,make\.exe: Target .* not remade because of errors,)
    70 	{
    71 	{
    71 		$severity = $RaptorCommon::SEVERITY_MINOR;
    72 		$severity = $RaptorCommon::SEVERITY_MINOR;
    72 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_TARGETNOTREMADEFORERRORS;
    73 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_TARGETNOTREMADEFORERRORS;
    73 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
    74 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
    74 	}
    75 	}
    75 	elsif ($text =~ m,: warning: ignoring old commands for target,)
    76 	elsif ($text =~ m,: warning: ignoring old commands for target,)
    76 	{
    77 	{
    77 		# don't dump
    78 		# don't dump
       
    79 		$dumped = 0;
    78 	}
    80 	}
    79 	elsif ($text =~ m,: warning: overriding commands for target,)
    81 	elsif ($text =~ m,: warning: overriding commands for target,)
    80 	{
    82 	{
    81 		$severity = $RaptorCommon::SEVERITY_MINOR;
    83 		$severity = $RaptorCommon::SEVERITY_MINOR;
    82 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_OVERRIDINGCOMMANDSFORTARGET;
    84 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_OVERRIDINGCOMMANDSFORTARGET;
    83 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
    85 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
    84 	}
    86 	}
    85 	elsif ($text =~ m,^make: Target .* not remade because of errors\.,)
    87 	elsif ($text =~ m,^make: Target .* not remade because of errors\.,)
    86 	{
    88 	{
    87 		$severity = $RaptorCommon::SEVERITY_MINOR;
    89 		$severity = $RaptorCommon::SEVERITY_MINOR;
    88 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_TARGETNOTREMADEBECAUSEOFERRORS;
    90 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_TARGETNOTREMADEBECAUSEOFERRORS;
    89 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
    91 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
    90 	}
    92 	}
    91 	elsif ($text =~ m,^make: \*\*\* .* Error 1,)
    93 	elsif ($text =~ m,^make: \*\*\* .* Error 1,)
    92 	{
    94 	{
    93 		$severity = $RaptorCommon::SEVERITY_MINOR;
    95 		$severity = $RaptorCommon::SEVERITY_MINOR;
    94 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_ERROR1;
    96 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_ERROR1;
    95 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
    97 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
    96 	}
    98 	}
    97 	elsif ($text =~ m,^make: \*\*\* No rule to make target .*\ needed by .*,)
    99 	elsif ($text =~ m,^make: \*\*\* No rule to make target .*\ needed by .*,)
    98 	{
   100 	{
    99 		$severity = $RaptorCommon::SEVERITY_MINOR;
   101 		$severity = $RaptorCommon::SEVERITY_MINOR;
   100 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGETNEEDEDBY;
   102 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGETNEEDEDBY;
   101 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
   103 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
   102 	}
   104 	}
   103 	elsif ($text =~ m,^make: \*\*\* No rule to make target .*,)
   105 	elsif ($text =~ m,^make: \*\*\* No rule to make target .*,)
   104 	{
   106 	{
   105 		$severity = $RaptorCommon::SEVERITY_MINOR;
   107 		$severity = $RaptorCommon::SEVERITY_MINOR;
   106 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGET;
   108 		my $subcategory = $CATEGORY_RAPTORUNRECIPED_MAKE_NORULETOMAKETARGET;
   107 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
   109 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
   108 	}
   110 	}
   109 	elsif ($text =~ m,^make: Nothing to be done for .*,)
   111 	elsif ($text =~ m,^make: Nothing to be done for .*,)
   110 	{
   112 	{
   111 		# don't dump
   113 		# don't dump
       
   114 		$dumped = 0;
   112 	}
   115 	}
   113 	elsif ($text =~ m,^(true|false)$,)
   116 	elsif ($text =~ m,^(true|false)$,)
   114 	{
   117 	{
   115 		# don't dump
   118 		# don't dump
       
   119 		$dumped = 0;
   116 	}
   120 	}
   117 	elsif ($text =~ m,win32/cygwin/bin/cp\.exe,)
   121 	elsif ($text =~ m,win32/cygwin/bin/cp\.exe,)
   118 	{
   122 	{
   119 		# don't dump
   123 		# don't dump
       
   124 		$dumped = 0;
   120 	}
   125 	}
   121 	elsif ($text =~ m,epoc32/tools/svgtbinencode\.exe,)
   126 	elsif ($text =~ m,epoc32/tools/svgtbinencode\.exe,)
   122 	{
   127 	{
   123 		# don't dump
   128 		# don't dump
       
   129 		$dumped = 0;
   124 	}
   130 	}
   125 	elsif ($text =~ m,win32/cygwin/bin/chmod\.exe a\+rw,)
   131 	elsif ($text =~ m,win32/cygwin/bin/chmod\.exe a\+rw,)
   126 	{
   132 	{
   127 		# don't dump
   133 		# don't dump
       
   134 		$dumped = 0;
   128 	}
   135 	}
   129 	else # log everything by default
   136 	else # log everything by default
   130 	{
   137 	{
   131 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
   138 		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file);
   132 	}
   139 	}
       
   140 	
       
   141 	return $dumped;
   133 }
   142 }
   134 
   143 
   135 sub on_start_buildlog
   144 sub on_start_buildlog
   136 {
   145 {
   137 	RaptorCommon::init();
   146 	RaptorCommon::init();
   176 	my @lines = split(/[\r\n]/, $characters);
   185 	my @lines = split(/[\r\n]/, $characters);
   177 	for my $line (@lines)
   186 	for my $line (@lines)
   178 	{
   187 	{
   179 		if ($line =~ m,[^\s^\r^\n],)
   188 		if ($line =~ m,[^\s^\r^\n],)
   180 		{
   189 		{
   181 			#print "dumping chars\n";
   190 			my $dumped = process($line, $::current_log_file, '', '', '', '', "raptor_unreciped.txt");
   182 			
   191 			
   183 			if ($failure_item == 0 and -f "$filename")
   192 			if ($dumped)
   184 			{
   193 			{
   185 				open(FILE, "$filename");
   194 				open(FILE, ">>$filename");
   186 				{
   195 				print FILE "---failure_item_$::failure_item_number\---\n";
   187 					local $/ = undef;
   196 				print FILE "$line\n\n";
   188 					my $filecontent = <FILE>;
       
   189 					$failure_item = $1 if ($filecontent =~ m/.*---failure_item_(\d+)/s);
       
   190 				}
       
   191 				close(FILE);
   197 				close(FILE);
   192 			}
   198 			}
   193 			
       
   194 			$failure_item++;
       
   195 							
       
   196 			open(FILE, ">>$filename");
       
   197 			print FILE "---failure_item_$failure_item\---\n";
       
   198 			print FILE "$line\n\n";
       
   199 			close(FILE);
       
   200 			
       
   201 			process($line, $::current_log_file, '', '', '', '', "raptor_unreciped.txt", $failure_item);
       
   202 		}
   199 		}
   203 	}
   200 	}
   204 	
   201 	
   205 	$characters = '';
   202 	$characters = '';
   206 	$store_chars = 0;
   203 	$store_chars = 0;