Update of /cvsroot/fink/experimental/monipol/finkinfo
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9677

Added Files:
        unison210.info unison210.patch 
Log Message:


--- NEW FILE: unison210.info ---
Info2: <<
Package: unison210%type_pkg[uitype]
Version: 2.10.2
Revision: 1
Type: uitype (. -nox)
Description: File synchronization tool
License: GPL
Homepage: http://www.cis.upenn.edu/~bcpierce/unison
Maintainer: Monic Polynomial <moni...@users.sourceforge.net>

Source: 
http://www.cis.upenn.edu/~bcpierce/unison/download/stable/unison-%v/unison-%v.tar.gz
Source-MD5: a93cf03d4221ab6bab8b758b0325a9d5

Source2: 
http://www.cis.upenn.edu/~bcpierce/unison/download/stable/unison-%v/unison-%v-manual.html
Source2-MD5: 32327d9239b7abe688cecd6ceaa3dd47

PatchFile: unison210.patch
PatchFile-MD5: 1e35d333499eeabb0290e6d2bc445621

BuildDepends: <<
  fink (>= 0.24.12),
  ocaml (>= 3.11.1-3),
  (%type_raw[uitype] = .) atk1 (>= 1.26.0-2),
  (%type_raw[uitype] = .) cairo (>= 1.8.8-2),
  (%type_raw[uitype] = .) fontconfig2-dev (>= 2.4.1-108),
  (%type_raw[uitype] = .) freetype219 (>= 2.3.8-3),
  (%type_raw[uitype] = .) glib2-dev (>= 2.20.5-1),
  (%type_raw[uitype] = .) gtk+2-dev (>= 2.16.6-2),
  (%type_raw[uitype] = .) lablgtk2 (>= 2.12.0-3),
  (%type_raw[uitype] = .) libgettext8-dev (>= 0.17-19),
  (%type_raw[uitype] = .) pango1-xft2-ft219-dev (>= 1.24.5-3),
  (%type_raw[uitype] = .) x11-dev
<<

Depends: <<
  (%type_raw[uitype] = .) atk1-shlibs (>= 1.26.0-2),
  (%type_raw[uitype] = .) cairo-shlibs (>= 1.8.8-2),
  (%type_raw[uitype] = .) fontconfig2-shlibs (>= 2.4.1-108),
  (%type_raw[uitype] = .) freetype219-shlibs (>= 2.3.8-3),
  (%type_raw[uitype] = .) glib2-shlibs (>= 2.20.5-1),
  (%type_raw[uitype] = .) gtk+2-shlibs (>= 2.16.6-2),
  (%type_raw[uitype] = .) libgettext8-shlibs (>= 0.17-19),
  (%type_raw[uitype] = .) pango1-xft2-ft219-shlibs (>= 1.24.5-3),
  (%type_raw[uitype] = .) x11-shlibs
<<

CompileScript: <<
#!/bin/bash -ev
  case "%type_raw[uitype]" in
    "-nox") UISTYLE=text;;
    ".")    UISTYLE=gtk2;;
  esac

  make UISTYLE=$UISTYLE THREADS=true
<<

InstallScript: <<
#!/bin/bash -ev
  VERSION=2.10
  case "%type_raw[uitype]" in
    "-nox") SUFFIX=nox;;
    ".")    SUFFIX=x11;;
  esac

  /usr/bin/install -d %i/bin
  /usr/bin/install -m 0755 unison %i/bin/unison-${VERSION}-${SUFFIX}
<<

PostInstScript: <<
  VERSION=2.10
  case "%type_raw[uitype]" in
    "-nox") SUFFIX=nox; PRIORITY=2102;;
    ".")    SUFFIX=x11; PRIORITY=2104;;
  esac

  update-alternatives --install \
    %p/bin/unison-${VERSION} unison-${VERSION} 
%p/bin/unison-${VERSION}-${SUFFIX} ${PRIORITY}
  update-alternatives --install \
    %p/bin/unison unison %p/bin/unison-${VERSION}-${SUFFIX} ${PRIORITY}
<<

PreRmScript: <<
  if [ "$1" != "upgrade" ]
  then
    VERSION=2.10
    case "%type_raw[uitype]" in
      "-nox") SUFFIX=nox;;
      ".")    SUFFIX=x11;;
    esac

    update-alternatives --remove unison-${VERSION} 
