Open akudiyar opened 7 years ago
I will try to check if it doesn't break cygwin support later.
But I would also like this change to be a bit more generic. Currently you handle it so that if custom rsync path is set, it's not a cygwin rsync. If it's not set, you assume it is cygwin. This is really weird and would be hard to understand. It's equally useful to be able to specify path of the cygwin rsync as it is useful to specify path to msys rsync or even native rsync on Linux or Mac. So I would love for the fix to handle that better. I don't have immediate idea how to do that, but I'll sit and think about it later. Maybe it would be necessary to introduce another setting to specify that it's a cygwin variant, but ideally it would be handled automatically.
The only difference between non-cygwin and cygwin workflows is path normalization. So it seems better having an additional option "paths":
paths := cygwin | linux | default
cygwin := normalize and apply cygpath
linux := normalize
default := os specific paths
So the workflow will look like this:
if (rsync binary path specified)
use rsync binary
else
assume rsync is in PATH
if (os is windows)
switch ("paths")
case ("cygwin"):
apply cygpath (apply normalize)
case ("linux"):
apply normalize
default:
set cwd
Automatic search for rsync is difficult and IMO not necessary.
Why would you need 'linux' paths variant on Windows? Wouldn't it be enough to have 'cygwin' and 'default'?
I suppose there are versions of rsync under Windows which accept only linux paths as parameters. In this case normalization of rsync binary path should not be performed, though.
Add an option: rsync_binary If this option is set, it contains the path to rsync executable. In this case no Cygwin environment is used and no local path normalization is needed. I'm using this abilty on my machine with MinGW + MSYS instead of Cygwin (and many others consider such setup better).