[Pkg-ocaml-maint-commits] [SCM] nurpawiki packaging branch, master, updated. debian/1.2.3-3-6-g19a8ccf

Stephane Glondu steph at glondu.net
Mon Mar 15 15:05:15 UTC 2010


The following commit has been merged in the master branch:
commit 1a18035c2c2a48ea566fc194334428a7e8e25b4a
Author: Stephane Glondu <steph at glondu.net>
Date:   Mon Mar 15 15:38:33 2010 +0100

    Port to Ocsigen 1.3

diff --git a/debian/patches/0003-Port-to-Ocsigen-1.3.patch b/debian/patches/0003-Port-to-Ocsigen-1.3.patch
new file mode 100644
index 0000000..c48bd1e
--- /dev/null
+++ b/debian/patches/0003-Port-to-Ocsigen-1.3.patch
@@ -0,0 +1,206 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Mon, 15 Mar 2010 15:19:49 +0100
+Subject: [PATCH] Port to Ocsigen 1.3
+
+Signed-off-by: Stephane Glondu <steph at glondu.net>
+---
+ main.ml      |   28 ++++++++++++----------------
+ scheduler.ml |    6 +++---
+ services.ml  |    2 +-
+ session.ml   |   34 ++++++++++++++++------------------
+ types.ml     |    6 +++---
+ 5 files changed, 35 insertions(+), 41 deletions(-)
+
+diff --git a/main.ml b/main.ml
+index 897fd4d..cf7ad86 100644
+--- a/main.ml
++++ b/main.ml
+@@ -49,10 +49,9 @@ let task_side_effect_complete sp task_id () =
+             if Privileges.can_complete_task ~conn task_id user then
+               begin
+                 Db.complete_task ~conn ~user_id:user.user_id task_id;
+-                [Action_completed_task task_id]
+-              end
+-            else
+-              []))
++                let table = Eliom_sessions.get_request_cache sp in
++                Polytables.set ~table ~key:action_completed_task ~value:task_id
++              end))
+ 
+ 
+ let task_side_effect_undo_complete sp task_id () =
+@@ -61,8 +60,7 @@ let task_side_effect_undo_complete sp task_id () =
+        Db.with_conn 
+          (fun conn ->
+             if Privileges.can_complete_task ~conn task_id user then
+-              Db.uncomplete_task ~conn ~user_id:user.user_id task_id;
+-            []))
++              Db.uncomplete_task ~conn ~user_id:user.user_id task_id))
+ 
+ let task_side_effect_mod_priority sp (task_id, dir) () =
+   Session.action_with_user_login sp
+@@ -75,18 +73,16 @@ let task_side_effect_mod_priority sp (task_id, dir) () =
+                   Db.down_task_priority ~conn task_id
+                 else 
+                   Db.up_task_priority ~conn task_id;
+-                [Action_task_priority_changed task_id]
+-              end
+-            else
+-              []))
+-             
++                let table = Eliom_sessions.get_request_cache sp in
++                Polytables.set ~table ~key:action_task_priority_changed ~value:task_id
++              end))
+ 
+ let () =
+-  Eliom_predefmod.Actions.register 
++  Eliom_predefmod.Action.register
+     ~service:task_side_effect_complete_action task_side_effect_complete;
+-  Eliom_predefmod.Actions.register 
++  Eliom_predefmod.Action.register
+     ~service:task_side_effect_undo_complete_action task_side_effect_undo_complete;
+-  Eliom_predefmod.Actions.register 
++  Eliom_predefmod.Action.register
+     ~service:task_side_effect_mod_priority_action task_side_effect_mod_priority
+ 
+ let make_static_uri = Html_util.make_static_uri
+@@ -450,7 +446,7 @@ let todo_list_table_html sp ~conn ~cur_user cur_page todos =
+               Html_util.priority_css_class todo.t_priority in
+           let row_class =
+             row_pri_style::
+-              (if List.mem id priority_changes then 
++              (if priority_changes = Some id then
+                  ["todo_priority_changed"]
+                else 
+                  []) in
+@@ -688,7 +684,7 @@ let _ =
+                   (page_name,(None,(None,None)));
+                 br ();
+                 textarea ~name:chain ~rows:30 ~cols:80 
+-                  ~value:(pcdata wikitext) ()])])
++                  ~value:wikitext ()])])
+         (page_name,(None,(None,None))) in
+     Html_util.html_stub sp
+       (wiki_page_contents_html sp ~conn ~cur_user
+diff --git a/scheduler.ml b/scheduler.ml
+index cc72c60..11fe041 100644
+--- a/scheduler.ml
++++ b/scheduler.ml
+@@ -238,10 +238,10 @@ let rec render_todo_editor sp ~conn ~cur_user (src_page_cont, todos_to_edit) =
+          (tr (th [pcdata "ID"]) 
+             [th [pcdata "Description"]; th [pcdata "Activates on"]])
+          (f.it
+-            (fun (tv_id,(tv_act_date,(tv_descr,tv_owner_id))) todo ->
++            (fun (tv_id,(tv_act_date,(tv_descr,tv_owner_id))) todo accu ->
+                let pri_style = 
+                  Html_util.priority_css_class todo.t_priority in
+-               [tr ~a:[a_class [pri_style]]
++               (tr ~a:[a_class [pri_style]]
+                   (td [pcdata (string_of_int todo.t_id)])
+                   [td (todo_descr tv_descr todo.t_descr :: 
+                          wiki_page_links sp todo_in_pages todo);
+@@ -253,7 +253,7 @@ let rec render_todo_editor sp ~conn ~cur_user (src_page_cont, todos_to_edit) =
+                       button ~a:[a_id ("cal_button_"^(string_of_int todo.t_id))]
+                         ~button_type:`Button [pcdata "..."]];
+                    td [owner_selection tv_owner_id todo;
+-                       int_input ~name:tv_id ~input_type:`Hidden ~value:todo.t_id ()]]])
++                       int_input ~name:tv_id ~input_type:`Hidden ~value:todo.t_id ()]])::accu)
+             todos
+             [tr (td [string_input ~input_type:`Submit ~value:"Save" ();
+                      cancel_page src_page_cont]) []])] in
+diff --git a/services.ml b/services.ml
+index 3b27686..9fea92e 100644
+--- a/services.ml
++++ b/services.ml
+@@ -32,7 +32,7 @@ let wiki_view_page =
+                         ** (opt (bool "force_login"))) ()
+ 
+ let wiki_start = Eliom_predefmod.String_redirection.register_new_service [] unit
+-  (fun sp _ _ -> return (make_full_uri wiki_view_page sp (Config.site.cfg_homepage, (None, (None, None)))))
++  (fun sp _ _ -> return (make_uri ~absolute:true ~service:wiki_view_page ~sp (Config.site.cfg_homepage, (None, (None, None)))))
+ 
+ let wiki_edit_page = new_service ["edit"] (string "p") ()
+ 
+diff --git a/session.ml b/session.ml
+index c7ee4cb..7324557 100644
+--- a/session.ml
++++ b/session.ml
+@@ -204,13 +204,13 @@ let action_with_user_login sp f =
+                   if passwd_md5 = user.user_passwd then
+                     f user
+                   else
+-                    return []
++                    return ()
+               | None ->
+-                  return []
++                  return ()
+           end
+-      | None -> return []
++      | None -> return ()
+  else
+-   return []
++   return ()
+ 
+ 
+ let update_session_password sp login new_password =
+@@ -223,30 +223,28 @@ let update_session_password sp login new_password =
+    actions were called, some of them might've set values into session
+    that we want to use for rendering the current page. *)
+ let any_complete_undos sp =
+-  List.fold_left
+-    (fun acc e -> 
+-       match e with 
+-         Action_completed_task tid -> Some tid
+-       | _ -> acc)
+-    None (Eliom_sessions.get_exn sp)
++  let table = Eliom_sessions.get_request_cache sp in
++  try
++    Some (Polytables.get ~table ~key:action_completed_task)
++  with Not_found ->
++    None
+ 
+ (* Same as any_complete_undos except we check for changed task
+    priorities. *)
+ let any_task_priority_changes sp =
+-  List.fold_left
+-    (fun acc e -> 
+-       match e with 
+-         Action_task_priority_changed tid -> tid::acc
+-       | _ -> acc)
+-    [] (Eliom_sessions.get_exn sp)
++  let table = Eliom_sessions.get_request_cache sp in
++  try
++    Some (Polytables.get ~table ~key:action_task_priority_changed)
++  with Not_found ->
++    None
+ 
+ let connect_action_handler sp () login_nfo =
+   Eliom_sessions.close_session  ~sp () >>= fun () -> 
+     set_password_in_session sp login_nfo >>= fun () ->
+-      return []
++      return ()
+ 
+ let () =
+-  Eliom_predefmod.Actions.register ~service:connect_action connect_action_handler
++  Eliom_predefmod.Action.register ~service:connect_action connect_action_handler
+ 
+ (* /schema_install initializes the database schema (if needed) *)
+ let _ =
+diff --git a/types.ml b/types.ml
+index 0f68cc8..7eaf1b1 100644
+--- a/types.ml
++++ b/types.ml
+@@ -17,9 +17,9 @@
+ module OrdInt = struct type t = int let compare a b = compare a b end
+ module IMap = Map.Make (OrdInt)
+ 
+-(* Exceptions returned by Eliom actions *)
+-exception Action_completed_task of int
+-exception Action_task_priority_changed of int
++(* Sides-effects of Eliom actions *)
++let action_completed_task : int Polytables.key = Polytables.make_key ()
++let action_task_priority_changed : int Polytables.key = Polytables.make_key ()
+ 
+ type user = 
+     {
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 7233745..b83aa2d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Use-proper-connection-dependent-escaping.patch
 0002-Add-native-archive-to-META.patch
+0003-Port-to-Ocsigen-1.3.patch

-- 
nurpawiki packaging



More information about the Pkg-ocaml-maint-commits mailing list