This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unison doesn't honor HOME when USERPROFILE is set, also permission/uid/gid problems when synchronizing


>      > I don't know OCaml, but that sure looks to me as though $UNISON is only 
>     > used if $USERPROFILE and $HOME are not set.  And yet that behavior 
>     > doesn't match what I observe on my host.  So that's why I asked, what 
>     > happens if you export UNISON=/home/volker/.unison and rerun?  Does 
>     > unison use $UNISON, or $USERPROFILE/.unison?
> 
> As I told you above. It uses $UNISON also in my case.

OK.

> Probably this part from os.ml takes precedence then:
> 
> (*****************************************************************************)
> (*                           UNISON DIRECTORY                                *)
> (*****************************************************************************)
> 
> (* Gives the fspath of the archive directory on the machine, depending on    *)
> (* which OS we use                                                           *)
> let unisonDir =
>   try Fspath.canonize (Some (Unix.getenv "UNISON"))
>   with Not_found ->
>     let genericName = Util.fileInHomeDir (Printf.sprintf ".%s" Uutil.myName) in
>     if Osx.isMacOSX then
>       let osxName = Util.fileInHomeDir "Library/Application Support/Unison" in
>       if Sys.file_exists genericName then Fspath.canonize (Some genericName)
>       else Fspath.canonize (Some osxName)
>     else
>       Fspath.canonize (Some genericName)

Yes, that probably explains it.

> So the first part of my patch seems ok:
> 
>  --- util.ml.orig        2004-09-28 09:45:32.940632000 +0200
>  +++ util.ml     2004-09-28 08:40:28.926936000 +0200
>  @@ -358,10 +358,10 @@
>     match osType with
>       `Win32 ->
>         let dirString =
>  -        try Unix.getenv "USERPROFILE" (* Windows NT/2K *)
>  -        with Not_found ->
>           try Unix.getenv "HOME" (* Windows 9x with Cygwin HOME set *)
>           with Not_found ->
>  +        try Unix.getenv "USERPROFILE" (* Windows NT/2K *)
>  +        with Not_found ->
>           try Unix.getenv "UNISON" (* Use UNISON dir if none of
>                                       the above are set *)
>           with Not_found -> "c:/" (* Default *) in

No, I think it should be

 --- util.ml.orig        2004-09-28 09:45:32.940632000 +0200
 +++ util.ml     2004-09-28 08:40:28.926936000 +0200
 @@ -358,10 +358,10 @@
    match osType with
      `Win32 ->
        let dirString =
 +        try Unix.getenv "UNISON" (* Look for UNISON dir first *)
 +        with Not_found ->
          try Unix.getenv "USERPROFILE" (* Windows NT/2K *)
          with Not_found ->
          try Unix.getenv "HOME" (* Windows 9x with Cygwin HOME set *)
 -        with Not_found ->
 -        try Unix.getenv "UNISON" (* Use UNISON dir if none of
 -                                    the above are set *)
          with Not_found -> "c:/" (* Default *) in

which is what the manual says Unison is supposed to do on a Windows 
host.  Now whether Cygwin should count as a Windows host is a different 
question, which is probably harder to change.  But there might be a case 
for changing this behavior, at least, to be Unix-like instead of 
Windows-like, for Cygwin.

Anyway, as soon as I can get to it I'll pass your report and patches on 
to the unison-hackers list.  Once they approve a fix I'll release a new 
Cygwin version.

Thanks for your report.
Andrew.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]