Skip to content

Commit

Permalink
system: fix apply_cygpath_path_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Nov 2, 2023
1 parent c4961ba commit 9f44e00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,4 @@ users)
* `OpamSystem.mk_temp_dir`: resolve real path with `OpamSystem.real_path` before returning it [#5654 @rjbou]
* `OpamSystem.resolve_command`: in command resolution path, check that the file is not a directory and that it is a regular file [#5606 @rjbou - fix #5585 #5597 #5650 #5626]
* `OpamStd.Config.env_level`: fix level parsing, it was inverted (eg, "no" gives level 1, and "yes" level 0) [#5686 @smorimoto]
* `OpamSystem.apply_cygpath_path_transform`: fix cygpath call, use resoved name [#5716 @rjbou]
8 changes: 5 additions & 3 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,12 @@ let get_cygpath_function =
let f = Lazy.from_val (fun x -> x) in
fun ~command:_ -> f
let apply_cygpath_path_transform path =
let apply_cygpath_path_transform cygpath path =
let r =
OpamProcess.run
(OpamProcess.command ~name:(temp_file "command") ~verbose:false "cygpath" ["--path"; "--"; path])
(OpamProcess.command ~name:(temp_file "command") ~verbose:false
cygpath
["--path"; "--"; path])
in
OpamProcess.cleanup ~force:true r;
if OpamProcess.is_success r then
Expand All @@ -565,7 +567,7 @@ let get_cygpath_path_transform =
if Sys.win32 then
lazy (
match resolve_command "cygpath" with
| Some _ -> apply_cygpath_path_transform
| Some cygpath -> apply_cygpath_path_transform cygpath
| None -> fun x -> x)
else
Lazy.from_val (fun x -> x)
Expand Down

0 comments on commit 9f44e00

Please sign in to comment.