commit:     3259962977f7ec30f0803a904e748ce67f2638ab
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 28 21:17:07 2016 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Mon Nov 28 21:17:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32599629

dev-ml/eliom: fix build with reactivedata 0.2.1 and ocsigenserver 2.8; bug 
#601102

Package-Manager: portage-2.3.2

 dev-ml/eliom/eliom-5.0.0-r2.ebuild    |   8 +-
 dev-ml/eliom/eliom-9999.ebuild        |   4 +-
 dev-ml/eliom/files/ocsigen28.patch    | 500 ++++++++++++++++++++++++++++++++++
 dev-ml/eliom/files/reactivedata.patch |  44 +++
 4 files changed, 551 insertions(+), 5 deletions(-)

diff --git a/dev-ml/eliom/eliom-5.0.0-r2.ebuild 
b/dev-ml/eliom/eliom-5.0.0-r2.ebuild
index 6b4ae4b..0807fa3 100644
--- a/dev-ml/eliom/eliom-5.0.0-r2.ebuild
+++ b/dev-ml/eliom/eliom-5.0.0-r2.ebuild
@@ -17,10 +17,10 @@ IUSE="doc +ocamlopt +ppx"
 
 RDEPEND=">=dev-lang/ocaml-4.03:=[ocamlopt?]
        >=dev-ml/js_of_ocaml-2.8.2:=
-       >=www-servers/ocsigenserver-2.5:=
+       >=www-servers/ocsigenserver-2.8:=
        >=dev-ml/tyxml-4:=
        >=dev-ml/deriving-0.6:=
-       >=dev-ml/reactiveData-0.2:=
+       >=dev-ml/reactiveData-0.2.1:=
        dev-ml/ocaml-ipaddr:=
        dev-ml/react:=
        dev-ml/ocaml-ssl:=
