[Pkg-ocaml-maint-commits] [ocamlbricks] 10/19: New upstream version 0.90+bzr455
Lucas Nussbaum
lucas at moszumanska.debian.org
Mon Oct 30 22:29:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
lucas pushed a commit to branch master
in repository ocamlbricks.
commit 260c49c11910f8efc29f159d2d880e67c4a9f55f
Author: Lucas Nussbaum <lucas at debian.org>
Date: Mon Oct 30 13:25:58 2017 +0100
New upstream version 0.90+bzr455
---
BASE/argv.ml | 10 +++-
CAMLP4/include_type_definitions_p4.ml | 87 ++++++++++++++++++++++++++++++++++-
DOT/dot_widget.ml | 16 +++++--
EXTRA/arrayExtra.ml | 2 +-
EXTRA/listExtra.ml | 2 +-
EXTRA/sysExtra.ml | 8 +++-
EXTRA/threadExtra.ml | 10 +++-
Makefile | 6 +--
Makefile.local | 14 ++++--
STRUCTURES/endpoint.ml | 2 +-
meta.ml.released | 18 --------
11 files changed, 136 insertions(+), 39 deletions(-)
diff --git a/BASE/argv.ml b/BASE/argv.ml
index 079423d..cdc9138 100644
--- a/BASE/argv.ml
+++ b/BASE/argv.ml
@@ -398,9 +398,15 @@ let register_float_list1_argument ?tests ?(error_msg="float argument(s) expected
Bool arguments
----------------------------------------- *)
+IFNDEF OCAML4_04_OR_LATER THEN
+let lowercase = String.lowercase
+ELSE
+let lowercase = String.lowercase_ascii
+ENDIF
+
let register_bool_optional_argument ?(default=None) () =
let result = ref default in
- let spec = Optional (fun v -> result := Some (bool_of_string (String.lowercase v))) in
+ let spec = Optional (fun v -> result := Some (bool_of_string (lowercase v))) in
(arguments_register := spec::!arguments_register);
result
;;
@@ -414,7 +420,7 @@ let register_bool_argument ?(error_msg="bool argument expected") () =
let register_bool_list0_argument () =
let result = ref [] in
- let callback = (fun v -> result := (bool_of_string (String.lowercase v))::!result) in
+ let callback = (fun v -> result := (bool_of_string (lowercase v))::!result) in
(arguments_register := (List0 callback)::!arguments_register);
result
;;
diff --git a/CAMLP4/include_type_definitions_p4.ml b/CAMLP4/include_type_definitions_p4.ml
index b81ffe4..6b8c0bf 100644
--- a/CAMLP4/include_type_definitions_p4.ml
+++ b/CAMLP4/include_type_definitions_p4.ml
@@ -26,10 +26,15 @@ module Id = struct
let version = "$Id: include_type_definitions_p4.ml,v 0.1 2009/03/18 16:16:16 $"
end
+(* ----------------------------------- *)
+(* --- Version for OCaml <= 4.02.y --- *)
+(* ----------------------------------- *)
+IFNDEF OCAML4_04_OR_LATER THEN
+(* ----------------------------------- *)
module Make (Syntax : Sig.Camlp4Syntax) = struct
open Sig
include Syntax
-
+
let change_str_item_outermost_location_to loc = function
| Ast.StNil _ -> Ast.StNil loc
| Ast.StSem (_, str_item1, str_item2) -> Ast.StSem (loc, str_item1, str_item2)
@@ -40,7 +45,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| Ast.StMty (_, str, module_type) -> Ast.StMty (loc, str, module_type)
(* Other cases are not possible here: *)
| _ -> assert false
-
+
EXTEND Gram
GLOBAL: str_item;
@@ -97,4 +102,82 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
end
+(* ----------------------------------- *)
+(* --- Version for OCaml >= 4.04.y --- *)
+(* ----------------------------------- *)
+ELSE
+(* ----------------------------------- *)
+module Make (Syntax : Sig.Camlp4Syntax) = struct
+ open Sig
+ include Syntax
+
+ let change_str_item_outermost_location_to loc = function
+ | Ast.StNil _ -> Ast.StNil loc
+ | Ast.StSem (_, str_item1, str_item2) -> Ast.StSem (loc, str_item1, str_item2)
+ | Ast.StCls (_, class_expr) -> Ast.StCls (loc, class_expr)
+ | Ast.StClt (_, class_type) -> Ast.StClt (loc, class_type)
+ | Ast.StTyp (_, rec_flag, ctyp) -> Ast.StTyp (loc, rec_flag, ctyp)
+ | Ast.StExc (_, ctyp, ident) -> Ast.StExc (loc, ctyp, ident)
+ | Ast.StMty (_, str, module_type) -> Ast.StMty (loc, str, module_type)
+ (* Other cases are not possible here: *)
+ | _ -> assert false
+
+ EXTEND Gram
+ GLOBAL: str_item;
+
+ str_item: FIRST
+ [ [
+ "INCLUDE"; "DEFINITIONS"; fname = STRING ->
+
+ let parse_file file =
+ let ch = open_in file in
+ let st = Stream.of_channel ch in
+ (Gram.parse sig_items (Loc.mk file) st)
+ in
+
+ let rec list_of_sgSem = function
+ | Ast.SgNil _ -> []
+ | Ast.SgSem (_, x, xs) -> x :: (list_of_sgSem xs)
+ | x -> [x]
+ in
+
+ let t = parse_file fname
+ in
+ let is_TyDcl_a_definition = function
+ | Ast.TyDcl (_, _, _, Ast.TyNil _, _) -> false
+ | Ast.TyDcl (_, _, _, _ , _) -> true
+ | _ -> false
+ in
+ let pred = function
+ | Ast.SgTyp (_, rec_flag, (Ast.TyAnd(_,_,_) as t)) ->
+ let xs = Ast.list_of_ctyp t [] in
+ List.for_all is_TyDcl_a_definition xs
+ | Ast.SgTyp (_, rec_flag, tyDcl) when (is_TyDcl_a_definition tyDcl) -> true
+ | Ast.SgExc (_,_)
+ | Ast.SgMty (_,_,_)
+ | Ast.SgClt (_,_) -> true
+ | _ -> false
+ in
+ let l = List.filter pred (list_of_sgSem t) in
+ let mill = function
+ | Ast.SgTyp (a, rec_flag, Ast.TyDcl (b,c,d,e,f)) -> Ast.StTyp (a, rec_flag, Ast.TyDcl (b,c,d,e,f))
+ | Ast.SgTyp (a, rec_flag, Ast.TyAnd (b,c,d)) -> Ast.StTyp (a, rec_flag, Ast.TyAnd (b,c,d))
+ | Ast.SgExc (a,b) -> Ast.StExc (a,b,Ast.ONone)
+ | Ast.SgMty (a,b,c) -> Ast.StMty (a,b,c)
+ | Ast.SgClt (a,b) -> Ast.StClt (a,b)
+ | _ -> assert false
+ in
+ let result =
+ Ast.stSem_of_list (List.map mill l)
+ in
+ change_str_item_outermost_location_to _loc result
+ ] ]
+ ;
+
+ END
+
+end
+
+ENDIF
+
let module M = Register.OCamlSyntaxExtension (Id) (Make) in ()
diff --git a/DOT/dot_widget.ml b/DOT/dot_widget.ml
index 0fabbf6..842424a 100644
--- a/DOT/dot_widget.ml
+++ b/DOT/dot_widget.ml
@@ -17,12 +17,22 @@
(* Do not remove the following comment: it's an ocamldoc workaround. *)
(** *)
+IFNDEF OCAML4_04_OR_LATER THEN
+let lowercase = String.lowercase
+let uppercase = String.uppercase
+let capitalize = String.capitalize
+ELSE
+let lowercase = String.lowercase_ascii
+let uppercase = String.uppercase_ascii
+let capitalize = String.capitalize_ascii
+ENDIF
+
let make_dot_filter_by_format_and_description ~output_format_as_string ~description =
let ext = output_format_as_string in
let name = Printf.sprintf "%s (*.%s)" description ext in
- let patt1 = String.lowercase ext in
- let patt2 = String.uppercase ext in
- let patt3 = String.capitalize ext in
+ let patt1 = lowercase ext in
+ let patt2 = uppercase ext in
+ let patt3 = capitalize ext in
let patterns = List.map (Printf.sprintf "*.%s") [patt1; patt2; patt3] in
GFile.filter ~name ~patterns ()
diff --git a/EXTRA/arrayExtra.ml b/EXTRA/arrayExtra.ml
index 36befd6..17b3eb9 100644
--- a/EXTRA/arrayExtra.ml
+++ b/EXTRA/arrayExtra.ml
@@ -536,7 +536,7 @@ let cut ~lengths xs =
let start_len_list = start_len_list_of_lengths lengths in
try
List.map (fun (start, len) -> Array.sub xs start len) start_len_list
- with Invalid_argument "Array.sub" -> invalid_arg "ArrayExtra.cut"
+ with Invalid_argument s -> invalid_arg (Printf.sprintf "ArrayExtra.cut (%s)" s)
(** As standard [Array.sub] but with optional length (if not provided, the length is defined
in order to take the rest of the list after the given position) *)
diff --git a/EXTRA/listExtra.ml b/EXTRA/listExtra.ml
index c4a10df..0152d09 100644
--- a/EXTRA/listExtra.ml
+++ b/EXTRA/listExtra.ml
@@ -550,7 +550,7 @@ let cut ~lengths xs =
try
let segments = List.map (fun (start, len) -> Array.sub a start len) start_len_list in
List.map Array.to_list segments
- with Invalid_argument "Array.sub" -> invalid_arg "ListExtra.cut"
+ with Invalid_argument s -> invalid_arg (Printf.sprintf "ListExtra.cut (%s)" s)
(** Similar to [List.fold_left] but the iterated function takes three values [(xs, x, xs')], instead of just [x], as second argument.
diff --git a/EXTRA/sysExtra.ml b/EXTRA/sysExtra.ml
index 3c72fe3..d78a114 100644
--- a/EXTRA/sysExtra.ml
+++ b/EXTRA/sysExtra.ml
@@ -17,6 +17,12 @@
(* Do not remove the following comment: it's an ocamldoc workaround. *)
(** *)
+IFNDEF OCAML4_04_OR_LATER THEN
+let lowercase = String.lowercase
+ELSE
+let lowercase = String.lowercase_ascii
+ENDIF
+
(** More sophisticated version of [Sys.getenv].
The result is None if and only if something goes wrong in retrieving
and converting the value from the environment
@@ -48,7 +54,7 @@ let meaningful_getenv x =
method non_empty_string = ov
method int = try Option.map int_of_string ov with _ -> None
method float = try Option.map float_of_string ov with _ -> None
- method bool = try Option.map (fun v -> bool_of_string (String.lowercase v)) ov with _ -> None
+ method bool = try Option.map (fun v -> bool_of_string (lowercase v)) ov with _ -> None
method existing_file = Option.filter (Sys.file_exists) ov
method existing_directory = try Option.filter (Sys.is_directory) ov with _ -> None
end
diff --git a/EXTRA/threadExtra.ml b/EXTRA/threadExtra.ml
index e423baf..ee23d2d 100644
--- a/EXTRA/threadExtra.ml
+++ b/EXTRA/threadExtra.ml
@@ -16,6 +16,12 @@
(** Additional features for the module [Thread] provided by the [threads] library. *)
+IFNDEF OCAML4_02_OR_LATER THEN
+let lazy_is_val = Lazy.lazy_is_val
+ELSE
+let lazy_is_val = Lazy.is_val
+ENDIF
+
module Log = Ocamlbricks_log
module ULog = Ocamlbricks_log.Unprotected (* for critical sections *)
@@ -46,7 +52,7 @@ module Exit_function = struct
let id = Thread.id (Thread.self ()) in
let key = (pid, id) in
let action () =
- if Lazy.lazy_is_val ht then
+ if lazy_is_val ht then
let ht = Lazy.force ht in
begin
try
@@ -73,7 +79,7 @@ module Exit_function = struct
let pid = Unix.getpid () in
let id = Thread.id (Thread.self ()) in
let action () =
- if Lazy.lazy_is_val ht then begin
+ if lazy_is_val ht then begin
let ht = Lazy.force ht in
let (actions, exo_actions) = (ref 0, ref 0) in
(* Executes all thunks related to the *same* process: *)
diff --git a/Makefile b/Makefile
index 6e301ed..3e6c4f7 100644
--- a/Makefile
+++ b/Makefile
@@ -441,7 +441,7 @@ install-libraries: libraries install-libraries-local
shopt -s nullglob; \
cp -f META $(OTHER_LIBRARY_FILES_TO_INSTALL) \
_build/*.cma _build/*.cmxa _build/*.a _build/*.so \
- `find _build/ -name \*.cmi | grep -v /myocamlbuild` \
+ `find _build/ -name \*.cm\[iox\] | grep -v /myocamlbuild` \
`find _build/ -name \*.mli | grep -v /myocamlbuild` \
$(LIBRARYPREFIX)/$$name/) && \
if test -d $(LIBRARYPREFIX)/stublibs/; then \
@@ -935,8 +935,8 @@ meta.ml: META CONFIGME
meta.ml.released: meta.ml
if [ -d .bzr ]; then \
- cp $< $@ ; \
- fi
+ cp $< $@
+ fi; \
###########################################################################
# Include the project-dependant file (if any) which implements the '-local'
diff --git a/Makefile.local b/Makefile.local
index bce8000..dd6da22 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -44,9 +44,13 @@ OCAML4_OR_LATER=$(shell if grep -q "^[4-9]" <<<"$(OCAML_VERSION)"; then echo "-D
# Empty for OCaml 3.x.y series, set to "-DOCAML4_02_OR_LATER" for 4.02.y or later:
OCAML4_02_OR_LATER=$(shell if grep -q "^\([5-9]\)\|\(4[.]\([1-9]\|0[2-9]\)\)" <<<"$(OCAML_VERSION)"; then echo "-DOCAML4_02_OR_LATER"; fi)
+# Empty for OCaml 3.x.y series, set to "-DOCAML4_04_OR_LATER" for 4.04.y or later:
+OCAML4_04_OR_LATER=$(shell if grep -q "^\([5-9]\)\|\(4[.]\([1-9]\|0[4-9]\)\)" <<<"$(OCAML_VERSION)"; then echo "-DOCAML4_04_OR_LATER"; fi)
+
# Transmit the information about the compiler version in order to
# activate conditional compilation:
-PP_OPTION = camlp4of $(OCAML4_OR_LATER) $(OCAML4_02_OR_LATER)
+PP_OPTION = camlp4of $(OCAML4_OR_LATER) $(OCAML4_02_OR_LATER) $(OCAML4_04_OR_LATER)
+
GETTEXT=GETTEXT
C_OBJECTS_TO_LINK = gettext-c-wrapper does-process-exist-c-wrapper waitpid-c-wrapper
@@ -86,18 +90,18 @@ EXCLUDE_FROM_EDITING=meta_ocamlbricks.ml
# include_type_definitions_p4
_build/include_type_definitions_p4.cmi: CAMLP4/include_type_definitions_p4.mli
- ocamlc -c -I +camlp4 -pp camlp4of -o $@ $<
+ ocamlc -c -I +camlp4 -pp '$(PP_OPTION)' -o $@ $<
_build/include_type_definitions_p4.cmo: CAMLP4/include_type_definitions_p4.ml
- ocamlc -c -I +camlp4 -I _build/ -pp camlp4of -o $@ $<
+ ocamlc -c -I +camlp4 -I _build/ -pp '$(PP_OPTION)' -o $@ $<
# include_as_string_p4
_build/include_as_string_p4.cmi: CAMLP4/include_as_string_p4.mli
- ocamlc -c -I +camlp4 -pp camlp4of -o $@ $<
+ ocamlc -c -I +camlp4 -pp '$(PP_OPTION)' -o $@ $<
_build/include_as_string_p4.cmo: CAMLP4/include_as_string_p4.ml
- ocamlc -c -I +camlp4 -I _build/ -pp camlp4of -o $@ $<
+ ocamlc -c -I +camlp4 -I _build/ -pp '$(PP_OPTION)' -o $@ $<
_build/where_p4.cmi: CAMLP4/where_p4.mli
ocamlc -c -I +camlp4 -pp camlp4of -o $@ $<
diff --git a/STRUCTURES/endpoint.ml b/STRUCTURES/endpoint.ml
index e409a44..dea3a59 100644
--- a/STRUCTURES/endpoint.ml
+++ b/STRUCTURES/endpoint.ml
@@ -160,7 +160,7 @@ let iter_words ?d (f : recno -> fieldno -> word -> unit) t =
(** {b Example}:
{[
-Source.map_words (fun _ _ -> String.capitalize) (Source.Filename "/etc/fstab") ;;
+Source.map_words (fun _ _ -> String.capitalize_ascii) (Source.Filename "/etc/fstab") ;;
: string array array =
\[|\[|"#"; "/etc/fstab:"; "Static"; "File"; "System"; "Information."|\];
...
diff --git a/meta.ml.released b/meta.ml.released
deleted file mode 100644
index 22c3afc..0000000
--- a/meta.ml.released
+++ /dev/null
@@ -1,18 +0,0 @@
-(** Automatically generated meta-informations about the project and its building. *)
-(* This file is automatically generated; please don't edit it. *)
-
-let name = "ocamlbricks";;
-let version = "trunk";;
-let prefix = "/usr/local";;
-let prefix_install = "/usr/local";;
-let ocaml_version = "4.02.3";;
-let ocaml_libraryprefix = "/usr/lib/ocaml";;
-let libraryprefix = "/usr/lib/ocaml";;
-let configurationprefix = "/etc";;
-let localeprefix = "/usr/local/share/locale";;
-let documentationprefix = "/usr/local/share/doc";;
-let uname = "Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux";;
-let build_date = "2017-10-08 23:06:30 +0200";;
-let revision = "454";;
-let source_date = "2017-07-04 16:05:26 +0200";;
-let source_date_utc_yy_mm_dd = "2017-07-04";;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocamlbricks.git
More information about the Pkg-ocaml-maint-commits
mailing list