Skip to content

Commit 728f152

Browse files
committed
Removed base and stdio build dependencies
1 parent 90f9fd0 commit 728f152

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 4.6.2 (2020-08-04)
2+
3+
* Removed `base` and `stdio` build dependencies.
4+
5+
16
### 4.6.1 (2020-07-29)
27

38
* Fixed a bug in `request_cancel` that turned errors into success and

dune-project

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Postgresql offers library functions for accessing PostgreSQL databases.")
2525
(ocaml (>= 4.08))
2626
(dune (>= 1.10))
2727
dune-configurator
28-
(base :build)
29-
(stdio :build)
3028
(conf-postgresql :build)
3129
base-bytes
3230
)

postgresql.opam

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ depends: [
2424
"ocaml" {>= "4.08"}
2525
"dune" {>= "1.10"}
2626
"dune-configurator"
27-
"base" {build}
28-
"stdio" {build}
2927
"conf-postgresql" {build}
3028
"base-bytes"
3129
]

src/config/discover.ml

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
open Base
2-
open Stdio
1+
open Printf
32

43
let find_number ~pos str =
54
let len = String.length str in
@@ -20,7 +19,7 @@ let find_number ~pos str =
2019
| _ -> [], pos
2120
in
2221
let number_lst, next = loop ~pos in
23-
String.concat number_lst, next
22+
String.concat "" number_lst, next
2423

2524
let () =
2625
let module C = Configurator.V1 in
@@ -30,26 +29,26 @@ let () =
3029
try Unix.open_process_in cmd
3130
with exc -> eprintf "could not open pg_config, cmd: '%s'" cmd; raise exc
3231
in
33-
Exn.protectx ic ~finally:In_channel.close ~f:(fun ic ->
34-
let pgsql_includedir = "-I" ^ In_channel.input_line_exn ic in
35-
let pgsql_libdir = "-L" ^ In_channel.input_line_exn ic in
32+
Fun.protect ~finally:(fun () -> close_in ic) (fun () ->
33+
let pgsql_includedir = "-I" ^ input_line ic in
34+
let pgsql_libdir = "-L" ^ input_line ic in
3635
let major, minor =
37-
let line = In_channel.input_line_exn ic in
36+
let line = input_line ic in
3837
let print_fail () =
3938
eprintf "Unable to find versions from line '%s', cmd: '%s'" line cmd
4039
in
41-
let exit_fail () = print_fail (); Caml.exit 1 in
40+
let exit_fail () = print_fail (); exit 1 in
4241
try
43-
let first_space = String.index_exn line ' ' in
42+
let first_space = String.index line ' ' in
4443
let major, next = find_number ~pos:first_space line in
4544
let minor =
4645
(* Can also handle release candidates *)
4746
let c = line.[next] in
48-
if Char.(c = '.') then fst (find_number ~pos:next line)
49-
else if Char.(c <> 'r' || line.[next + 1] <> 'c') then exit_fail ()
47+
if c = '.' then fst (find_number ~pos:next line)
48+
else if c <> 'r' || line.[next + 1] <> 'c' then exit_fail ()
5049
else "0"
5150
in
52-
if String.(major = "" || minor = "") then exit_fail ()
51+
if major = "" || minor = "" then exit_fail ()
5352
else
5453
"-DPG_OCAML_MAJOR_VERSION=" ^ major,
5554
"-DPG_OCAML_MINOR_VERSION=" ^ minor

src/config/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(executables
22
(names discover)
3-
(libraries base stdio dune.configurator)
3+
(libraries dune.configurator)
44
)

0 commit comments

Comments
 (0)