Skip to content

Commit

Permalink
Merge pull request #103 from rjbou/conf
Browse files Browse the repository at this point in the history
permit conf package publishing without url field
  • Loading branch information
rjbou authored Aug 26, 2020
2 parents 3119a66 + a28b3ed commit 310d295
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/publishMain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ let get_metas tmpdir dirs opams urls repos tag names version =
tag_of_dir dir >>| fun t -> [{ m with tag = Some t }]
| _ -> None);
(function (* Github archive URL from repo and tag *)
| { repo = Some repo; tag = Some tag; url = None; _ } as m ->
| { repo = Some repo; tag = Some tag; url = None; opam; _ } as m ->
let no_url = match opam with
| None -> false
| Some opam ->
List.mem OpamTypes.Pkgflag_Conf
OpamFile.OPAM.(flags (safe_read opam))
in
if no_url then None else
let u =
Printf.sprintf "https://github.com/%s/%s/archive/%s.tar.gz"
(fst repo) (snd repo) tag
Expand Down Expand Up @@ -298,7 +305,7 @@ let get_metas tmpdir dirs opams urls repos tag names version =
let no_url = List.filter (fun m -> m.url = None) metas in
if no_url <> [] then
OpamConsole.warning
"These will be virtual packages: %s"
"These will be virtual or conf packages: %s"
(OpamStd.List.concat_map ", "
(fun m -> OpamConsole.colorise `bold (OpamPackage.to_string (package m)))
no_url);
Expand Down

0 comments on commit 310d295

Please sign in to comment.