%p/bin/unison-${VERSION}-${SUFFIX}
    update-alternatives --remove unison            
%p/bin/unison-${VERSION}-${SUFFIX}
  fi
<<

DocFiles: <<
  COPYING CONTRIB README ROADMAP.txt BUGS.txt INSTALL NEWS TODO.txt
  ../unison-2.10.2-manual.html:manual.html
<<

DescDetail: <<
  Unison is a file-synchronization tool for Unix and Windows. It allows two
  replicas of a collection of files and directories to be stored on different
  hosts (or different disks on the same host), modified separately, and then
  brought up to date by propagating the changes in each replica to the other.

  Unison shares a number of features with tools such as configuration
  management packages (CVS, PRCS, etc.) distributed filesystems (Coda, etc.)
  uni-directional mirroring utilities (rsync, etc.) and other synchronizers
  (Intellisync, Reconcile, etc).

  Note: All Unison variants can be installed simultaneously.  This package uses
  the update-alternatives system so that the command 'unison' automatically
  uses the best-available UI for the highest-available version.  Other versions
  can be run using 'unison-[version]' or 'unison-[version]-[uitype].  Type
  'ls %p/bin/unison*' and 'man update-alternatives' for more information.
<<

DescPackaging: <<
  Unison requires the versions (major and minor) used on client and server to
  match. Most OS distributions provide only one version, so the set of Unison
  packages in Fink have been explicitly designed to coexist.

  The priority assigned to each alternative for update-alternatives follows the
  pattern $ver$uitype where $ver is the $major$minor version and $uitype is
  2 for -nox, 4 for -x11, and 6 for -aqua.
<<
<<

--- NEW FILE: unison210.patch ---
diff -Nurd unison-2.10.2.ori/Makefile.OCaml unison-2.10.2/Makefile.OCaml
--- unison-2.10.2.ori/Makefile.OCaml    2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/Makefile.OCaml        2010-01-10 23:13:17.000000000 -0200
@@ -58,9 +58,7 @@
 # The OCaml lib dir is used by all versions
 # It is extracted from 'ocamlc -v' and Windows '\' separators are turned
 # to Unix '/' separators, and extraneous control-M's are deleted.
-# Unfortunately there is a literal control-M buried in this, I'd rather
-# get rid of it...
-OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* //g' | sed -e 
's/\\/\//g' | sed -e 's/
//g')
+OCAMLLIBDIR=$(shell ocamlc -v | tail -n -1 | sed -e 's/.* //g' | sed -e 
's/\\/\//g' | tr -d '\r')
 
 # User interface style: 
 #   Legal values are
@@ -329,7 +344,6 @@
   CAMLFLAGS+=-I $(OCAMLLIBDIR)/lablgtk2
   OCAMLOBJS+=pixmaps.cmo uigtk2.cmo linkgtk2.cmo
   OCAMLLIBS+=lablgtk.cma
-  OCAMLLIBS+=str.cma   
   ifeq ($(OSARCH), win32)
     WINSYSLIBS=user32.lib advapi32.lib wsock32.lib gdi32.lib \
                imm32.lib shell32.lib ole32.lib uuid.lib
@@ -450,7 +481,7 @@
            >>dot.tmp
        echo '{ rank = same; "Tree"; "Safelist"; }'>>dot.tmp
        echo '{ rank = same; "Uarg"; "Prefs"; }'>>dot.tmp
-       ocamldot .depend | tail +2 >> dot.tmp
+       ocamldot .depend | tail -n +2 >> dot.tmp
        -dot -Tps -o DEPENDENCIES.ps dot.tmp
 endif
 
diff -Nurd unison-2.10.2.ori/copy.ml unison-2.10.2/copy.ml
--- unison-2.10.2.ori/copy.ml   2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/copy.ml       2010-01-10 22:04:53.000000000 -0200
@@ -10,14 +10,16 @@
 
 let openFileIn fspath path kind =
   match kind with
-    `DATA   -> Unix.openfile (Fspath.concatToString fspath path)
-                 [Unix.O_RDONLY] 0o444
+    `DATA   -> Unix.descr_of_in_channel
+                 (open_in_gen [Open_rdonly; Open_binary]  0o444
+                    (Fspath.concatToString fspath path))
   | `RESS _ -> Osx.openRessIn fspath path
 
 let openFileOut fspath path kind =
   match kind with
-    `DATA     -> Unix.openfile (Fspath.concatToString fspath path)
-                   [Unix.O_WRONLY;Unix.O_CREAT;Unix.O_EXCL] 0o600
+    `DATA     -> Unix.descr_of_out_channel
+                   (open_out_gen [Open_wronly; Open_creat; Open_excl; 
Open_binary]
+                       0o600 (Fspath.concatToString fspath path))
   | `RESS len -> Osx.openRessOut fspath path len
 
 let protect f g =
