delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/28/11:04:30

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
From: Andrew Schulman <andrex AT alumni DOT utexas DOT net>
Subject: Re: unison doesn't honor HOME when USERPROFILE is set, also permission/uid/gid problems when synchronizing
Date: Tue, 28 Sep 2004 11:03:15 -0400
Lines: 96
Message-ID: <MPG.1bc3442639d8f8549896a6@localhost>
References: <87oejqvmsl DOT fsf AT vzell-de DOT de DOT oracle DOT com>
Mime-Version: 1.0
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

Hi Volker.
 
> I installed unison-2.10.2-1 and tried to sync 2 directories
> with the following default.prf in my /home/vzell/.unison
> 
> # Unison preferences file
> owner=true
> group=true
> perms=-1
> log=true
> 
> First of all unison didn't find my $HOME/.unison but instead created a
> new one under C:\Documents and Settings\vzell :-(

ugh

> and second unison
> didn't honour the above preferences after editing the new
> C:\Documents and Settings\vzell\.unison\default.prf.
> 
> 
> I compiled already unison in 2002 and used it to sync files with
> different owner/group membership and, in case of new files with
> permissions different from the umask value, I wanted unison to also sync
> permissions. Both of this can be achieved with the patch below.
> 
> Any chance that this can be incorporated in the next release ?
> 
> 
> --- 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

According to the Unison manual (http://www.cis.upenn.edu/
~bcpierce/unison/download/beta-test/latest/unison-
manual.html#unisondir), on Unix hosts Unison looks in order in $UNISON 
and $HOME/.unison; on Windows hosts it looks in order in $UNISON, 
$USERPROFILE\.unison, $HOME\.unison, and C:\.unison.  So there are two 
issues here:

(1) Unison is looking in $UNISON last.  This is clearly wrong, and if 
fixed would allow you to solve your problem by setting 
UNISON=/home/volker/.unison.  But here's something I don't understand:  
on my Cygwin host both UNISON and USERPROFILE are set, but UNISON takes 
precedence. ?? Are you sure this section of code is the operative one 
here?  What happens if you export UNISON=/home/vzell/.unison?

(2) It seems that Unison treats Cygwin as a Windows OS for this purpose, 
so that it looks in $USERPROFILE/.unison before $HOME/.unison.  This is 
arguably wrong, but I think I'll have to pose the question on unison-
hackers.

> --- uicommon.ml.orig    2004-09-28 09:43:28.010992000 +0200
> +++ uicommon.ml 2004-09-28 08:41:27.090571200 +0200
> @@ -346,7 +346,7 @@
>    let someHostIsCaseInsensitive =
>      someHostIsRunningWindows || someHostRunningOsX in
>    Case.init someHostIsCaseInsensitive;
> -  Props.init someHostIsRunningWindows;
> +(*  Props.init someHostIsRunningWindows; *)
>    Osx.init someHostRunningOsX;
>    return ())

And this patch solves the owner and group sync problem?  Sorry but it's 
not obvious to me.

You say Unison "didn't honor" the owner and group preferences.  What 
exactly happened?  Did it just not sync the owners and groups, or did it 
give you error messages?
 
> By the way I had to export also the following env var to compile from
> source:
> 
> export OSCOMP=cygwingnuc

Yup.  This is documented in /usr/share/doc/Cygwin/unison-2.10.2-
1.README.  Gerrit Haase has been after me to provide a generic build 
script for building Unison from the source package, and when I make one 
it will include this.

Thanks for your report.  As soon as I'm sure that I have the right 
corrections, I'll release a new version that includes the fixes.

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/

- Raw text -


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