OpamEnvSourceProcess environment setup and handling, shell configuration
val get_full :
?set_opamroot:bool ->
?set_opamswitch:bool ->
force_path:bool ->
?updates:OpamTypes.env_update list ->
'a OpamStateTypes.switch_state ->
OpamTypes.envGet the current environment with OPAM specific additions. If force_path, the PATH is modified to ensure opam dirs are leading. set_opamroot and set_opamswitch can be additionally used to set the OPAMROOT and OPAMSWITCH variables.
val get_opam :
?set_opamroot:bool ->
?set_opamswitch:bool ->
force_path:bool ->
'a OpamStateTypes.switch_state ->
OpamTypes.envGet only environment modified by OPAM. If force_path, the PATH is modified to ensure opam dirs are leading. set_opamroot and set_opamswitch can be additionally used to set the OPAMROOT and OPAMSWITCH variables.
val get_opam_raw :
?set_opamroot:bool ->
?set_opamswitch:bool ->
force_path:bool ->
OpamTypes.dirname ->
OpamTypes.switch ->
OpamTypes.envLike get_opam, but reads the cache file from the given opam root and switch instead of computing the environment from a switch state
Returns the running environment, with any opam modifications cleaned out, and optionally the given updates
Update an environment, including reverting opam changes that could have been previously applied (therefore, don't apply to an already updated env as returned by e.g. get_full!)
val updates :
?set_opamroot:bool ->
?set_opamswitch:bool ->
?force_path:bool ->
'a OpamStateTypes.switch_state ->
OpamTypes.env_update listLike get_opam computes environment modification by OPAM , but returns these updates instead of the new environment.
Check if the shell environment is in sync with the current OPAM switch (or if OPAMNOENVNOTICE has been set, in which case we just assume it's up to date)
Check if the shell environment is in sync with the given opam root and switch (or if OPAMNOENVNOTICE has been set, in which case we just assume it's up to date)
val compute_updates :
?force_path:bool ->
'a OpamStateTypes.switch_state ->
OpamTypes.env_update listReturns the current environment updates to configure the current switch with its set of installed packages
val eval_string :
'a OpamStateTypes.global_state ->
?set_opamswitch:bool ->
OpamTypes.switch option ->
stringThe shell command to run by the user to set his OPAM environment, adapted to the current shell (as returned by eval `opam config env`)
Returns the updated contents of the PATH variable for the given opam root and switch (set force_path to ensure the opam path is leading)
val full_with_path :
force_path:bool ->
?updates:OpamTypes.env_update list ->
OpamTypes.dirname ->
OpamTypes.switch ->
OpamTypes.envReturns the full environment with only the PATH variable updated, as per path
val setup :
OpamTypes.dirname ->
interactive:bool ->
?dot_profile:OpamTypes.filename ->
?update_config:bool ->
?env_hook:bool ->
?completion:bool ->
OpamTypes.shell ->
unitSets the opam configuration in the user shell, after detailing the process and asking the user if either update_config or shell_hook are unset
val update_user_setup :
OpamTypes.dirname ->
?dot_profile:OpamTypes.filename ->
OpamTypes.shell ->
unitUpdate the user configuration in $HOME for good opam integration.
val write_static_init_scripts :
OpamTypes.dirname ->
?completion:bool ->
?env_hook:bool ->
unit ->
unitWrite the generic scripts in ~/.opam/opam-init needed to import state for various shells. If specified, completion and env_hook files can also be written or removed (the default is to keep them as they are)
Write into OpamPath.hooks_dir the given custom scripts (listed as (filename, content)), normally provided by opamrc (OpamFile.InitConfig)
Update the shell scripts containing the current switch configuration in ~/.opam/opam-init ; prints a warning and skips if a write lock on the global state can't be acquired (note: it would be better to acquire a write lock beforehand, but only when working on the switch selected in ~/.opam/config)
Removes the dynamic init scripts setting the variables for any given switch.
Print a warning if the environment is not set-up properly. (General message)