@@ -260,10 +262,9 @@
     fspathTo pathTo realPathTo `DATA update srcFileSize id file_id
     >>= (fun (outfd, infd, bi) ->
   Lwt.catch (fun () ->
-    Lwt_util.run_in_region transmitFileReg (bufferSize srcFileSize) (fun () ->
-      Uutil.showProgress id Uutil.Filesize.zero "f";
-      compressRemotely connFrom
-        (bi, fspathFrom, pathFrom, `DATA, srcFileSize, id, file_id))
+    Uutil.showProgress id Uutil.Filesize.zero "f";
+    compressRemotely connFrom
+      (bi, fspathFrom, pathFrom, `DATA, srcFileSize, id, file_id)
             >>= (fun () ->
     decompressor :=
       Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
@@ -281,16 +282,15 @@
       (`RESS ressLength) update ressLength id file_id
         >>= (fun (outfd, infd, bi) ->
     Lwt.catch (fun () ->
-      Lwt_util.run_in_region transmitFileReg (bufferSize ressLength) (fun () ->
-        Uutil.showProgress id Uutil.Filesize.zero "f";
-        compressRemotely connFrom
-          (bi, fspathFrom, pathFrom,
-           `RESS ressLength, ressLength, id, file_id))
-              >>= (fun () ->
-        decompressor :=
-          Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
-        close_all infd outfd;
-        Lwt.return ()))
+      Uutil.showProgress id Uutil.Filesize.zero "f";
+      compressRemotely connFrom
+        (bi, fspathFrom, pathFrom,
+         `RESS ressLength, ressLength, id, file_id)
+            >>= (fun () ->
+      decompressor :=
+        Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
+      close_all infd outfd;
+      Lwt.return ()))
     (fun e ->
        decompressor :=
          Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
@@ -367,9 +367,13 @@
 let transmitFile
     rootFrom pathFrom rootTo fspathTo pathTo realPathTo
     update desc fp ress id =
-  transmitFileOnRoot rootTo rootFrom
-    (snd rootFrom, pathFrom, fspathTo, pathTo, realPathTo,
-     update, desc, fp, ress, id)
+  let bufSz = bufferSize (max (Props.length desc) (Osx.ressLength ress)) in
+  (* This must be on the client: any lock on the server side may result
+     in a deadlock under windows *)
+  Lwt_util.run_in_region transmitFileReg bufSz (fun () ->
+    transmitFileOnRoot rootTo rootFrom
+      (snd rootFrom, pathFrom, fspathTo, pathTo, realPathTo,
+       update, desc, fp, ress, id))
 
 (****)
 
diff -Nurd unison-2.10.2.ori/files.ml unison-2.10.2/files.ml
--- unison-2.10.2.ori/files.ml  2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/files.ml      2010-01-10 22:04:53.000000000 -0200
@@ -356,18 +356,20 @@
           debug (fun() -> Util.msg "Creating directory %s/%s\n"
             (root2string rootTo) (Path.toString pTo));
           mkdir rootTo workingDir pTo) >>= (fun initialDesc ->
-        let actions =
-          Update.NameMap.fold
-            (fun name child rem ->
-               copyRec (Path.child pFrom name)
-                       (Path.child pTo name)
-                       (Path.child realPTo name)
-                       child
-               :: rem)
-            children []
-        in
+        let runningThreads = ref [] in
         Lwt.catch
-          (fun () -> Lwt_util.join actions)
+          (fun () ->
+             Update.NameMap.iter
+               (fun name child ->
+                  let thread =
+                    copyRec (Path.child pFrom name)
+                            (Path.child pTo name)
+                            (Path.child realPTo name)
+                            child
+                  in
+                  runningThreads := thread :: !runningThreads)
+               children;
+             Lwt_util.join !runningThreads)
           (fun e ->
              (* If one thread fails (in a non-fatal way), we wait for
                 all other threads to terminate before continuing *)
@@ -381,7 +383,8 @@
                             match e with
                               Util.Transient _ -> Lwt.return ()
                             | _                -> Lwt.fail e))
-                   actions
+                   !runningThreads >>= (fun () ->
+                 Lwt.fail e (* DO NOT FORGET TO RERAISE THE EXCEPTION !!!*))
              | _ ->
                  Lwt.fail e) >>= (fun () ->
         Lwt_util.run_in_region copyReg 1 (fun () ->
@@ -469,8 +472,8 @@
            Lwt_unix.run
              (Update.translatePath root2 path2 >>= (fun path2 ->
               Copy.file root2 path2 root1 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc1))
-                 fp1 ress1 id));
+                `Copy (Props.setLength Props.fileSafe (Props.length desc2))
+                 fp2 ress2 id));
            displayDiff
             (Fspath.concat workingDir realPath)
              (Fspath.concat workingDir tmppath);
@@ -487,8 +490,8 @@
              (Update.translatePath root1 path1 >>= (fun path1 ->
               (* Note that we don't need the ressource fork *)
               Copy.file root1 path1 root2 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc2))
-                 fp2 ress2 id));
+                `Copy (Props.setLength Props.fileSafe (Props.length desc1))
+                 fp1 ress1 id));
            displayDiff
              (Fspath.concat workingDir tmppath)
             (Fspath.concat workingDir realPath);
