sbsv2/raptor/python/plugins/filter_what.py
changeset 18 de5b887c98f7
parent 13 c327db0664bb
equal deleted inserted replaced
14:eb060913c963 18:de5b887c98f7
    88 			except Exception,e:
    88 			except Exception,e:
    89 				raise Exception("The 'What Filter' could not open the output file specified in the FILTER_WHAT environment variable: " + os.environ['FILTERWHAT_FILE'])
    89 				raise Exception("The 'What Filter' could not open the output file specified in the FILTER_WHAT environment variable: " + os.environ['FILTERWHAT_FILE'])
    90 		
    90 		
    91 		# repetitions is for tracking repeated lines in the output log
    91 		# repetitions is for tracking repeated lines in the output log
    92 		# when --check and --what are called
    92 		# when --check and --what are called
    93 		self.repetitions = {}
    93 		self.repetitions = {}	
    94 		
       
    95 		"Regex for old what output"
       
    96 		if "win" in self.buildparameters.platform:
       
    97 			self.regex = re.compile("^[a-zA-Z]:\S+$")
       
    98 		else:
       
    99 			self.regex = re.compile("^/\S+$")
       
   100 		
    94 		
   101 		"Regex for targets"
    95 		"Regex for targets"
   102 		self.target_regex = re.compile("^<(build|stringtable|resource|bitmap)>.*")
    96 		self.target_regex = re.compile("^<(build|stringtable|resource|bitmap)>.*")
   103 			
    97 			
   104 		"Regex for exports"
    98 		"Regex for exports"
   134 				
   128 				
   135 			if not line in self.repetitions:
   129 			if not line in self.repetitions:
   136 				self.repetitions[line] = 0
   130 				self.repetitions[line] = 0
   137 				
   131 				
   138 			if self.repetitions[line] == 0:
   132 			if self.repetitions[line] == 0:
   139 				
       
   140 				if self.regex.match(line) and (self.what or self.check):
       
   141 					"Print the whole line"
       
   142 					self.print_file(line, (-1), len(line))
       
   143 					
   133 					
   144 				if self.target_regex.match(line):
   134 				if self.target_regex.match(line):
   145 					"Grab the filename between <build> and </build>" 
   135 					"Grab the filename between <build> and </build>" 
   146 					start = line.find(">")
   136 					start = line.find(">")
   147 					end = line.rfind("<")
   137 					end = line.rfind("<")