Skip to content
Snippets Groups Projects
Commit d9f10155 authored by Allan Blanchard's avatar Allan Blanchard Committed by Andre Maroneze
Browse files

[kernel] fix env variable naming

parent 75de54fd
No related branches found
No related tags found
No related merge requests found
...@@ -414,8 +414,8 @@ struct ...@@ -414,8 +414,8 @@ struct
else Datatype.Filepath.concat path plugin_subpath else Datatype.Filepath.concat path plugin_subpath
let base_dir () = let base_dir () =
if is_visible && Dir_name.is_set () if is_visible && is_set ()
then Dir_name.get () then get ()
else add_plugin @@ D.dir () else add_plugin @@ D.dir ()
let get_dir ?(mode=`Normalize_only) s = let get_dir ?(mode=`Normalize_only) s =
...@@ -485,10 +485,18 @@ struct ...@@ -485,10 +485,18 @@ struct
I.name I.name
end) end)
(struct (struct
let is_kernel = is_kernel () (* the side effect must be applied right now *)
let var_name =
"FRAMAC_" ^
(if is_kernel
then ""
else (Stdlib.String.uppercase_ascii P.shortname) ^ "_") ^
(Stdlib.String.uppercase_ascii I.name)
let dir () = let dir () =
let var = "FRAMAC_" ^ (Stdlib.String.uppercase_ascii I.name) in
if I.kernel_is_set () then I.kernel_get () if I.kernel_is_set () then I.kernel_get ()
else match Sys.getenv_opt var with else match Sys.getenv_opt var_name with
| Some p when p <> "" -> Fc_Filepath.Normalized.of_string p | Some p when p <> "" -> Fc_Filepath.Normalized.of_string p
| _ -> I.getter () | _ -> I.getter ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment