Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure OPAM_SWITCH_PREFIX is correctly set by opam env #3413

Merged
merged 1 commit into from
Jun 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ let get_opam_raw ?(set_opamroot=false) ?(set_opamswitch=false) ~force_path
root switch =
let env_file = OpamPath.Switch.environment root switch in
let upd = OpamFile.Environment.safe_read env_file in
let upd =
("OPAM_SWITCH_PREFIX", Eq,
OpamFilename.Dir.to_string (OpamPath.Switch.root root switch),
Some "Prefix of the current opam switch") ::
List.filter (function ("OPAM_SWITCH_PREFIX", Eq, _, _) -> false | _ -> true)
upd
in
let upd =
if force_path then
List.map (function
Expand Down