Skip to content

Commit

Permalink
Fix some needles
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Nov 15, 2024
1 parent 20f28f5 commit 75e6e1b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/driver/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
(public_name odoc_driver)
(package odoc-driver)
(link_deps
(package odoc))
(package odoc)
(package odoc-md))
(preprocess
(pps ppx_sexp_conv))
(libraries
Expand Down
27 changes: 16 additions & 11 deletions src/driver/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,22 @@ let pkg_contents { name; _ } =
OpamFile.make @@ OpamFilename.raw @@ Filename.basename changes_file
in
let changed =
OpamFilename.with_contents
(fun str ->
OpamFile.Changes.read_from_string ~filename
@@
(* Field [opam-version] is invalid in [*.changes] files, displaying a warning. *)
if OpamStd.String.starts_with ~prefix:"opam-version" str then
match OpamStd.String.cut_at str '\n' with
| Some (_, str) -> str
| None -> assert false
else str)
file
try
OpamFilename.with_contents
(fun str ->
OpamFile.Changes.read_from_string ~filename
@@
(* Field [opam-version] is invalid in [*.changes] files, displaying a warning. *)
if OpamStd.String.starts_with ~prefix:"opam-version" str then
match OpamStd.String.cut_at str '\n' with
| Some (_, str) -> str
| None -> assert false
else str)
file
with _ ->
Logs.err (fun m ->
m "Error while reading: %s. Considering it empty." changes_file);
OpamStd.String.Map.empty
in
let added =
OpamStd.String.Map.fold
Expand Down

0 comments on commit 75e6e1b

Please sign in to comment.