[Unison-hackers] PATCH: Bugfix unison -times support for directories

Benjamin Pierce bcpierce at cis.upenn.edu
Mon Feb 2 18:37:02 EST 2009


Hi Rob,

With just this patch, if an updated file is transferred by Unison,  
won't its parent directory's modtime then be wrong on the receiving  
host?

Best,

    - Benjamin


On Feb 2, 2009, at 6:20 PM, Robert Hardy wrote:

> There seems to be a bug in the unison -times option in that it ignores
> directory times. I found some comments in BUGS.txt that suggests  
> this needed
> OCAML changes. I can't see why that comment is there. With some  
> suggestions
> from freenode's #ocaml I came up with this patch which works on Linux.
>
> I was syncing large quanties of data between an el4 and el5 box.  
> Ignoring
> the directory times caused me a lot of problems.
>
> I suspect this patch should also be extended for Unix.S_LNK as  
> currently
> unison with -owner -group -times should set the user/owner for links  
> and it
> does not.
>
> Here is a simple patch which in basic testing under el5 seems to fix  
> this problem:
>
> http://webcon.ca/~rhardy/utmp/unison-2.27.57-dir_times.patch
>
> diff -urNbBp unison-2.27.57/props.ml.orig unison-2.27.57/props.ml
> --- unison-2.27.57/props.ml.orig	2007-04-01 23:03:20.000000000 -0400
> +++ unison-2.27.57/props.ml	2009-02-02 14:22:07.000000000 -0500
> @@ -501,6 +501,8 @@ let get stats _ =
>    let v = stats.Unix.LargeFile.st_mtime in
>    if stats.Unix.LargeFile.st_kind = Unix.S_REG && Prefs.read sync  
> then
>      Synced v
> +  else if stats.Unix.LargeFile.st_kind = Unix.S_DIR && Prefs.read  
> sync then
> +    Synced v
>    else
>      NotSynced v
>
>
> Regards,
> Rob
>
> --
> Robert Hardy, B.Eng Computer Systems
> Systems Analyst/Software Developer/I.T. Specialist
> Teledyne Controls Simulation
> 105-2255 St Laurent Blvd
> Ottawa, ON K1G 4K3 Canada
> +16135262059 ex 355
> Fax +16135265751
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers



More information about the Unison-hackers mailing list