From 551de1aca81cf0f5f2105974e98379ed5b6c2e08 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Thu, 3 Jan 2019 17:55:48 +0100 Subject: [PATCH] GlobalState: externalise inferred from system description string --- src/state/opamGlobalState.ml | 6 +++++- src/state/opamGlobalState.mli | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/state/opamGlobalState.ml b/src/state/opamGlobalState.ml index 92aa9bca2a7..25815cd53b9 100644 --- a/src/state/opamGlobalState.ml +++ b/src/state/opamGlobalState.ml @@ -34,6 +34,8 @@ let load_config global_lock root = OpamFormatUpgrade.as_necessary global_lock root config; config +let inferred_from_system = "Inferred from system" + let load lock_kind = let root = OpamStateConfig.(!r.root_dir) in log "LOAD-GLOBAL-STATE @ %a" (slog OpamFilename.Dir.to_string) root; @@ -64,7 +66,9 @@ let load lock_kind = List.fold_left (fun acc (v,value) -> OpamVariable.Map.add v (lazy (Some (OpamStd.Option.default (S "unknown") (Lazy.force value))), - "Inferred from system") + (* Careful on changing it, it is used to determine user defined + variables on `config report`. See [OpamConfigCommand.help]. *) + inferred_from_system) acc) OpamVariable.Map.empty (OpamSysPoll.variables) diff --git a/src/state/opamGlobalState.mli b/src/state/opamGlobalState.mli index 4a298d8f0e0..f74fbba4e2a 100644 --- a/src/state/opamGlobalState.mli +++ b/src/state/opamGlobalState.mli @@ -60,3 +60,6 @@ val write: rw global_state -> unit registered if it is set and exists, and removing any non-existing switches. Writes back to disk if possible (ie lock is available) *) val fix_switch_list: 'a global_state -> 'a global_state + +(** Description used for system inferred variables *) +val inferred_from_system: string