ocaml-lwt/oasis-common.patch
2012-06-15 00:17:39 +08:00

39 lines
1.1 KiB
Diff

--- setup.ml 2011-03-22 17:00:48.000000000 +0100
+++ setup.ml 2011-12-22 21:41:25.000000000 +0100
@@ -2662,10 +2662,14 @@
(ocamlc_config_map ())
0
in
- let nm_config =
+ let chop_version_suffix s =
+ try String.sub s 0 (String.index s '+')
+ with _ -> s
+ in
+ let nm_config, value_config =
match nm with
- | "ocaml_version" -> "version"
- | _ -> nm
+ | "ocaml_version" -> "version", chop_version_suffix
+ | _ -> nm, (fun x -> x)
in
var_redefine
nm
@@ -2677,7 +2681,7 @@
let value =
SMap.find nm_config map
in
- value
+ value_config value
with Not_found ->
failwithf2
(f_ "Cannot find field '%s' in '%s -config' output")
@@ -3057,7 +3061,7 @@
begin
let acc =
try
- Scanf.bscanf scbuf "%S %S@\n"
+ Scanf.bscanf scbuf "%S %S\n"
(fun e d ->
let t =
e, d