From 3c9cad9b13e8756948ffa0e148921970b57e58fd Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 7 Oct 2024 20:02:19 +0100 Subject: [PATCH] !fixup restore OCaml < 4.13 support --- src/core/opamStd.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/opamStd.ml b/src/core/opamStd.ml index eed8eb3e857..e1e7862e587 100644 --- a/src/core/opamStd.ml +++ b/src/core/opamStd.ml @@ -909,12 +909,17 @@ module OpamSys = struct let args = Array.of_list (cmd :: args) in let env = Env.raw_env () in try + let path = split_path_variable (Env.get "PATH") in + let cmd = + List.find OpamStubs.is_executable + (List.map (fun d -> Filename.concat d cmd) path) + in let (ic, _, _) as p = Unix.open_process_args_full cmd args env in let r = input_line ic in match Unix.close_process_full p with | Unix.WEXITED 0 -> Some r | WEXITED _ | WSIGNALED _ | WSTOPPED _ -> None - with Unix.Unix_error _ | Sys_error _ | End_of_file -> None + with Unix.Unix_error _ | Sys_error _ | End_of_file | Not_found -> None let tty_out = Unix.isatty Unix.stdout