Add a patchup script to fix up after potentially unwanted changes from bug https://github.com/kripken/emscripten/issues/4121.

This commit is contained in:
Jukka Jylänki
2016-02-20 15:10:53 +02:00
parent 9e68e895bd
commit 53e217fca6

11
emsdk
View File

@@ -1464,6 +1464,17 @@ def adjusted_path(tools_to_activate, log_additions=False, system_path_only=False
existing_path = win_get_environment_variable('PATH', system=True)
if not system_path_only: existing_path += ENVPATH_SEPARATOR + win_get_environment_variable('PATH', system=False)
existing_path = existing_path.split(ENVPATH_SEPARATOR)
# Fix up after potential changes made by bug https://github.com/kripken/emscripten/issues/4121
system_root = os.environ['SystemRoot'].lower()
for i in range(len(existing_path)):
p = existing_path[i]
if p.lower() == system_root: p = '%SystemRoot%'
elif (system_root + '\\system32') in p.lower(): p = '%SystemRoot%\\system32'
elif (system_root + '\\system32\\wbem') in p.lower(): p = '%SystemRoot%\\System32\\Wbem'
elif (system_root + '\\system32\\windowspowershell\v1.0') in p.lower(): p = '%SystemRoot%\\System32\\WindowsPowerShell\v1.0\\'
existing_path[i] = p
else:
existing_path = os.environ['PATH'].split(ENVPATH_SEPARATOR)
emsdk_root_path = to_unix_path(emsdk_path())