Protect some parameters from bash, e.g. ";" and "\" wip
authorraptorbot <raptorbot@systemstesthead.symbian.intra>
Sun, 17 Jan 2010 15:44:38 +0000
branchwip
changeset 122 816955f04aaa
parent 121 5e5ae3e212b3
child 126 7309affc5a05
Protect some parameters from bash, e.g. ";" and "\"
sbsv2/raptor/python/raptor_make.py
--- a/sbsv2/raptor/python/raptor_make.py	Sat Jan 16 00:01:04 2010 +0000
+++ b/sbsv2/raptor/python/raptor_make.py	Sun Jan 17 15:44:38 2010 +0000
@@ -418,7 +418,13 @@
 			command += " " + self.defaultMakeOptions
 			# Can supply options on the commandline to override default settings.
 			if len(self.raptor.makeOptions) > 0:
-				command += " " + " ".join(self.raptor.makeOptions)
+				for o in self.raptor.makeOptions:
+					if o.find(";") != -1:
+						command += "  " + "'" + o + "'"
+					elif o.find("\\") != -1:
+						command += "  " + o.replace("\\","\\\\")
+					else:
+						command += "  " + o
 
 			# Switch off dependency file including?
 			if self.raptor.noDependInclude:
@@ -454,7 +460,7 @@
 			# Send stderr to a file so that it can't mess up the log (e.g.
 			# clock skew messages from some build engines.
 			stderrfilename = makefile+'.stderr'
-			command += ' 2>"%s"' % stderrfilename
+			command += " 2>'%s' " % stderrfilename
 
 			# Substitute the makefile name for any occurrence of #MAKEFILE#
 			command = command.replace("#MAKEFILE#", str(makefile))