Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 From: Andrew Schulman Subject: Re: unison doesn't honor HOME when USERPROFILE is set, also permission/uid/gid problems when synchronizing Date: Tue, 28 Sep 2004 14:10:32 -0400 Lines: 79 Message-ID: References: <87oejqvmsl DOT fsf AT vzell-de DOT de DOT oracle DOT com> <87hdpiqpzu DOT fsf AT vzell-de DOT de DOT oracle DOT com> <87fz52p9we DOT fsf AT vzell-de DOT de DOT oracle DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: pcp04398386pcs.nrockv01.md.comcast.net User-Agent: MicroPlanet-Gravity/2.70.2067 X-Archive: encrypt X-IsSubscribed: yes > > 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/