revise startup, address urls pointing to same sha256 and support mirrors (upstream and in opam file) #24
1 changed files with 1 additions and 3 deletions
|
@ -173,7 +173,7 @@ module Make
|
||||||
| None -> Hashtbl.add sha256s hash url; url
|
| None -> Hashtbl.add sha256s hash url; url
|
||||||
| Some url' ->
|
| Some url' ->
|
||||||
if not (String.equal url url') then
|
if not (String.equal url url') then
|
||||||
Logs.warn (fun m -> m "same hash for url %s and %s" url url');
|
Logs.debug (fun m -> m "same hash for url %s and %s" url url');
|
||||||
url'
|
url'
|
||||||
in
|
in
|
||||||
let mirrors = SSet.of_list mirrors in
|
let mirrors = SSet.of_list mirrors in
|
||||||
|
@ -297,7 +297,6 @@ module Make
|
||||||
{ md5s = SM.empty ; sha512s = SM.empty ; checked = Some KS.empty ; dev; dev_md5s; dev_sha512s ; dev_swap }
|
{ md5s = SM.empty ; sha512s = SM.empty ; checked = Some KS.empty ; dev; dev_md5s; dev_sha512s ; dev_swap }
|
||||||
|
|
||||||
let add_checked t path =
|
let add_checked t path =
|
||||||
Logs.info (fun m -> m "add checked %a" Mirage_kv.Key.pp path);
|
|
||||||
match t.checked with
|
match t.checked with
|
||||||
| None -> ()
|
| None -> ()
|
||||||
| Some s -> t.checked <- Some (KS.add path s)
|
| Some s -> t.checked <- Some (KS.add path s)
|
||||||
|
@ -972,7 +971,6 @@ stamp: %S
|
||||||
Lwt.return_unit
|
Lwt.return_unit
|
||||||
| false ->
|
| false ->
|
||||||
let rec download url mirrors =
|
let rec download url mirrors =
|
||||||
Logs.info (fun m -> m "downloading %s (%u mirrors)" url (SSet.cardinal mirrors));
|
|
||||||
let retry () =
|
let retry () =
|
||||||
if SSet.is_empty mirrors then begin
|
if SSet.is_empty mirrors then begin
|
||||||
decr remaining_downloads;
|
decr remaining_downloads;
|
||||||
|
|
Loading…
Reference in a new issue