package opam-core
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Core library for opam 2.5
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.5.2.tar.gz
md5=708dfb9799ebb5b9fccbdac63d0bf1e8
sha512=0b15627c4a31d3abcdbb5885bf2e7f4dee9ffddad2144855d1e1e18d66edc379e3a2b0a378097c35897e571f856b61aadabb47672d75401f6f6231f33ae475c8
doc/src/opam-core/opamCoreConfig.ml.html
Source file opamCoreConfig.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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234(**************************************************************************) (* *) (* Copyright 2015-2018 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. *) (* *) (**************************************************************************) module E = struct type OpamStd.Config.E.t += | AUTOANSWER of (string * OpamStd.Config.answer) list option | COLOR of OpamStd.Config.when_ option | CONFIRMLEVEL of OpamStd.Config.answer option | DEBUG of int option | DEBUGSECTIONS of OpamStd.Config.sections option | ERRLOGLEN of int option | KEEPLOGS of bool option | LOGS of string option | MERGEOUT of bool option | NO of bool option | PRECISETRACKING of bool option | SAFE of bool option | STATUSLINE of OpamStd.Config.when_ option | UTF8 of OpamStd.Config.when_ext option | UTF8MSGS of bool option | VERBOSE of OpamStd.Config.level option | YES of bool option open OpamStd.Config.E let autoanswer = value (function AUTOANSWER l -> l | _ -> None) let color = value (function COLOR c -> c | _ -> None) let confirmlevel = value (function CONFIRMLEVEL c -> c | _ -> None) let debug = value (function DEBUG i -> i | _ -> None) let debugsections = value (function DEBUGSECTIONS s -> s | _ -> None) let errloglen = value (function ERRLOGLEN i -> i | _ -> None) let keeplogs = value (function KEEPLOGS b -> b | _ -> None) let logs = value (function LOGS s -> s | _ -> None) let mergeout = value (function MERGEOUT b -> b | _ -> None) let no = value (function NO b -> b | _ -> None) let precisetracking = value (function PRECISETRACKING b -> b | _ -> None) let safe = value (function SAFE b -> b | _ -> None) let statusline = value (function STATUSLINE c -> c | _ -> None) let utf8 = value (function UTF8 c -> c | _ -> None) let utf8msgs = value (function UTF8MSGS b -> b | _ -> None) let verbose = value (function VERBOSE l -> l | _ -> None) let yes = value (function YES b -> b | _ -> None) end type t = { auto_answer: (string * OpamStd.Config.answer) list; debug_level: int; debug_sections: OpamStd.Config.sections; verbose_level: OpamStd.Config.level; color: OpamStd.Config.when_; utf8: OpamStd.Config.when_ext; disp_status_line: OpamStd.Config.when_; confirm_level: [ OpamStd.Config.answer | `undefined ]; yes: bool option; safe_mode: bool; log_dir: string; keep_log_dir: bool; errlog_length: int; merged_output: bool; precise_tracking: bool; (* Updated in OpamGlobalState.load_config and OpamArg.opam_init *) cygbin: string option; git_location: string option; set: bool; in_opam: bool; } type 'a options_fun = ?auto_answer:(string * OpamStd.Config.answer) list -> ?debug_level:int -> ?debug_sections:OpamStd.Config.sections -> ?verbose_level:OpamStd.Config.level -> ?color:OpamStd.Config.when_ -> ?utf8:OpamStd.Config.when_ext -> ?disp_status_line:OpamStd.Config.when_ -> ?confirm_level:OpamStd.Config.answer -> ?yes:bool option -> ?safe_mode:bool -> ?log_dir:string -> ?keep_log_dir:bool -> ?errlog_length:int -> ?merged_output:bool -> ?precise_tracking:bool -> ?cygbin:string -> ?git_location:string -> 'a let default = { auto_answer = []; debug_level = 0; debug_sections = OpamStd.String.Map.empty; verbose_level = 0; color = `Auto; utf8 = `Auto; disp_status_line = `Auto; confirm_level = `undefined; yes = None; safe_mode = false; log_dir = (let user = try Unix.getlogin() with Unix.Unix_error _ -> "xxx" in let base = Printf.sprintf "opam-%s-%d" user (OpamStubs.getpid()) in Filename.(concat (get_temp_dir_name ()) base)); keep_log_dir = false; errlog_length = 12; merged_output = true; precise_tracking = false; cygbin = None; git_location = None; set = false; in_opam = false; } let setk k t ?auto_answer ?debug_level ?debug_sections ?verbose_level ?color ?utf8 ?disp_status_line ?confirm_level ?yes ?safe_mode ?log_dir ?keep_log_dir ?errlog_length ?merged_output ?precise_tracking ?cygbin ?git_location = let (+) x opt = match opt with Some x -> x | None -> x in k { auto_answer = t.auto_answer + auto_answer; debug_level = t.debug_level + debug_level; debug_sections = t.debug_sections + debug_sections; verbose_level = t.verbose_level + verbose_level; color = t.color + color; utf8 = t.utf8 + utf8; disp_status_line = t.disp_status_line + disp_status_line; confirm_level = (match confirm_level with | Some (`all_yes|`all_no|`ask|`unsafe_yes as c) -> c | None -> t.confirm_level); yes = t.yes + yes; safe_mode = t.safe_mode + safe_mode; log_dir = t.log_dir + log_dir; keep_log_dir = t.keep_log_dir + keep_log_dir; errlog_length = t.errlog_length + errlog_length; merged_output = t.merged_output + merged_output; precise_tracking = t.precise_tracking + precise_tracking; cygbin = (match cygbin with Some _ -> cygbin | None -> t.cygbin); git_location = (match git_location with Some _ -> git_location | None -> t.git_location); set = true; in_opam = t.in_opam; } let set t = setk (fun x () -> x) t (* Global configuration reference *) let r = ref default let update ?noop:_ = setk (fun cfg () -> r := cfg) !r let initk k = let open OpamStd in let utf8 = Option.Op.( E.utf8 () ++ (E.utf8msgs () >>= function | true -> Some `Extended | false -> None) ) in let yes = match E.yes (), E.no () with | Some true, _ -> Some (Some true) | _, Some true -> Some (Some false) | _, _ -> None in (setk (setk (fun c -> r := c; k)) !r) ?auto_answer:(E.autoanswer ()) ?debug_level:(E.debug ()) ?debug_sections:(E.debugsections ()) ?verbose_level:(E.verbose ()) ?color:(E.color ()) ?utf8 ?disp_status_line:(E.statusline ()) ?confirm_level:(E.confirmlevel ()) ?yes ?safe_mode:(E.safe ()) ?log_dir:(E.logs ()) ?keep_log_dir:(E.keeplogs ()) ?errlog_length:(E.errloglen ()) ?merged_output:(E.mergeout ()) ?precise_tracking:(E.precisetracking ()) ?cygbin:None ?git_location:None let init ?noop:_ = initk (fun () -> ()) let answer ~name () = let fallback () = match !r.confirm_level, !r.yes with | #OpamStd.Config.answer as c, _ -> c | _, Some true -> `all_yes | _, Some false -> `all_no | _ -> `ask in match !r.auto_answer, name with | _::_ as l, Some name -> (match OpamStd.List.assoc_opt String.equal name l with | Some a -> a | None -> fallback ()) | [], _ | _, None -> fallback () let answer_is ~name a = answer ~name () = a let answer_is_yes ~name () = match answer ~name () with | #OpamStd.Config.yes_answer -> true | _ -> false let developer = not (String.equal OpamCoreConfigDeveloper.value "") let set_in_opam () = r := {!r with in_opam = true}
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>