Merge filter_whatcomp improvements in. wip
authortimothy.murphy@nokia.com
Sun, 17 Jan 2010 19:47:29 +0000
branchwip
changeset 123 b748fbcd9079
parent 119 f293a5f26578 (current diff)
parent 117 ecf683438dc6 (diff)
child 124 e898967975af
Merge filter_whatcomp improvements in.
sbsv2/raptor/RELEASE-NOTES.txt
--- a/sbsv2/raptor/RELEASE-NOTES.txt	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/RELEASE-NOTES.txt	Sun Jan 17 19:47:29 2010 +0000
@@ -3,13 +3,33 @@
 
 Next version
 
-Other Changes:
-Combine Linking and Postlinking into a single step
-New 'Patchable Constants' target type: TARGETTYPE pdll
-Support exit codes from next version of the trace compiler which will issue them
-New (experimental) FilterWhatComp filter.  Simulates abld log output for use with parse_what.pl for packing up zips by component.
-New graphical build visualisation tool (bin/timelines.py). Requires pygame and PyOpenGL. 
-New a log analyser for recording the total time spent in each type of recipe in the build (recipestats.py). 
+- Combine Linking and Postlinking into a single step
+- New 'Patchable Constants' target type: TARGETTYPE pdll
+- Support exit codes from next version of the trace compiler which will issue them
+- New sbs_filter script and batchfile to ease the use of sbs_filter.py.  
+    Allows filters to be executed over a log after a build has been done.
+    e.g.
+  	sbs_filter --filters=FilterWhat < logfile.log 
+    (This runs a "--what" without regenerating any makefiles or reparsing
+    the matadata.)
+- New (beta) FilterWhatComp filter.  Simulates abld log output for
+   use with parse_what.pl for packing up zips by component.  Whatcomp output
+   uses the incoming epocroot value.  i.e. if epocroot is relative then so is
+   the what output.  e.g. if EPOCROOT=\   then the output will be of the form
+   "\epoc32\release\armv5\...."  If it's "..\myepocroot" then the output will
+   be "..\myepocroot\epoc32\release\armv5".  If it's absolute then the what
+   output will also be absolute.
+- New FilterCheck filter.  This can be used with sbs_filter to perform the 
+   equivalent of --check using the log output from a build.  It is more
+   efficient than --check because the metadata is not parsed and no makefiles
+   are generated. e.g.
+  	sbs_filter --filters=FilterCheck < logfile.log 
+- New (beta) graphical build visualisation tool (bin/timelines.py). Requires pygame
+   and PyOpenGL. e.g.  python timelines.py < filename.log
+- New (beta) log analyser (recipestats.py) for recording the total time spent in 
+   each type of recipe in the build. e.g. python recipestats.py < filename.log > stats.csv
+   The output is in CSV format.  
+
 
 
 version 2.11.3
--- a/sbsv2/raptor/bin/sbs	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/bin/sbs	Sun Jan 17 19:47:29 2010 +0000
@@ -79,7 +79,6 @@
 	__PYTHON__=$($u "$__PYTHON__")
 
 	export SBS_HOME=$($u "$SBS_HOME")
-	export EPOCROOT=$($u "$EPOCROOT")
 
 	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
 
--- a/sbsv2/raptor/bin/sbs_filter	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/bin/sbs_filter	Sun Jan 17 19:47:29 2010 +0000
@@ -57,7 +57,6 @@
 	__PYTHON__=$($u "$__PYTHON__")
 
 	export SBS_HOME=$($u "$SBS_HOME")
-	export EPOCROOT=$($u "$EPOCROOT")
 
 	export PATH=${__MINGW__}/bin:${__CYGWIN__}/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH
 
--- a/sbsv2/raptor/bin/sbs_filter.py	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/bin/sbs_filter.py	Sun Jan 17 19:47:29 2010 +0000
@@ -62,7 +62,7 @@
 	
 except Exception, e:
 	sys.stderr.write("filter exception: %s\n" % str(e))
