safe against partially matching envVars. pythonPath and Path for instance...

This commit is contained in:
Philip Eisenlohr 2011-11-09 16:41:44 +00:00
parent 41b8232695
commit 314caffc08
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ if theShell == 'bash':
for line in content: for line in content:
for envVar,data in environment.items(): for envVar,data in environment.items():
m = re.search(r'^(.*?%s=)([^;]*)(.*)$'%envVar,line) m = re.search(r'^(.*? %s=)([^;]*)(.*)$'%envVar,line)
if m: if m:
substitute = eval(data['substitute'])+[path for path in m.group(2).split(':') if eval(data['delete']) not in path] substitute = eval(data['substitute'])+[path for path in m.group(2).split(':') if eval(data['delete']) not in path]
line = m.group(1)+':'.join(substitute)+m.group(3) line = m.group(1)+':'.join(substitute)+m.group(3)