delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/28/13:42:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: unison doesn't honor HOME when USERPROFILE is set, also permission/uid/gid problems when synchronizing
References: <87oejqvmsl DOT fsf AT vzell-de DOT de DOT oracle DOT com> <MPG DOT 1bc3442639d8f8549896a6 AT localhost> <87hdpiqpzu DOT fsf AT vzell-de DOT de DOT oracle DOT com> <MPG DOT 1bc36800faece93a9896a7 AT localhost>
From: "Dr. Volker Zell" <Dr DOT Volker DOT Zell AT oracle DOT com>
Date: Tue, 28 Sep 2004 19:42:57 +0200
In-Reply-To: <MPG.1bc36800faece93a9896a7@localhost> (Andrew Schulman's message of "Tue, 28 Sep 2004 13:23:03 -0400")
Message-ID: <87fz52p9we.fsf@vzell-de.de.oracle.com>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, cygwin32)
MIME-Version: 1.0
X-IsSubscribed: yes

>>>>> Andrew Schulman writes:

     > 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.

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)

(* build a fspath representing an archive child path whose name is given
*)


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

Ciao
  Volker


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019