package opam-repository
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Repository library for opam 2.4
Install
dune-project
Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@outlook.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
2.4.0-alpha2.tar.gz
md5=0fb8e9f62683772592b1bc2d80a763b8
sha512=1c617b1c1656817a47ef65d02fc990357476f6c1b406c02717e5ff702a2c42e9f3818c2ddd54470926b2c5344c1c285216471a684d261be7a3ec84b05a32e726
doc/src/opam-repository/opamRepositoryConfig.ml.html
Source file opamRepositoryConfig.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160(**************************************************************************) (* *) (* Copyright 2015-2019 OCamlPro *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) open OpamTypes module E = struct type OpamStd.Config.E.t += | CURL of string option | FETCH of string option | NOCHECKSUMS of bool option | REPOSITORYTARRING of bool option | REQUIRECHECKSUMS of bool option | RETRIES of int option | VALIDATIONHOOK of string option open OpamStd.Config.E let curl = value (function CURL s -> s | _ -> None) let fetch = value (function FETCH s -> s | _ -> None) let nochecksums = value (function NOCHECKSUMS b -> b | _ -> None) let repositorytarring = value (function REPOSITORYTARRING b -> b | _ -> None) let requirechecksums = value (function REQUIRECHECKSUMS b -> b | _ -> None) let retries = value (function RETRIES i -> i | _ -> None) let validationhook = value (function VALIDATIONHOOK s -> s | _ -> None) let curl_t () = value_t (function CURL s -> s | _ -> None) let fetch_t () = value_t (function FETCH s -> s | _ -> None) end type dl_tool_kind = [ `Curl | `Default ] type t = { download_tool: (arg list * dl_tool_kind) Lazy.t; validation_hook: arg list option; retries: int; force_checksums: bool option; repo_tarring : bool; } type 'a options_fun = ?download_tool:(OpamTypes.arg list * dl_tool_kind) Lazy.t -> ?validation_hook:arg list option -> ?retries:int -> ?force_checksums:bool option -> ?repo_tarring:bool -> 'a let default = { (* Keep synchronised with [OpamInitDefaults.req_dl_tools] *) download_tool = lazy ( let os = OpamStd.Sys.os () in try let curl = "curl", `Curl in let tools = match os with | FreeBSD | DragonFly -> [curl; "fetch", `Default] | OpenBSD | NetBSD -> [curl; "ftp", `Default] | Linux | Darwin | Cygwin | Win32 | Unix | Other _ -> [curl; "wget", `Default] 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 \ have %s installed, or specify a custom command through variable \ OPAMFETCH." (match os with | FreeBSD -> "fetch" | OpenBSD -> "ftp" | _ -> "either \"curl\" or \"wget\"") ); validation_hook = None; retries = 3; force_checksums = None; repo_tarring = false; } let setk k t ?download_tool ?validation_hook ?retries ?force_checksums ?repo_tarring = let (+) x opt = match opt with Some x -> x | None -> x in k { download_tool = t.download_tool + download_tool; validation_hook = t.validation_hook + validation_hook; retries = t.retries + retries; force_checksums = t.force_checksums + force_checksums; repo_tarring = t.repo_tarring + repo_tarring; } let set t = setk (fun x () -> x) t let r = ref default let update ?noop:_ = setk (fun cfg () -> r := cfg) !r let initk k = let open OpamStd.Option.Op in let download_tool = E.fetch () >>= (fun s -> let args = OpamStd.String.split s ' ' in match args with | cmd::a -> let cmd, kind = if OpamStd.String.ends_with ~suffix:"curl" cmd then (CIdent "curl", None), `Curl else if cmd = "wget" then (CIdent "wget", None), `Default else (CString cmd, None), `Default in let c = cmd :: List.map (fun a -> OpamTypes.CString a, None) a in Some (c, kind) | [] -> None ) |> (fun fetch -> match E.curl (), fetch with | None, fetch -> OpamStd.Option.map Lazy.from_val fetch | Some cmd, Some (((CIdent "curl"| CString "curl"), filter)::args, _) -> Some (lazy ((CString cmd, filter)::args, `Curl)) | Some cmd, None -> Some (lazy ([CString cmd, None], `Curl)) | Some _, _ -> (* ignored *) OpamStd.Option.map Lazy.from_val fetch) in let validation_hook = E.validationhook () >>| fun s -> match List.map (fun s -> CString s, None) (OpamStd.String.split s ' ') with | [] -> None | l -> Some l in let force_checksums = match E.requirechecksums (), E.nochecksums () with | Some true, _ -> Some (Some true) | _, Some true -> Some (Some false) | None, None -> None | _ -> Some None in setk (setk (fun c -> r := c; k)) !r ?download_tool ?validation_hook ?retries:(E.retries ()) ?force_checksums ?repo_tarring:(E.repositorytarring ()) let init ?noop:_ = initk (fun () -> ())
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>