Implement odig conventions properly
This commit is contained in:
parent
1b8dcad28f
commit
75335af4bc
|
@ -1526,19 +1526,8 @@ module Gen(P : Params) = struct
|
||||||
])
|
])
|
||||||
|> List.map ~f:(Install.Entry.make Lib)
|
|> List.map ~f:(Install.Entry.make Lib)
|
||||||
|
|
||||||
let add_doc_file fn entries =
|
let odig_doc_file_re =
|
||||||
let suffixes = [""; ".md"; ".org"; ".txt"] in
|
Re.(compile (alt [str "README"; str "LICENSE"; str "CHANGE"; str "HISTORY"]))
|
||||||
match
|
|
||||||
List.find_map suffixes ~f:(fun suf ->
|
|
||||||
let path = Path.of_string (fn ^ suf) in
|
|
||||||
if Path.exists path then
|
|
||||||
Some path
|
|
||||||
else
|
|
||||||
None)
|
|
||||||
with
|
|
||||||
| None -> entries
|
|
||||||
| Some path ->
|
|
||||||
Install.Entry.make Doc path :: entries
|
|
||||||
|
|
||||||
let install_file package =
|
let install_file package =
|
||||||
let entries =
|
let entries =
|
||||||
|
@ -1560,8 +1549,12 @@ module Gen(P : Params) = struct
|
||||||
| _ -> [])
|
| _ -> [])
|
||||||
in
|
in
|
||||||
let entries =
|
let entries =
|
||||||
List.fold_left ["README"; "LICENSE"] ~init:entries ~f:(fun acc fn ->
|
let root_listing = File_tree.Dir.files (File_tree.root P.file_tree) in
|
||||||
add_doc_file fn acc)
|
String_set.fold root_listing ~init:entries ~f:(fun fn acc ->
|
||||||
|
if Re.execp odig_doc_file_re fn then
|
||||||
|
Install.Entry.make Doc (Path.relative Path.root fn) :: acc
|
||||||
|
else
|
||||||
|
acc)
|
||||||
in
|
in
|
||||||
let entries =
|
let entries =
|
||||||
let opam = Path.of_string "opam" in
|
let opam = Path.of_string "opam" in
|
||||||
|
|
Loading…
Reference in New Issue