@@ -35,7 +35,9 @@ DEPEND="${RDEPEND}
 src_prepare() {
        epatch "${FILESDIR}/"{camlp4,oc43,oc43-2}.patch \
                "${FILESDIR}/tyxml4.patch" \
-               "${FILESDIR}/jsofocaml-282.patch"
+               "${FILESDIR}/jsofocaml-282.patch" \
+               "${FILESDIR}/reactivedata.patch" \
+               "${FILESDIR}/ocsigen28.patch"
 }
 
 src_compile() {

diff --git a/dev-ml/eliom/eliom-9999.ebuild b/dev-ml/eliom/eliom-9999.ebuild
index f408965..bc9355f 100644
--- a/dev-ml/eliom/eliom-9999.ebuild
+++ b/dev-ml/eliom/eliom-9999.ebuild
@@ -25,10 +25,10 @@ IUSE="doc +ocamlopt +ppx"
 
 RDEPEND=">=dev-lang/ocaml-4.03:=[ocamlopt?]
        >=dev-ml/js_of_ocaml-2.5-r1:=
-       >=www-servers/ocsigenserver-2.5:=
+       >=www-servers/ocsigenserver-2.8:=
        >=dev-ml/tyxml-4:=
        >=dev-ml/deriving-0.6:=
-       >=dev-ml/reactiveData-0.2:=
+       >=dev-ml/reactiveData-0.2.1:=
        dev-ml/ocaml-ipaddr:=
        dev-ml/react:=
        dev-ml/ocaml-ssl:=

diff --git a/dev-ml/eliom/files/ocsigen28.patch 
b/dev-ml/eliom/files/ocsigen28.patch
new file mode 100644
index 00000000..fb3ef0a
--- /dev/null
+++ b/dev-ml/eliom/files/ocsigen28.patch
@@ -0,0 +1,500 @@
+Index: eliom-5.0.0/src/lib/eliom_common.server.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_common.server.ml
++++ eliom-5.0.0/src/lib/eliom_common.server.ml
+@@ -1372,7 +1372,7 @@ let create_persistent_table name =
+ 
+ let persistent_cookies_table :
+     (full_state_name * float option * timeout * perssessgrp option)
+-    Ocsipersist.table Lazy.t =
++    Ocsipersist.table Lwt.t Lazy.t =
+   lazy (create_persistent_table eliom_persistent_cookie_table)
+ (* Another tables, containing the session info for each cookie *)
+ (* the table contains:
+@@ -1390,7 +1390,7 @@ let persistent_cookies_table :
+ let remove_from_all_persistent_tables key =
+   Perstables.fold (* could be replaced by a parallel map *)
+     (fun thr t -> thr >>= fun () ->
+-      Ocsipersist.remove (Ocsipersist.open_table t) key >>= Lwt_unix.yield)
++      Ocsipersist.open_table t >>= fun table -> Ocsipersist.remove table key 
>>= Lwt_unix.yield)
+     (return ())
+     !perstables
+ 
+Index: eliom-5.0.0/src/lib/eliom_common.server.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_common.server.mli
++++ eliom-5.0.0/src/lib/eliom_common.server.mli
+@@ -609,10 +609,10 @@ module Perstables :
+     val fold : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
+   end
+ val perstables : string list ref
+-val create_persistent_table : string -> 'a Ocsipersist.table
++val create_persistent_table : string -> 'a Ocsipersist.table Lwt.t
+ val persistent_cookies_table :
+   (full_state_name * float option * timeout * perssessgrp option)
+-  Ocsipersist.table Lazy.t
++  Ocsipersist.table Lwt.t Lazy.t
+ val remove_from_all_persistent_tables : string -> unit Lwt.t
+ val absolute_change_sitedata : sitedata -> unit
+ val get_current_sitedata : unit -> sitedata
+Index: eliom-5.0.0/src/lib/eliom_reference.server.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_reference.server.ml
++++ eliom-5.0.0/src/lib/eliom_reference.server.ml
+@@ -32,8 +32,8 @@ type 'a eref_kind =
+   | Ref of 'a lazy_t ref (* Ocaml reference *)
+   | Vol of 'a volatile_table Lazy.t (* Vol. table (group, session, process) *)
+   | Ocsiper of 'a option Ocsipersist.t Lwt.t (* Global persist. table *)
+-  | Ocsiper_sit of 'a Ocsipersist.table (* Persist. table for site *)
+-  | Per of 'a persistent_table (* Persist. table for group session or process 
*)
++  | Ocsiper_sit of 'a Ocsipersist.table Lwt.t (* Persist. table for site *)
++  | Per of 'a persistent_table Lwt.t (* Persist. table for group session or 
process *)
+ 
+ type volatile = [ `Volatile ]
+ type persistent = [ `Persistent ]
+@@ -174,9 +174,7 @@ let eref_from_fun_ ~ext ~scope ?secure ?
+           | None -> (Volatile.eref_from_fun_ ~ext ~scope ?secure f :> _ eref)
+           | Some name ->
+             (f, ext,
+-             Ocsiper (Ocsipersist.make_persistent
+-                        ~store:pers_ref_store
+-                        ~name ~default:None))
++           Ocsiper (pers_ref_store >>= fun store -> 
Ocsipersist.make_persistent ~store ~name ~default:None))
+       end
+     | `Site ->
+       begin
+@@ -207,6 +205,7 @@ let get_site_id () =
+ let get (f, _, table as eref) =
+   match table with
+     | Per t ->
++      t >>= fun t ->
+       (get_persistent_data ~table:t () >>= function
+         | Data d -> Lwt.return d
+         | _ ->
+@@ -221,6 +220,7 @@ let get (f, _, table as eref) =
+              Ocsipersist.set r (Some value) >>= fun () ->
+              Lwt.return value)
+     | Ocsiper_sit t ->
++      t >>= fun t ->
+       (let site_id = get_site_id () in
+        try_lwt Ocsipersist.find t site_id
+        with Not_found ->
+@@ -231,9 +231,10 @@ let get (f, _, table as eref) =
+ 
+ let set (_, _, table as eref) value =
+   match table with
+-    | Per t -> set_persistent_data ~table:t value
++    | Per t -> t >>= fun t -> set_persistent_data ~table:t value
+     | Ocsiper r -> r >>= fun r -> Ocsipersist.set r (Some value)
+     | Ocsiper_sit t ->
++      t >>= fun t ->
+       Ocsipersist.add t (get_site_id ()) value
+     | _ -> Lwt.return (Volatile.set eref value)
+ 
+@@ -242,9 +243,10 @@ let modify eref f =
+ 
+ let unset (f, _, table as eref) =
+   match table with
+-    | Per t -> remove_persistent_data ~table:t ()
++    | Per t ->  t >>= fun t -> remove_persistent_data ~table:t ()
+     | Ocsiper r -> r >>= fun r -> Ocsipersist.set r None
+     | Ocsiper_sit t ->
++      t >>= fun t ->
+       Ocsipersist.remove t (get_site_id ())
+     | _ -> Lwt.return (Volatile.unset eref)
+ 
+@@ -258,6 +260,7 @@ module Ext = struct
+     match table with
+       | Vol _ -> Lwt.return (Volatile.Ext.get state r)
+       | Per t ->
++        t >>= fun t ->
+         (Lwt.catch
+            (fun () -> Eliom_state.Ext.Low_level.get_persistent_data
+              ~state ~table:t)
+@@ -279,6 +282,7 @@ module Ext = struct
+     match table with
+       | Vol _ -> Lwt.return (Volatile.Ext.set state r value)
+       | Per t ->
++        t >>= fun t ->
+         Eliom_state.Ext.Low_level.set_persistent_data
+           ~state ~table:t value
+       | _ -> Lwt.fail (Failure "wrong eref for this function")
+@@ -291,7 +295,7 @@ module Ext = struct
+     let state = Eliom_state.Ext.untype_state state in
+     match table with
+       | Vol _ -> Lwt.return (Volatile.Ext.unset state r)
+-      | Per t -> Eliom_state.Ext.Low_level.remove_persistent_data
++      | Per t -> t >>= fun t -> 
Eliom_state.Ext.Low_level.remove_persistent_data
+         ~state ~table:t
+       | _ -> failwith "wrong eref for this function"
+ 
+Index: eliom-5.0.0/src/lib/eliom_state.server.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_state.server.ml
++++ eliom-5.0.0/src/lib/eliom_state.server.ml
+@@ -918,11 +918,11 @@ type 'a persistent_table =
+        bool *
+        (int64 * 'a) Ocsipersist.table)
+ 
+-let create_persistent_table ~scope ?secure name : 'a persistent_table =
++let create_persistent_table ~scope ?secure name : 'a persistent_table Lwt.t =
+   let sitedata = Eliom_request_info.find_sitedata "create_persistent_table" in
+   let secure = Eliom_common.get_secure secure sitedata in
+-  let t = Eliom_common.create_persistent_table name in
+-  (scope, secure, t)
++  Eliom_common.create_persistent_table name >>= fun t ->
++  Lwt.return (scope, secure, t)
+ 
+ let get_p_table_key_
+     ~table:(scope, secure, table)
+@@ -1271,10 +1271,8 @@ module Ext = struct
+ 
+   let get_persistent_cookie_info
+       ((_, _, cookie) : ([< Eliom_common.cookie_level ], [ `Pers ]) state) =
+-    Ocsipersist.find
+-      (Lazy.force Eliommod_persess.persistent_cookies_table)
+-      cookie
+-    >>= fun v ->
++    Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
++    Ocsipersist.find table cookie >>= fun v ->
+     Lwt.return (cookie, v)
+ 
+   let discard_state ~state =
+@@ -1487,10 +1485,8 @@ module Ext = struct
+     | None -> TNone
+     | Some t -> TSome t
+     in
+-    Ocsipersist.add
+-      (Lazy.force Eliom_common.persistent_cookies_table)
+-      cookie
+-      (fullstname, exp, ti, sessgrp)
++    Lazy.force Eliom_common.persistent_cookies_table >>= fun table ->
++     Ocsipersist.add table cookie (fullstname, exp, ti, sessgrp)
+ 
+   let get_service_cookie_timeout ~cookie:(_, (_, _, _, r, _, _)) =
+     !r
+@@ -1510,10 +1506,8 @@ module Ext = struct
+ 
+   let unset_persistent_data_cookie_timeout
+       ~cookie:(cookie, (fullstname, exp, _, sessgrp)) =
+-    Ocsipersist.add
+-      (Lazy.force Eliom_common.persistent_cookies_table)
+-      cookie
+-      (fullstname, exp, TGlobal, sessgrp)
++     Lazy.force Eliom_common.persistent_cookies_table >>= fun table ->
++     Ocsipersist.add table cookie (fullstname, exp, TGlobal, sessgrp)
+ 
+ 
+   let get_session_group_list () =
+Index: eliom-5.0.0/src/lib/eliom_state.server.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_state.server.mli
++++ eliom-5.0.0/src/lib/eliom_state.server.mli
+@@ -1019,7 +1019,7 @@ val remove_volatile_data :
+ val create_persistent_table :
+   scope:Eliom_common.user_scope ->
+   ?secure:bool ->
+-  string -> 'a persistent_table
++  string -> 'a persistent_table Lwt.t
+ 
+ (** gets persistent session data for the current persistent session (if any).
+     (low level) *)
+Index: eliom-5.0.0/src/lib/server/eliommod_cookies.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_cookies.ml
++++ eliom-5.0.0/src/lib/server/eliommod_cookies.ml
+@@ -152,8 +152,7 @@ let get_cookie_info
+         lazy
+           (catch
+              (fun () ->
+-               Ocsipersist.find
+-                 (Lazy.force Eliom_common.persistent_cookies_table) value >>=
++             Lazy.force Eliom_common.persistent_cookies_table >>= fun table 
-> Ocsipersist.find table value >>=
+                fun (full_state_name, persexp, perstimeout, sessgrp) ->
+ 
+                  Eliommod_sessiongroups.Pers.up value sessgrp >>= fun () ->
+Index: eliom-5.0.0/src/lib/server/eliommod_gc.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_gc.ml
++++ eliom-5.0.0/src/lib/server/eliommod_gc.ml
+@@ -309,7 +309,8 @@ let persistent_session_gc sitedata =
+         (fun () ->
+           let now = Unix.time () in
+           Lwt_log.ign_info ~section "GC of persistent sessions";
+-          (Ocsipersist.iter_table
++        Lazy.force Eliommod_persess.persistent_cookies_table >>=
++        Ocsipersist.iter_table
+              (fun k ((scope, _, _), exp, _, session_group) ->
+                (match exp with
+                | Some exp when exp < now ->
+@@ -320,8 +321,7 @@ let persistent_session_gc sitedata =
+                    session_group k
+                (*WAS: remove_from_all_persistent_tables k *)
+                | _ -> return ())
+-             )
+-             (Lazy.force Eliommod_persess.persistent_cookies_table)))
++             ))
+           >>=
+         f
+       in ignore (f ())
+Index: eliom-5.0.0/src/lib/server/eliommod_pagegen.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_pagegen.ml
++++ eliom-5.0.0/src/lib/server/eliommod_pagegen.ml
+@@ -135,8 +135,9 @@ let update_cookie_table ?now sitedata (c
+                       oldv = newc.Eliom_common.pc_value ->
+                     catch
+                       (fun () ->
++                      Lazy.force Eliommod_persess.persistent_cookies_table 
>>= fun table ->
+                         Ocsipersist.replace_if_exists
+-                          (Lazy.force 
Eliommod_persess.persistent_cookies_table)
++                        table
+                           newc.Eliom_common.pc_value
+                           (name,
+                            newexp,
+@@ -147,8 +148,9 @@ let update_cookie_table ?now sitedata (c
+                         (* someone else closed the session *)
+                         | e -> fail e)
+                   | _ ->
++                  Lazy.force Eliommod_persess.persistent_cookies_table >>= 
fun table ->
+                     Ocsipersist.add
+-                      (Lazy.force Eliommod_persess.persistent_cookies_table)
++                    table
+                       newc.Eliom_common.pc_value
+                       (name,
+                        newexp,
+Index: eliom-5.0.0/src/lib/server/eliommod_persess.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.ml
++++ eliom-5.0.0/src/lib/server/eliommod_persess.ml
+@@ -50,7 +50,7 @@ let number_of_persistent_table_elements
+   List.fold_left
+     (fun thr t ->
+       thr >>= fun l ->
+-      Ocsipersist.length (Ocsipersist.open_table t) >>= fun e ->
++      Ocsipersist.open_table t >>= fun table -> Ocsipersist.length table >>= 
fun e ->
+       return ((t, e)::l)) (return []) !perstables
+ 
+ let close_persistent_state2
+@@ -141,8 +141,7 @@ let rec find_or_create_persistent_cookie
+   (* We do not need to verify if it already exists.
+      make_new_session_id does never generate twice the same cookie. *)
+     let usertimeout = ref Eliom_common.TGlobal (* See global table *) in
+-    Ocsipersist.add
+-      (Lazy.force persistent_cookies_table) c
++    Lazy.force persistent_cookies_table >>= fun table -> Ocsipersist.add 
table c
+       (full_st_name,
+        None (* Some 0. *) (* exp on server - We'll change it later *),
+        Eliom_common.TGlobal (* timeout - see global config *),
+Index: eliom-5.0.0/src/lib/server/eliommod_persess.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.mli
++++ eliom-5.0.0/src/lib/server/eliommod_persess.mli
+@@ -22,7 +22,7 @@ val perstables : string list ref
+ val persistent_cookies_table :
+   (Eliom_common.full_state_name * float option * Eliom_common.timeout *
+    Eliom_common.perssessgrp option)
+-  Ocsipersist.table Lazy.t
++  Ocsipersist.table Lwt.t Lazy.t
+ val number_of_persistent_tables : unit -> int
+ val number_of_persistent_table_elements : unit -> (string * int) list Lwt.t
+ val close_persistent_state2 :
+Index: eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessadmin.ml
++++ eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml
+@@ -94,6 +94,7 @@ let close_all_data_states ~scope ~secure
+ 
+ 
+ let close_all_persistent_states2 full_st_name sitedata =
++  Lazy.force Eliommod_persess.persistent_cookies_table >>=
+   Ocsipersist.iter_table
+     (fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessiongrp) ->
+       if full_st_name = full_st_name2 && old_t = Eliom_common.TGlobal
+@@ -102,7 +103,6 @@ let close_all_persistent_states2 full_st
+         Lwt_unix.yield
+       else return ()
+     )
+-    (Lazy.force Eliommod_persess.persistent_cookies_table)
+ 
+ (** Close all persistent sessions for one session name.
+     If the optional parameter [?state_name] (session name) is not present,
+@@ -195,6 +195,7 @@ let update_pers_exp full_st_name sitedat
+       close_all_persistent_states2 full_st_name sitedata
+   | _ ->
+     let now = Unix.time () in
++    Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
+     Ocsipersist.iter_table
+       (fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessgrp) ->
+         if full_st_name = full_st_name2 && old_t =
+@@ -211,11 +212,7 @@ let update_pers_exp full_st_name sitedat
+               Eliommod_persess.close_persistent_state2
+                 ~scope sitedata sessgrp k
+           | _ ->
+-              Ocsipersist.add
+-                (Lazy.force Eliommod_persess.persistent_cookies_table)
+-                k
+-                (full_st_name2, newexp,
+-                 Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield
++            Ocsipersist.add table k (full_st_name2, newexp, 
Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield
+         else return ()
+       )
+-      (Lazy.force Eliommod_persess.persistent_cookies_table)
++      table
+Index: eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessexpl.ml
++++ eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml
+@@ -57,12 +57,12 @@ let iter_data_cookies f =
+ 
+     (** Iterator on persistent cookies *)
+ let iter_persistent_cookies f =
++  Lazy.force Eliommod_persess.persistent_cookies_table >>=
+   Ocsipersist.iter_table
+     (fun k v ->
+       f (k, v) >>=
+       Lwt_unix.yield
+     )
+-    (Lazy.force Eliommod_persess.persistent_cookies_table)
+ 
+ 
+     (** Iterator on service cookies *)
+@@ -94,13 +94,14 @@ let fold_data_cookies f beg =
+ 
+     (** Iterator on persistent cookies *)
+ let fold_persistent_cookies f beg =
++  Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
+   Ocsipersist.fold_table
+     (fun k v beg ->
+       f (k, v) beg >>= fun res ->
+       Lwt_unix.yield () >>= fun () ->
+       return res
+     )
+-    (Lazy.force Eliommod_persess.persistent_cookies_table)
++    table
+     beg
+ 
+ 
(*****************************************************************************)
+@@ -121,4 +122,4 @@ let number_of_table_elements () =
+   List.map (fun f -> f ()) !Eliommod_datasess.counttableelements
+ 
+ let number_of_persistent_cookies () =
+-  Ocsipersist.length (Lazy.force Eliommod_persess.persistent_cookies_table)
++  Lazy.force Eliommod_persess.persistent_cookies_table >>= Ocsipersist.length
+Index: eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml
+===================================================================
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessiongroups.ml
++++ eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml
+@@ -413,7 +413,7 @@ module Pers = struct
+ (*VVV Verify this carefully! *)
+ (*VVV VEOcsigen_request_infoFY concurrent access *)
+ 
+-  let grouptable : (nbmax * string list) Ocsipersist.table Lazy.t =
++  let grouptable : (nbmax * string list) Ocsipersist.table Lwt.t Lazy.t =
+     lazy (Ocsipersist.open_table "__eliom_session_group_table")
+       (* It is lazy because if the module is linked statically,
+          the creation of the table must happen after initialisation
+@@ -426,7 +426,7 @@ module Pers = struct
+     | Some g ->
+         Lwt.catch
+           (fun () ->
+-            Ocsipersist.find !!grouptable
++          !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable
+               (Eliom_common.string_of_perssessgrp g) >>= fun (_, a) ->
+             Lwt.return a)
+           (function
+@@ -439,7 +439,7 @@ module Pers = struct
+       let sg = Eliom_common.string_of_perssessgrp sg in
+       Lwt.catch
+         (fun () ->
+-          Ocsipersist.find !!grouptable sg >>= fun (max2, cl) ->
++        !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= 
fun (max2, cl) ->
+           let max, newmax = match set_max with
+             | None -> ((match max2 with
+                 | Default -> defaultmax
+@@ -449,7 +449,7 @@ module Pers = struct
+             | Some (Some v) -> Some v, Val v
+           in
+           let cl, toclose = cut max cl in
+-          Ocsipersist.replace_if_exists !!grouptable sg (newmax, 
(sess_id::cl))
++        Ocsipersist.replace_if_exists grouptable sg (newmax, (sess_id::cl))
+           >>= fun () ->
+           Lwt.return toclose)
+         (function
+@@ -459,7 +459,7 @@ module Pers = struct
+               | Some None -> Nolimit
+               | Some (Some v) -> Val v
+             in
+-            Ocsipersist.add !!grouptable sg (max, [sess_id]) >>= fun () ->
++          !!grouptable >>= fun grouptable -> Ocsipersist.add grouptable sg 
(max, [sess_id]) >>= fun () ->
+             Lwt.return []
+           | e -> Lwt.fail e)
+     | None -> Lwt.return []
+@@ -502,8 +502,7 @@ module Pers = struct
+                                       belonging to the group grp *)
+             (* group_name is the cookie value *)
+             remove sitedata group_name grp >>= fun () ->
+-            Ocsipersist.remove
+-              (!!Eliom_common.persistent_cookies_table) group_name
++          !!Eliom_common.persistent_cookies_table >>= fun table -> 
Ocsipersist.remove table group_name
+           | _ -> Lwt.return ())
+         >>= fun () ->
+ 
+@@ -511,7 +510,7 @@ module Pers = struct
+         match sess_grp with
+           | Some sg ->
+             let sg = Eliom_common.string_of_perssessgrp sg in
+-            Ocsipersist.remove !!grouptable sg
++          !!grouptable >>= fun grouptable -> Ocsipersist.remove grouptable sg
+           | None -> Lwt.return ()
+       )
+       (function Not_found -> Lwt.return () | e -> Lwt.fail e)
+@@ -526,7 +525,7 @@ module Pers = struct
+         match cookie_level with
+           | `Client_process -> begin
+             (* We remove cookie info from the table *)
+-            Ocsipersist.remove (!!Eliom_common.persistent_cookies_table) 
cookie
++          !!Eliom_common.persistent_cookies_table >>= fun table -> 
Ocsipersist.remove table cookie
+             >>= fun () ->
+ 
+             (* We remove the session from its group: *)
+@@ -555,7 +554,7 @@ module Pers = struct
+       let sg = Eliom_common.string_of_perssessgrp sg0 in
+       Lwt.catch
+         (fun () ->
+-          Ocsipersist.find !!grouptable sg >>= fun (max, cl) ->
++        !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= 
fun (max, cl) ->
+           let newcl = List.remove_first_if_any sess_id cl in
+           (match newcl with
+             | [] ->
+@@ -570,8 +569,8 @@ module Pers = struct
+                   remove_group ~cookie_level:`Session sitedata sess_grp
+                 | _ -> Lwt.return ()
+               ) >>= fun () ->
+-              Ocsipersist.remove !!grouptable sg
+-            | _ -> Ocsipersist.replace_if_exists !!grouptable sg (max, newcl)
++            Ocsipersist.remove grouptable sg
++            | _ -> Ocsipersist.replace_if_exists grouptable sg (max, newcl)
+           )
+         )
+         (function
+@@ -586,9 +585,9 @@ module Pers = struct
+         let sg = Eliom_common.string_of_perssessgrp sg in
+         Lwt.catch
+           (fun () ->
+-            Ocsipersist.find !!grouptable sg >>= fun (max, cl) ->
++          !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg 
>>= fun (max, cl) ->
+             let newcl = List.remove_first_if_any sess_id cl in
+-            Ocsipersist.replace_if_exists !!grouptable sg (max, 
sess_id::newcl)
++          Ocsipersist.replace_if_exists grouptable sg (max, sess_id::newcl)
+           )
+           (function
+             | Not_found -> Lwt.return ()
+@@ -601,6 +600,6 @@ module Pers = struct
+     end
+     else Lwt.return []
+ 
+-  let nb_of_groups () = Ocsipersist.length !!grouptable
++  let nb_of_groups () = !!grouptable >>= Ocsipersist.length
+ 
+ end

diff --git a/dev-ml/eliom/files/reactivedata.patch 
b/dev-ml/eliom/files/reactivedata.patch
new file mode 100644
index 00000000..190df85
--- /dev/null
+++ b/dev-ml/eliom/files/reactivedata.patch
@@ -0,0 +1,44 @@
+Index: eliom-5.0.0/src/lib/eliom_shared.eliom
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_shared.eliom
++++ eliom-5.0.0/src/lib/eliom_shared.eliom
+@@ -288,7 +288,7 @@ module FakeReactiveData = struct
+     val concat : 'a t -> 'a t -> 'a t
+     val value : 'a t -> 'a list
+     val synced : 'a t -> bool
+-    val signal : 'a t -> 'a list FakeReact.S.t
++    val signal : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list FakeReact.S.t
+     val singleton_s : 'a FakeReact.S.t -> 'a t
+     val map : ('a -> 'b) -> 'a t -> 'b t
+     val from_signal :
+@@ -304,7 +304,7 @@ module FakeReactiveData = struct
+     let singleton_s s = [FakeReact.S.value s], FakeReact.S.synced s
+     let value (l, _) = l
+     let synced (_, b) = b
+-    let signal (l, synced) = fst (FakeReact.S.create ~synced l)
++    let signal ?eq (l, synced) = fst (FakeReact.S.create ~synced l)
+     let map f (l, b) = List.map f l, b
+     let from_signal ?eq s = FakeReact.S.(value s, synced s)
+     module Lwt = struct
+@@ -635,7 +635,7 @@ module ReactiveData = struct
+     let value (s : 'a t) = {shared# 'a list {
+       FakeReactiveData.RList.value (Value.local %s) }}
+ 
+-    let signal (s : 'a t) = {shared# 'a list FakeReact.S.t {
++    let signal ?eq (s : 'a t) = {shared# 'a list FakeReact.S.t {
+       FakeReactiveData.RList.signal (Value.local %s) }}
+ 
+     let map f s = {shared# 'a FakeReactiveData.RList.t {
+Index: eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_shared_sigs.shared.mli
++++ eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli
+@@ -143,7 +143,7 @@ module type RLIST = sig
+ 
+   val concat : 'a t -> 'a t -> 'a t
+   val value : 'a t -> 'a list Eliom_lib.shared_value
+-  val signal : 'a t -> 'a list signal
++  val signal : ?eq:(('a -> 'a -> bool)) -> 'a t -> 'a list signal
+   val singleton_s : 'a signal -> 'a t
+   val map : ('a -> 'b) Eliom_lib.shared_value -> 'a t -> 'b t
+   val from_signal :

Reply via email to