-	traceback.print_ex()
+	traceback.print_exc()
 	sys.exit(1)
 		
 # read stdin a line at a time and pass it to the Raptor object
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/python/plugins/filter_check.py	Sun Jan 17 19:47:29 2010 +0000
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+# Filter class for doing --what and --check operations
+#
+
+import os
+import sys
+import re
+import filter_interface
+import filter_what
+
+class FilterCheck(filter_what.FilterWhat):
+
+        def __init__(self): 
+		super(filter_what.FilterWhat,self).__init__()
+		self.check = True
+
--- a/sbsv2/raptor/python/plugins/filter_what.py	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/python/plugins/filter_what.py	Sun Jan 17 19:47:29 2010 +0000
@@ -22,6 +22,10 @@
 
 class FilterWhat(filter_interface.Filter):
 
+	def __init__(self):
+		super(filter_interface.Filter,self).__init__(self)
+		self.path_prefix_to_strip = None
+		self.path_prefix_to_add_on = None
 	
 	def print_file(self, line, start, end):
 		"Ensure DOS slashes on Windows"
@@ -33,6 +37,12 @@
 			filename = line[(start + 1):end].replace("/","\\")
 		else:
 			filename = line[(start + 1):end]
+
+		if self.path_prefix_to_strip:
+			if filename.startswith(self.path_prefix_to_strip):
+				filename = filename[len(self.path_prefix_to_strip):]
+			if self.path_prefix_to_add_on != None:
+				filename = self.path_prefix_to_add_on + filename
 			
 		if self.check:
 			if not os.path.isfile(filename):
--- a/sbsv2/raptor/python/plugins/filter_whatcomp.py	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/python/plugins/filter_whatcomp.py	Sun Jan 17 19:47:29 2010 +0000
@@ -23,11 +23,15 @@
 
 class FilterWhatComp(filter_what.FilterWhat):
 
+        def __init__(self): 
+		super(filter_what.FilterWhat, self).__init__()
+
 	def write(self, text):
 		"process some log text"
+		ok = True
 		
 		for line in text.splitlines():
-			ok =filter_what.FilterWhat.write(self, line)
+			ok = filter_what.FilterWhat.write(self, line)
 			if not ok:
 				break
 				
@@ -44,3 +48,9 @@
 		
 	def end_bldinf(self):
 		self.outfile.write("++ Finished\n")
+
+        def open(self, build_parameters):
+		t = filter_what.FilterWhat.open(self, build_parameters)
+		self.path_prefix_to_strip = os.path.abspath(build_parameters.epocroot)
+		self.path_prefix_to_add_on = build_parameters.incoming_epocroot
+		return t
--- a/sbsv2/raptor/python/raptor.py	Fri Jan 15 20:20:21 2010 +0000
+++ b/sbsv2/raptor/python/raptor.py	Sun Jan 17 19:47:29 2010 +0000
@@ -58,12 +58,15 @@
 # defaults can use EPOCROOT
 
 if "EPOCROOT" in os.environ:
-        epocroot = os.environ["EPOCROOT"].replace("\\","/")
+	incoming_epocroot = os.environ["EPOCROOT"]
+        epocroot = incoming_epocroot.replace("\\","/")
 else:
 	if 'linux' in hostplatform:
 		epocroot=os.environ['HOME'] + os.sep + "epocroot"
 		os.environ["EPOCROOT"] = epocroot
+		incoming_epocroot = epocroot
 	else:
+		incoming_epocroot = "\\"
 		epocroot = "/"
 		os.environ["EPOCROOT"] = os.sep
 
@@ -1334,6 +1337,8 @@
 class BuildStats(object):
 
 	def __init__(self, raptor_instance):
+		self.incoming_epocroot = incoming_epocroot
+		self.epocroot = epocroot
 		self.logFileName = raptor_instance.logFileName
 		self.quiet = raptor_instance.quiet
 		self.doCheck = raptor_instance.doCheck