[Unison-hackers] patches for 2.10.2 and 2.12.0

Zvezdan Petkovic zpetkovic at acm.org
Mon May 23 14:59:19 EDT 2005


Thanks a lot for answering Jerome.

On Mon, May 23, 2005 at 01:51:19PM +0200, Jerome Vouillon wrote:
> This one is only needed under Windows.  I'm attaching a more thorough
> patch that supersedes it.
> - Fix the unison failure when the directory is read-only.

I see.  Files are checked through the exception mechanism too.
I've changed the comment in that patch to

Fix the failure of Windows client when directory or file are read-only.

> 
> This one is only needed under Mac OS X:
> - Fix the Mac OS X client problem.

Can I safely assume that there's no harm even if I include those patches
on a Unix platform like OpenBSD?
Namely, they are both in the beta 2.12.0 source.
I think there should be no harm if stable 2.10.2 is patched the same.

Regarding the new patch for read-only problem above, the first change:

          `DIRECTORY ->
-           Unix.chmod absolutePath 0o700;
+           begin try
+             Unix.chmod absolutePath 0o700
+           with Unix.Unix_error _ -> () end;

has been applied to the beta 2.12.0, but the second change

        | `FILE ->
-           if Util.osType <> `Unix then
-             Unix.chmod absolutePath 0o600;
+           if Util.osType <> `Unix then begin
+             try
+               Unix.chmod absolutePath 0o600;
+             with Unix.Unix_error _ -> ()
+           end;

has _not_ been applied to the beta 2.12.0 version.

Shouldn't 2.12.0 be also patched with this second set of lines only
(see the attached patch).

Finally, thank you for the new osx patch for 2.12.0 version.

	Zvezdan
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the failure of Windows client when a file is read-only.
--- os.ml.orig	Sat Mar 12 11:17:58 2005
+++ os.ml	Mon May 23 13:49:52 2005
@@ -175,8 +175,11 @@ and delete fspath path =
              (childrenOf fspath path);
            Unix.rmdir absolutePath
        | `FILE ->
-           if Util.osType <> `Unix then
-             Unix.chmod absolutePath 0o600;
+           if Util.osType <> `Unix then begin
+             try
+               Unix.chmod absolutePath 0o600;
+             with Unix.Unix_error _ -> ()
+           end;
            Unix.unlink absolutePath;
            if Prefs.read Osx.rsrc then begin
              let pathDouble = Osx.appleDoubleFile fspath path in


More information about the Unison-hackers mailing list