package opam-core
Core library for opam 2.1
Install
dune-project
Dependency
Authors
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.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.1.3.tar.gz
md5=e55ac537cd9ab3d987454633fa439fa4
sha512=040e4f58f93e962ff422617ce0d35ed45dd86921a9aac3505914c33dd942d0e5e5771e7e1774046504f9aa84f32bc4fbd6ac7720fbea862d48bf1ca29e02cefc
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
(**************************************************************************) (* *) (* 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. *) (* *) (**************************************************************************) open OpamCompat module E = struct type OpamStd.Config.E.t += | 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 | USEOPENSSL of bool 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 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 useopenssl = value (function USEOPENSSL b -> b | _ -> 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 = { 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; use_openssl: bool; precise_tracking: bool; set: bool; } type 'a options_fun = ?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 -> ?use_openssl:bool -> ?precise_tracking:bool -> 'a let default = { 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; use_openssl = true; precise_tracking = false; set = false; } let setk k t ?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 ?use_openssl ?precise_tracking = let (+) x opt = match opt with Some x -> x | None -> x in k { 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; use_openssl = t.use_openssl + use_openssl; precise_tracking = t.precise_tracking + precise_tracking; set = true; } 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) ?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 ()) ?use_openssl:(E.useopenssl ()) ?precise_tracking:(E.precisetracking ()) let init ?noop:_ = initk (fun () -> ()) let answer () = match !r.confirm_level, !r.yes with | #OpamStd.Config.answer as c, _ -> c | _, Some true -> `all_yes | _, Some false -> `all_no | _ -> `ask let answer_is = let answer = lazy (answer ()) in fun a -> Lazy.force answer = a let answer_is_yes () = answer_is `all_yes || answer_is `unsafe_yes #ifdef DEVELOPER let developer = true #else let developer = false #endif
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>