sbsv2/raptor/python/plugins/filter_what.py
author timothy.murphy@nokia.com
Wed, 16 Dec 2009 15:25:49 +0000
branchwip
changeset 114 35ed82e9d574
parent 100 55250667c668
child 115 5869e06bf2ac
permissions -rw-r--r--
Strip epocroot off whatcomp filter output.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     1
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     2
# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     3
# All rights reserved.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     4
# This component and the accompanying materials are made available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     6
# which accompanies this distribution, and is available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     8
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     9
# Initial Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    10
# Nokia Corporation - initial contribution.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    11
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    12
# Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    13
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    14
# Description: 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    15
# Filter class for doing --what and --check operations
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    16
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    17
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    18
import os
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    19
import sys
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    20
import re
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    21
import filter_interface
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    22
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    23
class FilterWhat(filter_interface.Filter):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    24
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    25
	def __init__(self):
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    26
		super(filter_interface.Filter,self).__init__(self)
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    27
		self.path_prefix_to_strip = None
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    28
		print "HELLO=------"
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    29
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    30
	def print_file(self, line, start, end):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    31
		"Ensure DOS slashes on Windows"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    32
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    33
		"""Use chars between enclosing tags ("<>", "''", etc)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    34
				start = opening tag, so the line we need
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    35
				actually starts at 'start + 1' """
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    36
		if "win" in self.buildparameters.platform:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    37
			filename = line[(start + 1):end].replace("/","\\")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    38
		else:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    39
			filename = line[(start + 1):end]
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    40
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    41
		if self.path_prefix_to_strip:
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    42
			if filename.startswith(self.path_prefix_to_strip):
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 100
diff changeset
    43
				filename = filename[len(self.path_prefix_to_strip):]
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    44
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    45
		if self.check:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    46
			if not os.path.isfile(filename):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    47
				print "MISSING:", filename
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    48
				self.ok = False
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    49
		else:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    50
			self.outfile.write(filename+"\n")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    51
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
    52
		self.prints += 1
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    53
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    54
	def start_bldinf(self, bldinf):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    55
		pass
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    56
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    57
	def end_bldinf(self):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    58
		pass
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
    59
		
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    60
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    61
	def open(self, build_parameters):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    62
		"initialise"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    63
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    64
		self.buildparameters = build_parameters
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    65
		self.check = build_parameters.doCheck
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    66
		self.what = build_parameters.doWhat
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    67
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    68
		self.outfile = sys.stdout
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    69
		self.outfile_close = False
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    70
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    71
		if "FILTERWHAT_FILE" in os.environ:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    72
			try:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    73
				self.outfile = open(os.environ['FILTERWHAT_FILE'],"w+")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    74
				self.outfile_close = True
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    75
			except Exception,e:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    76
				raise Exception("The 'What Filter' could not open the output file specified in the FILTER_WHAT environment variable: " + os.environ['FILTERWHAT_FILE'])
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    77
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    78
		# repetitions is for tracking repeated lines in the output log
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    79
		# when --check and --what are called
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    80
		self.repetitions = {}
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    81
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    82
		"Regex for old what output"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    83
		if "win" in self.buildparameters.platform:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    84
			self.regex = re.compile("^[a-zA-Z]:\S+$")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    85
		else:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    86
			self.regex = re.compile("^/\S+$")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    87
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    88
		"Regex for targets"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    89
		self.target_regex = re.compile("^<(build|stringtable|resource|bitmap)>.*")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    90
			
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    91
		"Regex for exports"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    92
		self.export_regex = re.compile("^<export destination.*")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    93
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    94
		"Regex for zip exports"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    95
		self.zip_export_regex = re.compile("^<member>.*")
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    96
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    97
		"Regex for determining bld.inf name"
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    98
		self.whatlog_regex = re.compile("^<whatlog *bldinf='(?P<bldinf>[^']*)'.*")
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
    99
		self.current_bldinf = ''
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   100
		
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   101
		self.prints = 0
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   102
		self.ok = True		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   103
		return self.ok
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   104
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   105
	def write(self, text):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   106
		"process some log text"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   107
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   108
		for line in text.splitlines():
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   109
			line = line.rstrip()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   110
			
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   111
			# we are normally the ONLY filter running so we have to pass on
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   112
			# any errors and warnings that emerge
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   113
			#
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   114
			if line.startswith("<error"):
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   115
				sys.stderr.write(self.formatError(line))
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   116
				self.ok = False
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   117
				continue
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   118
			if line.startswith("<warning"):
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   119
				sys.stderr.write(self.formatWarning(line))
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   120
				continue
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   121
				
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   122
			if not line in self.repetitions:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   123
				self.repetitions[line] = 0
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   124
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   125
			if self.repetitions[line] == 0:
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   126
				
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   127
				if self.regex.match(line) and (self.what or self.check):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   128
					"Print the whole line"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   129
					self.print_file(line, (-1), len(line))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   130
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   131
				if self.target_regex.match(line):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   132
					"Grab the filename between <build> and </build>" 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   133
					start = line.find(">")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   134
					end = line.rfind("<")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   135
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   136
					self.print_file(line, start, end)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   137
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   138
				elif self.export_regex.match(line):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   139
					"Grab the filename between the first set of '' chars" 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   140
					start = line.find("'")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   141
					end = line.find("'", (start + 1))
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   142
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   143
					self.print_file(line, start, end)
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   144
						
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   145
				elif self.zip_export_regex.match(line):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   146
					"Grab the filename between <member> and </member>" 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   147
					start = line.find(">")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   148
					end = line.rfind("<")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   149
					
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   150
					self.print_file(line, start, end)
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   151
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   152
				else:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   153
					"work out what the 'current' bldinf file is"
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   154
					m = self.whatlog_regex.match(line)
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   155
					if m:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   156
						bi = m.groupdict()['bldinf']
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   157
						if self.current_bldinf != bi:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   158
							if self.current_bldinf != '':
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   159
								self.end_bldinf()
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   160
							self.current_bldinf = bi
100
55250667c668 apply review comments:
timothy.murphy@nokia.com
parents: 93
diff changeset
   161
							if bi != '':
55250667c668 apply review comments:
timothy.murphy@nokia.com
parents: 93
diff changeset
   162
								self.start_bldinf(bi)
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   163
							
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents: 9
diff changeset
   164
					
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   165
						
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   166
			self.repetitions[line] += 1
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   167
				
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   168
		return self.ok
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   169
	
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   170
	def summary(self):
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   171
		if self.prints == 0:
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   172
			if self.what:
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   173
				message = "no WHAT information found"
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   174
			else:
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   175
				message = "no CHECK information found"
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   176
				
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   177
			sys.stderr.write(self.formatError(message))
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   178
			self.ok = False
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   179
		return self.ok
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 3
diff changeset
   180
		
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   181
	def close(self):
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   182
		if self.outfile_close:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   183
			self.outfile.close()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   184
		return self.ok
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   185
						
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
   186