Skip to content

Commit

Permalink
Merge pull request ocaml#5716 from rjbou/cygpath-call
Browse files Browse the repository at this point in the history
system: fix apply_cygpath_path_transform
  • Loading branch information
kit-ty-kate authored Nov 13, 2023
2 parents 0670b46 + c9b12c6 commit 73583fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ users)
* `OpamStd.Config.env_level`: fix level parsing, it was inverted (eg, "no" gives level 1, and "yes" level 0) [#5686 @smorimoto]
* `OpamStd.Sys.chop_exe_suffix`: removes `.exe` from the end of a path, if present
* `OpamSystem.get_cygpath_path_transform`: add labeled argument to specify if path is a pathlist [#5636 @rjbou]
* `OpamSystem.apply_cygpath_path_transform`: fix cygpath call, use resolved name [#5716 @rjbou]
8 changes: 4 additions & 4 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,12 @@ let get_cygpath_function =
let f = Lazy.from_val (fun x -> x) in
fun ~command:_ -> f
let apply_cygpath_path_transform ~pathlist path =
let apply_cygpath_path_transform ~pathlist cygpath path =
let args = if pathlist then [ "--path" ] else [] in
let r =
OpamProcess.run
(OpamProcess.command ~name:(temp_file "command")
~verbose:false "cygpath" (args @ ["--"; path]))
(OpamProcess.command ~name:(temp_file "command") ~verbose:false
cygpath (args @ ["--"; path]))
in
OpamProcess.cleanup ~force:true r;
if OpamProcess.is_success r then
Expand All @@ -567,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 ~pathlist:_ x -> x)
else
Lazy.from_val (fun ~pathlist:_ x -> x)
Expand Down

0 comments on commit 73583fc

Please sign in to comment.