diff -Nurd unison-2.10.2.ori/fingerprint.ml unison-2.10.2/fingerprint.ml
--- unison-2.10.2.ori/fingerprint.ml    2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/fingerprint.ml        2010-01-10 22:04:53.000000000 -0200
@@ -22,7 +22,7 @@
   Util.convertUnixErrorsToTransient
     "digesting subfile"
     (fun () ->
-       let inch = open_in path in
+       let inch = open_in_bin path in
        LargeFile.seek_in inch offset;
        begin try
          let res = Digest.channel inch (Uutil.Filesize.toInt len) in
diff -Nurd unison-2.10.2.ori/os.ml unison-2.10.2/os.ml
--- unison-2.10.2.ori/os.ml     2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/os.ml 2010-01-10 22:04:53.000000000 -0200
@@ -150,10 +150,23 @@
         loop newChildren directory
       in
       let absolutePath = Fspath.concat fspath path in
-      let directory = Fspath.opendir absolutePath in
-      let result = loop [] directory in
-      Unix.closedir directory;
-      result)
+      let directory =
+        try
+          Some (Fspath.opendir absolutePath)
+        with Unix.Unix_error (Unix.ENOENT, _, _) ->
+          (* FIX (in Ocaml): under Windows, when a directory is empty
+             (not even "." and ".."), FindFirstFile fails with
+             ERROR_FILE_NOT_FOUND while ocaml expects the error
+             ERROR_NO_MORE_FILES *)
+          None
+      in
+      match directory with
+        Some directory ->
+          let result = loop [] directory in
+          Unix.closedir directory;
+          result
+      | None ->
+          [])
 
 (*****************************************************************************)
 (*                        ACTIONS ON FILESYSTEM                              *)
@@ -167,14 +180,19 @@
        let absolutePath = Fspath.concatToString fspath path in
        match (Fileinfo.get false fspath path).Fileinfo.typ with
          `DIRECTORY ->
-           Unix.chmod absolutePath 0o700;
+           begin try
+             Unix.chmod absolutePath 0o700
+           with Unix.Unix_error _ -> () end;
            Safelist.iter
              (fun child -> delete fspath (Path.child path child))
              (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
diff -Nurd unison-2.10.2.ori/osxsupport.c unison-2.10.2/osxsupport.c
--- unison-2.10.2.ori/osxsupport.c      2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/osxsupport.c  2010-01-10 22:04:53.000000000 -0200
@@ -6,6 +6,8 @@
 #include <caml/alloc.h>
 #include <caml/memory.h>
 #ifdef __APPLE__
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/attr.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -115,6 +117,20 @@
   retcode = setattrlist(String_val (path), &attrList, attrBuf.finderInfo,
                         sizeof attrBuf.finderInfo, options);
 
+  if (retcode == -1 && errno == EACCES) {
+    /* Unlike with normal Unix attributes, we cannot set OS X attributes 
+       if file is read-only.  Try making it writable temporarily. */
+    struct stat st;
+    int r = stat(String_val(path), &st);
+    if (r == -1) uerror("setattrlist", path);
+    r = chmod(String_val(path), st.st_mode | S_IWUSR);
+    if (r == -1) uerror("setattrlist", path);
+    /* Try again */
+    retcode = setattrlist(String_val (path), &attrList, attrBuf.finderInfo,
+                          sizeof attrBuf.finderInfo, options);
+    /* Whether or not that worked, we should try to set the mode back. */
+    chmod(String_val(path), st.st_mode);
+  }
   if (retcode == -1) uerror("setattrlist", path);
 
   CAMLreturn (Val_unit);
diff -Nurd unison-2.10.2.ori/props.ml unison-2.10.2/props.ml
--- unison-2.10.2.ori/props.ml  2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/props.ml      2010-01-10 22:04:53.000000000 -0200
@@ -421,7 +421,7 @@
 
 let iCanWrite p =
   try
-    Unix.access p [Unix.R_OK];
+    Unix.access p [Unix.W_OK];
     true
   with
     Unix.Unix_error _ -> false
@@ -615,9 +615,9 @@
 let set fspath path kind p =
   Uid.set fspath path kind p.uid;
   Gid.set fspath path kind p.gid;
-  Perm.set fspath path kind p.perm;
+  TypeCreator.set fspath path kind p.typeCreator;
   Time.set fspath path kind p.time;
-  TypeCreator.set fspath path kind p.typeCreator
+  Perm.set fspath path kind p.perm
 
 let init someHostIsRunningWindows =
   Perm.init someHostIsRunningWindows;
diff -Nurd unison-2.10.2.ori/recon.ml unison-2.10.2/recon.ml
--- unison-2.10.2.ori/recon.ml  2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/recon.ml      2010-01-10 22:04:53.000000000 -0200
@@ -30,6 +30,10 @@
             d := Replica1ToReplica2
           else
             d := Replica2ToReplica1
+        end else if s1=`Deleted && dir=`Newer then begin
+          d := Replica2ToReplica1
+        end else if s2=`Deleted && dir=`Newer then begin
+          d := Replica1ToReplica2
         end
   | _ ->
       ()
diff -Nurd unison-2.10.2.ori/terminal.ml unison-2.10.2/terminal.ml
--- unison-2.10.2.ori/terminal.ml       2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/terminal.ml   2010-01-10 22:04:53.000000000 -0200
@@ -32,7 +32,7 @@
 *)
 
 let passwordRx =
-  Rx.rx ".*'s password: "
+  Rx.rx ".*'s password:[ ]*"
 let authenticityRx =
   Rx.rx "The authenticity of host .* continue connecting \\(yes/no\\)\\? "
 let password s = Rx.match_string passwordRx s
diff -Nurd unison-2.10.2.ori/transport.ml unison-2.10.2/transport.ml
--- unison-2.10.2.ori/transport.ml      2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/transport.ml  2010-01-10 22:04:53.000000000 -0200
@@ -15,7 +15,8 @@
   match uiFrom, uiTo with
     _, Updates (File (props, ContentsUpdated (_, _, ress)), _) ->
       (Props.length props, Osx.ressLength ress)
-  | Updates (File _, Previous (_, props, _, ress)), NoUpdates ->
+  | Updates (_, Previous (`FILE, props, _, ress)),
+    (NoUpdates | Updates (File (_, ContentsSame), _)) ->
       (Props.length props, Osx.ressLength ress)
   | _ ->
       assert false
diff -Nurd unison-2.10.2.ori/ubase/util.ml unison-2.10.2/ubase/util.ml
--- unison-2.10.2.ori/ubase/util.ml     2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/ubase/util.ml 2010-01-10 22:04:53.000000000 -0200
@@ -244,14 +244,18 @@
   convertUnixErrorsToTransient "time" Unix.time
 
 let time2string timef =
-  let time = localtime timef in
-  Printf.sprintf
-    "%2d:%.2d on %2d %3s, %4d"
-    time.Unix.tm_hour
-    time.Unix.tm_min
-    time.Unix.tm_mday
-    (monthname time.Unix.tm_mon)
-    (time.Unix.tm_year + 1900)
+  try
+    let time = localtime timef in
+    Printf.sprintf
+      "%2d:%.2d:%.2d on %2d %3s, %4d"
+      time.Unix.tm_hour
+      time.Unix.tm_min
+      time.Unix.tm_sec
+      time.Unix.tm_mday
+      (monthname time.Unix.tm_mon)
+      (time.Unix.tm_year + 1900)
+  with Transient _ ->
+    "(invalid date)"
 
 let percentageOfTotal current total =
   (int_of_float ((float current) *. 100.0 /. (float total)))
