2020-07-18 16:06:22 +00:00
|
|
|
diff --git a/src/repository/opamRepositoryConfig.ml b/src/repository/opamRepositoryConfig.ml
|
|
|
|
index c2954c1d..528fc621 100644
|
|
|
|
--- a/src/repository/opamRepositoryConfig.ml
|
|
|
|
+++ b/src/repository/opamRepositoryConfig.ml
|
2021-08-05 21:33:18 +00:00
|
|
|
@@ -27,31 +27,7 @@ type 'a options_fun =
|
2020-07-18 16:06:22 +00:00
|
|
|
'a
|
|
|
|
|
|
|
|
let default = {
|
|
|
|
- download_tool = lazy (
|
2021-08-05 21:33:18 +00:00
|
|
|
- let os = OpamStd.Sys.os () in
|
2020-07-18 16:06:22 +00:00
|
|
|
- try
|
2021-08-05 21:33:18 +00:00
|
|
|
- let curl = "curl", `Curl in
|
2020-07-18 16:06:22 +00:00
|
|
|
- let tools =
|
2021-08-05 21:33:18 +00:00
|
|
|
- match os with
|
|
|
|
- | Darwin -> ["wget", `Default; curl]
|
|
|
|
- | FreeBSD -> ["fetch", `Default ; curl]
|
|
|
|
- | OpenBSD -> ["ftp", `Default; curl]
|
|
|
|
- | _ -> [curl; "wget", `Default]
|
2020-07-18 16:06:22 +00:00
|
|
|
- in
|
|
|
|
- let cmd, kind =
|
|
|
|
- List.find (fun (c,_) -> OpamSystem.resolve_command c <> None) tools
|
|
|
|
- in
|
|
|
|
- [ CIdent cmd, None ], kind
|
|
|
|
- with Not_found ->
|
|
|
|
- OpamConsole.error_and_exit `Configuration_error
|
|
|
|
- "Could not find a suitable download command. Please make sure you \
|
2021-08-05 21:33:18 +00:00
|
|
|
- have %s installed, or specify a custom command through variable \
|
|
|
|
- OPAMFETCH."
|
|
|
|
- (match os with
|
|
|
|
- | FreeBSD -> "fetch"
|
|
|
|
- | OpenBSD -> "ftp"
|
|
|
|
- | _ -> "either \"curl\" or \"wget\"")
|
2020-07-18 16:06:22 +00:00
|
|
|
- );
|
|
|
|
+ download_tool = lazy ([ CIdent SUBSTITUTE_NIXOS_CURL_PATH, None ], `Curl);
|
|
|
|
validation_hook = None;
|
|
|
|
retries = 3;
|
|
|
|
force_checksums = None;
|