Skip to content

Commit

Permalink
upgrade: handle non http backend on repo upgrade (#3596)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Oct 16, 2018
1 parent 8ebe84c commit a699b9e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/client/opamAdminRepoUpgrade.ml
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,17 @@ let do_upgrade repo_root =
let opam =
match OpamFile.OPAM.url opam with
| Some urlf when OpamFile.URL.checksum urlf = [] ->
(match OpamProcess.Job.run (get_url_md5 (OpamFile.URL.url urlf)) with
| None -> None
| Some hash ->
Some
(OpamFile.OPAM.with_url (OpamFile.URL.with_checksum [hash] urlf)
opam))
let url = OpamFile.URL.url urlf in
(match url.OpamUrl.backend with
| #OpamUrl.version_control -> Some opam
| `rsync when OpamUrl.local_dir url <> None -> Some opam
| _ ->
(match OpamProcess.Job.run (get_url_md5 url) with
| None -> None
| Some hash ->
Some
(OpamFile.OPAM.with_url (OpamFile.URL.with_checksum [hash] urlf)
opam)))
| _ -> Some opam
in
match opam with
Expand Down

0 comments on commit a699b9e

Please sign in to comment.