Skip to content
Snippets Groups Projects
Commit dd3292a5 authored by Timothee Besset's avatar Timothee Besset
Browse files

fix the new cygwin tools lookup, we don't want to pickup non-cygwin rsync.exe...

fix the new cygwin tools lookup, we don't want to pickup non-cygwin rsync.exe or ssh.exe that may happen to be in the path
parent d8277a9a
No related branches found
No related tags found
No related merge requests found
...@@ -242,10 +242,13 @@ def _locate_external_tool(name): ...@@ -242,10 +242,13 @@ def _locate_external_tool(name):
ret = os.path.join(r'C:\cygwin64\bin', name) ret = os.path.join(r'C:\cygwin64\bin', name)
if os.path.exists(ret): if os.path.exists(ret):
return ret return ret
# Look for the first thing in PATH, that would be the 'preferred' cygwin install if that's setup # Look for cygpath.exe in system PATH, that would be the 'preferred' cygwin install if that's setup
ret = shutil.which(name) # (don't look for 'name' e.g. ssh.exe lest you find Windows SSH which is not what we're looking for here)
ret = shutil.which('cygpath.exe')
if ret is not None: if ret is not None:
return ret ret = os.path.join(os.path.dirname(ret), name)
if os.path.exists(ret):
return ret
# Go poke at the registry then # Go poke at the registry then
CYGWIN_KEY = "SOFTWARE\\Cygwin\\setup" CYGWIN_KEY = "SOFTWARE\\Cygwin\\setup"
for hk in (winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER): for hk in (winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment