The following commit has been merged in the 2.32.52/master branch:
commit 9c6c0f28219106dd6af22c9fb35ff424a761ea66
Author: Stephane Glondu <st...@glondu.net>
Date:   Sat May 11 12:28:43 2013 +0200

    OCaml 4 hash compatibility

diff --git a/debian/patches/0008-OCaml-4-hash-compatibility.patch 
b/debian/patches/0008-OCaml-4-hash-compatibility.patch
new file mode 100644
index 0000000..810727d
--- /dev/null
+++ b/debian/patches/0008-OCaml-4-hash-compatibility.patch
@@ -0,0 +1,151 @@
+From: Stephane Glondu <st...@glondu.net>
+Date: Sat, 11 May 2013 12:22:15 +0200
+Subject: OCaml 4 hash compatibility
+
+This is a backport of a patch introduced in Unison 2.40.102.
+
+Signed-off-by: Stephane Glondu <st...@glondu.net>
+---
+ name.ml     |    2 +-
+ path.ml     |    2 --
+ path.mli    |    1 -
+ props.ml    |    6 +++---
+ update.ml   |    4 ++--
+ uutil.ml    |    4 ++++
+ uutil.mli   |    2 ++
+ xferhint.ml |    4 ++--
+ 8 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/name.ml b/name.ml
+index 020c496..3de893b 100644
+--- a/name.ml
++++ b/name.ml
+@@ -42,4 +42,4 @@ let fromString s =
+   s
+ 
+ let hash n =
+-  Hashtbl.hash (if Case.insensitive () then String.lowercase (Case.normalize 
n) else n)
++  Uutil.hash (if Case.insensitive () then String.lowercase (Case.normalize n) 
else n)
+diff --git a/path.ml b/path.ml
+index fb05bc3..05f9f3c 100644
+--- a/path.ml
++++ b/path.ml
+@@ -191,8 +191,6 @@ let addPrefixToFinalName path prefix =
+     assert (not (isEmpty path));
+     prefix ^ path
+ 
+-let hash p = Hashtbl.hash p
+-
+ (* Pref controlling whether symlinks are followed. *)
+ let follow = Pred.create "follow"
+     ("Including the preference \\texttt{-follow \\ARG{pathspec}} causes 
Unison to \
+diff --git a/path.mli b/path.mli
+index dd75b05..5113fdd 100644
+--- a/path.mli
++++ b/path.mli
+@@ -31,7 +31,6 @@ val addSuffixToFinalName : local -> string -> local
+ val addPrefixToFinalName : local -> string -> local
+ 
+ val compare : t -> t -> int
+-val hash : local -> int
+ 
+ val followLink : local -> bool
+ 
+diff --git a/props.ml b/props.ml
+index c4b9b84..8fad0b9 100644
+--- a/props.ml
++++ b/props.ml
+@@ -277,7 +277,7 @@ let hash id h =
+     (match id with
+        IdIgnored   -> -1
+      | IdNumeric i -> i
+-     | IdNamed nm  -> Hashtbl.hash nm)
++     | IdNamed nm  -> Uutil.hash nm)
+     h
+ 
+ let similar id id' =
+@@ -429,7 +429,7 @@ let moduloOneHour t =
+ let hash t h =
+   Uutil.hash2
+     (match t with
+-       Synced f    -> Hashtbl.hash (moduloOneHour (approximate f))
++       Synced f    -> Uutil.hash (moduloOneHour (approximate f))
+      | NotSynced _ -> 0)
+     h
+ 
+@@ -597,7 +597,7 @@ type t = string option
+ 
+ let dummy = None
+ 
+-let hash t h = Uutil.hash2 (Hashtbl.hash t) h
++let hash t h = Uutil.hash2 (Uutil.hash t) h
+ 
+ let similar t t' =
+   not (Prefs.read Osx.rsrc) || t = t'
+diff --git a/update.ml b/update.ml
+index 5e58f65..493bf7f 100644
+--- a/update.ml
++++ b/update.ml
+@@ -234,9 +234,9 @@ let rec checkArchive (top: bool) (path: Path.t) (arch: 
archive) (h: int): int =
+                        (checkArchive false (Path.child path n) a h))
+         children (Props.hash desc h)
+   | ArchiveFile (desc, dig, _, ress) ->
+-      Uutil.hash2 (Hashtbl.hash dig) (Props.hash desc h)
++      Uutil.hash2 (Uutil.hash dig) (Props.hash desc h)
+   | ArchiveSymlink content ->
+-      Uutil.hash2 (Hashtbl.hash content) h
++      Uutil.hash2 (Uutil.hash content) h
+   | NoArchive ->
+       135
+ 
+diff --git a/uutil.ml b/uutil.ml
+index 84d8762..75cf8cb 100644
+--- a/uutil.ml
++++ b/uutil.ml
+@@ -34,6 +34,10 @@ let myNameAndVersion = myName ^ " " ^ myVersion
+ 
+ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF
+ 
++external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" 
"noalloc"
++
++let hash x = hash_param 10 100 x
++
+ 
(*****************************************************************************)
+ (*                             File sizes                                    
*)
+ 
(*****************************************************************************)
+diff --git a/uutil.mli b/uutil.mli
+index 369e577..f7dd78e 100644
+--- a/uutil.mli
++++ b/uutil.mli
+@@ -13,6 +13,8 @@ val myNameAndVersion : string
+ 
+ (* Hashing *)
+ val hash2 : int -> int -> int
++(* Hash function (OCaml 3.x version) *)
++val hash : 'a -> int
+ 
+ module type FILESIZE = sig
+   type t
+diff --git a/xferhint.ml b/xferhint.ml
+index abe3dd6..ad74fb4 100644
+--- a/xferhint.ml
++++ b/xferhint.ml
+@@ -32,7 +32,7 @@ module PathMap =
+     (struct
+        type t = Fspath.t * Path.local
+        let hash (fspath, path) =
+-         (Hashtbl.hash (Fspath.toString fspath) + 13217 * Path.hash path)
++         (Uutil.hash (Fspath.toString fspath) + 13217 * Uutil.hash path)
+            land
+          0x3FFFFFFF
+        let equal = (=)
+@@ -41,7 +41,7 @@ module FPMap =
+   Hashtbl.Make
+     (struct
+        type t = Os.fullfingerprint
+-       let hash = Hashtbl.hash
++       let hash = Uutil.hash
+        let equal = (=)
+      end)
+ 
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 8ff2e73..38fc115 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0005-Fix-build-with-OCaml-3.12.patch
 0006-Fix-bad-interaction-with-OpenSSH-5.6.patch
 0007-Fix-link-order-to-list-C-objects-before-the-librarie.patch
+0008-OCaml-4-hash-compatibility.patch

-- 
unison packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to