[Pkg-ocaml-maint-commits] [SCM] ocaml-batteries packaging branch, build, updated. debian/0.20081011-1-206-gf4b8c95

Stefano Zacchiroli zack at upsilon.cc
Tue Nov 11 19:53:03 UTC 2008


The following commit has been merged in the build branch:
commit f4b8c9579937653ab3b010b1304a87ec38eba4e0
Author: Stefano Zacchiroli <zack at upsilon.cc>
Date:   Tue Nov 11 20:52:09 2008 +0100

    patch round
    
    - graceful degradation for missing -doc
    - consistent usage of docroot

diff --git a/debian/patches/debian/missing-doc.diff b/debian/patches/debian/missing-doc.diff
new file mode 100644
index 0000000..60d2275
--- /dev/null
+++ b/debian/patches/debian/missing-doc.diff
@@ -0,0 +1,61 @@
+From: Stefano Zacchiroli <zack at upsilon.cc>
+Subject: [PATCH] debian/missing-doc
+
+Provides Debian-specific info on how to install the documentation
+(needed for #help), in case it is missing.
+
+Signed-off-by: Stefano Zacchiroli <zack at upsilon.cc>
+
+---
+ src/batteries_toolchain/batteries_help.ml |   20 ++++++++++++++++++--
+ 1 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/src/batteries_toolchain/batteries_help.ml b/src/batteries_toolchain/batteries_help.ml
+index ca0d5af..12a917a 100644
+--- a/src/batteries_toolchain/batteries_help.ml
++++ b/src/batteries_toolchain/batteries_help.ml
+@@ -165,6 +165,16 @@ let man item =
+ 	      and sep   = Printf.sprintf "\nItem %S also exists as " item in
+ 		Printf.printf "%a\n%!" (List.print ~first ~sep ~last:"\n" String.print) lines;;
+ 
++let debian_doc_hint_warn =
++  "Warning: help will not be available, because Batteries documentation\n"
++  ^ "is not installed.\n"
++let debian_doc_hint_req =
++  "You have requested Batteries-specific help, but Batteries documentation\n"
++  ^ "is not installed.\n"
++let debian_doc_hint_inst =
++  "To fix this: please install the `libbatteries-ocaml-doc' Debian package\n"
++  ^ "(which ships Batteries documentation and its indexes) and try again.\n"
++
+ (** {6 Add directives}*)
+ 
+ module Extend =
+@@ -273,7 +283,10 @@ struct
+ 	   )
+       )
+       (File.lines_of root_file)
+-      with e ->
++      with
++	| Sys_error msg when String.ends_with msg "No such file or directory" ->
++	    Printf.eprintf "%s%s%!" debian_doc_hint_warn debian_doc_hint_inst
++	| e ->
+ 	Printf.eprintf
+ 	  "While initializing the on-line help, error root doc file %S\n%s%!" root_file
+ 	  (Printexc.to_string e)
+@@ -301,9 +314,12 @@ struct
+ end;;
+ 
+ let help () =
++  try
+   File.with_file_in (Batteries_config.documentation_root ^ "/toplevel.help")
+     (fun file -> copy file stdout);
+-  flush stdout;;
++  flush stdout
++  with Sys_error msg when String.ends_with msg "No such file or directory" ->
++    Printf.eprintf "%s%s%!" debian_doc_hint_req debian_doc_hint_inst
+ 
+ let init () =
+   Extend.auto_register ();
+-- 
+tg: (1c48dbf..) debian/missing-doc (depends on: fixes/consistent-docroot)
diff --git a/debian/patches/fixes/consistent-docroot.diff b/debian/patches/fixes/consistent-docroot.diff
new file mode 100644
index 0000000..57354e4
--- /dev/null
+++ b/debian/patches/fixes/consistent-docroot.diff
@@ -0,0 +1,31 @@
+From: Stefano Zacchiroli <zack at upsilon.cc>
+Subject: [PATCH] fixes/consistent-docroot
+
+use consistently Batteries_config.documentation_root
+
+before this patch, the value was used for looking for
+docroot/html/.. and also for docroot/doc/batteries/*.idex, with
+"doc/batteries" being redundant
+
+
+Signed-off-by: Stefano Zacchiroli <zack at upsilon.cc>
+
+---
+ src/batteries_toolchain/batteries_help.ml |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/batteries_toolchain/batteries_help.ml b/src/batteries_toolchain/batteries_help.ml
+index 28041f3..ca0d5af 100644
+--- a/src/batteries_toolchain/batteries_help.ml
++++ b/src/batteries_toolchain/batteries_help.ml
+@@ -235,7 +235,7 @@ struct
+ 	  index (Printexc.to_string e)
+ 
+   let auto_register () =
+-    let root_dir   = Filename.concat (Batteries_config.documentation_root) "doc/batteries"  in
++    let root_dir   = Batteries_config.documentation_root in
+     let root_file  = Filename.concat root_dir "documentation.idex" in
+       begin
+       try
+-- 
+tg: (eee8208..) fixes/consistent-docroot (depends on: upstream)
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..1ee1e8e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+fixes/consistent-docroot.diff -p1
+debian/missing-doc.diff -p1

-- 
ocaml-batteries packaging



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