# HG changeset patch # User Jon Chatten # Date 1260459348 0 # Node ID f520dfd220258fc5790cd38765ef205072aee39d # Parent 28ee654acf4290d3b22aae6e0af05120b9262907 Correct backslash escaping to only operate on non-'path' and 'tool' types. diff -r 28ee654acf42 -r f520dfd22025 sbsv2/raptor/python/raptor_data.py --- a/sbsv2/raptor/python/raptor_data.py Wed Dec 09 18:30:33 2009 +0000 +++ b/sbsv2/raptor/python/raptor_data.py Thu Dec 10 15:35:48 2009 +0000 @@ -724,14 +724,6 @@ value = os.environ[self.name] if value: - # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character in makefile - # parsing - un-escaped backslashes at the end of values are therefore escaped - if value.endswith('\\'): - # an odd number of backslashes means there's one to escape - count = len(value) - len(value.rstrip('\\')) - if count % 2: - value += '\\' - # if this value is a "path" or a "tool" then we need to make sure # it is a proper absolute path in our preferred format. if self.type == "path" or self.type == "tool": @@ -739,7 +731,14 @@ path = generic_path.Path(value) value = str(path.Absolute()) except ValueError,e: - raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e))) + raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e))) + # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character + # in makefile parsing - un-escaped backslashes at the end of values are therefore escaped + elif value.endswith('\\'): + # an odd number of backslashes means there's one to escape + count = len(value) - len(value.rstrip('\\')) + if count % 2: + value += '\\' except KeyError: if self.default != None: value = self.default