@@ -355,19 +359,20 @@
 (*****************************************************************************)
 
 let fileInHomeDir n =
-  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 "UNISON" (* Use UNISON dir if none of
-                                    the above are set *)
-        with Not_found -> "c:/" (* Default *) in
-      Filename.concat dirString n
-  | `Unix ->
-      Filename.concat (safeGetenv "HOME") n
+  if osType = `Unix || isCygwin then
+    Filename.concat (safeGetenv "HOME") n
+  else if osType = `Win32 then
+    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 "UNISON" (* Use UNISON dir if none of
+                                  the above are set *)
+      with Not_found -> "c:/" (* Default *) in
+    Filename.concat dirString n
+  else
+    assert false (* osType can't be anything else *)
 
 (*****************************************************************************)
 (*           "Upcall" for building pathnames in the .unison dir              *)
diff -Nurd unison-2.10.2.ori/uicommon.ml unison-2.10.2/uicommon.ml
--- unison-2.10.2.ori/uicommon.ml       2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/uicommon.ml   2010-01-10 22:04:53.000000000 -0200
@@ -268,26 +268,28 @@
     | c ->
         buf.[!pos] <- c; pos := !pos + 1
   done;
-  String.sub buf 0 !pos
+  "{" ^ String.sub buf 0 !pos ^ "}"
 
-let ignorePath path = "Path " ^ (quote (Path.toString path))
+let ignorePath path = "Path " ^ quote (Path.toString path)
 
 let ignoreName path =
   match Path.finalName path with
-    Some name -> "Name " ^ (quote (Name.toString name))
+    Some name -> "Name " ^ quote (Name.toString name)
   | None      -> assert false
 
 let ignoreExt path =
   match Path.finalName path with
     Some name ->
       let str = Name.toString name in
-      (try
-        let pos = String.rindex str '.' + 1 in
+      begin try
+        let pos = String.rindex str '.' in
         let ext = String.sub str pos (String.length str - pos) in
-        "Name *." ^ (quote ext)
+        "Name {,.}*" ^ quote ext
       with Not_found -> (* str does not contain '.' *)
-        "Name "^(quote str))
-  | None      -> assert false
+        "Name " ^ quote str
+      end
+  | None ->
+      assert false
 
 let addIgnorePattern theRegExp =
   if theRegExp = "Path " then
diff -Nurd unison-2.10.2.ori/uigtk.ml unison-2.10.2/uigtk.ml
--- unison-2.10.2.ori/uigtk.ml  2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/uigtk.ml      2010-01-10 22:04:53.000000000 -0200
@@ -1606,7 +1606,7 @@
                   catch (fun () ->
                            Transport.transportItem
                              theSI.ri (Uutil.File.ofLine i)
-                             (fun title text -> Trace.status (Printf.sprintf 
"\n%s\n\n%s\n\n" title text))
+                             (fun title text -> Trace.status (Printf.sprintf 
"\n%s\n\n%s\n\n" title text); true)
                            >>= (fun () ->
                            return Util.Succeeded))
                         (fun e ->
@@ -1760,6 +1760,7 @@
   actionBar#insert_space ();
   grAdd grDiff (actionBar#insert_button ~text:"Diff" ~callback:diffCmd ());
 
+(*
   let mergeCmd () =
     match !current with
       Some i ->
@@ -1787,7 +1788,7 @@
 
   actionBar#insert_space ();
   grAdd grDiff (actionBar#insert_button ~text:"Merge" ~callback:mergeCmd ());
-
+*)
   (*********************************************************************
     Keyboard commands
    *********************************************************************)
diff -Nurd unison-2.10.2.ori/uigtk2.ml unison-2.10.2/uigtk2.ml
--- unison-2.10.2.ori/uigtk2.ml 2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/uigtk2.ml     2010-01-10 22:04:53.000000000 -0200
@@ -745,8 +745,7 @@
     match Uicommon.sshParse s with
       Uicommon.Password account -> getPassword account
     | _ -> "" in
-  if Osx.isMacOSX or Osx.isLinux then Some handleSSH
-  else None
+  None
 
 (* ------ *)
 
diff -Nurd unison-2.10.2.ori/uitext.ml unison-2.10.2/uitext.ml
--- unison-2.10.2.ori/uitext.ml 2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/uitext.ml     2010-01-10 22:04:53.000000000 -0200
@@ -423,6 +423,8 @@
                  (["n";"q";"x"],
                     ("Exit"),
                     fun()->
+                      alwaysDisplay "\n";
+                      restoreTerminal ();
                       Lwt_unix.run (Update.unlockArchives ());
                       exit 1)]
                 (fun()-> display  "Press return to continue.")
diff -Nurd unison-2.10.2.ori/update.ml unison-2.10.2/update.ml
--- unison-2.10.2.ori/update.ml 2004-09-06 16:15:46.000000000 -0300
+++ unison-2.10.2/update.ml     2010-01-10 22:04:53.000000000 -0200
@@ -347,13 +347,25 @@
      let fto = Fspath.toString (Os.fileInUnisonDir toname) in
      debug (fun() -> Util.msg "Copying archive %s to %s\n" ffrom fto);
      Util.convertUnixErrorsToFatal "copying archive" (fun () ->
-       let outFd = Unix.openfile fto
-         [Unix.O_RDWR;Unix.O_CREAT;Unix.O_TRUNC] 0o600 in
+       let outFd = 
+         open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_binary] 
+              0o600 fto
+       in
        Unix.chmod fto 0o600; (* In case the file already existed *)
-       let inFd = Unix.openfile ffrom [Unix.O_RDONLY] 0o444 in
-       Uutil.readWrite inFd outFd (fun _ -> ());
-       Unix.close inFd;
-       Unix.close outFd;
+       let inFd = open_in_bin ffrom in
+       let bufsize = 10000 in
+       let buf = String.create bufsize in
+
+       let rec read () =
+         let n = input inFd buf 0 bufsize in
+         if n>0 then begin
+           output outFd buf 0 n;
+         read()
+         end
+       in
+       read ();
+       close_in inFd;
+       close_out outFd;
        let arcFspath = Os.fileInUnisonDir toname in
        let info = Fileinfo.get false arcFspath Path.empty in
        Hashtbl.replace archiveInfoCache thisRoot info))
@@ -1308,11 +1320,14 @@
       &&
     Props.length info.Fileinfo.desc = Props.length archDesc
       &&
+    notExcelFile path
+      &&
     match archStamp with
       Fileinfo.InodeStamp inode ->
         info.Fileinfo.inode = inode
     | Fileinfo.CtimeStamp ctime ->
-        info.Fileinfo.ctime = ctime && notExcelFile path in
+        info.Fileinfo.ctime = ctime
+  in
   let ressClearlyUnchanged =
     fastCheck
       &&
@@ -1578,7 +1593,6 @@
 let rec buildUpdate archive fspath fullpath here path =
   match Path.deconstruct path with
     None ->
-      Os.checkThatParentPathIsADir fspath here;
       showStatus path;
       let (arch, ui) =
         buildUpdateRec archive fspath here (useFastChecking()) in
@@ -1588,6 +1602,12 @@
        end,
        ui)
   | Some(name, path') ->
+      if not (isDir fspath here) then
+        (archive,
+         Error (Printf.sprintf
+                  "path %s is not valid because %s is not a directory"
+                  (Path.toString fullpath) (Path.toString here)))
+      else
       let children = getChildren fspath here in
       let (name', status) =
         try
@@ -1625,7 +1645,7 @@
              Note that we may also put NoArchive deep inside an
              archive...
           *)
-          (ArchiveDir (desc, NameMap.add name' child otherChildren),
+          (ArchiveDir (desc, NameMap.add name' arch otherChildren),
            updates)
 
 (* for the given path, find the archive and compute the list of update
diff -Nurd unison-2.10.2.ori/uutil.ml unison-2.10.2/uutil.ml
--- unison-2.10.2.ori/uutil.ml  2004-09-06 16:15:47.000000000 -0300
+++ unison-2.10.2/uutil.ml      2010-01-10 22:04:53.000000000 -0200
@@ -83,7 +83,7 @@
 (*               Copy bytes from one file_desc to another                    *)
 (*****************************************************************************)
 
-let bufsize = 10000
+let bufsize = 16384
 let bufsizeFS = Filesize.ofInt bufsize
 let buf = String.create bufsize
 


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to