Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Oct 7, 2024
1 parent ab64f05 commit 17a0b40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,16 @@ module OpamSys = struct
let process_in cmd args =
if Sys.win32 then
assert false;
print_endline ("'"^cmd^"' "^String.concat " " (List.map (fun x -> "'"^x^"'") args));
let args = Array.of_list (cmd :: args) in
let env = Env.raw_env () in
try
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
| Unix.WEXITED 0 -> print_endline "process ok"; Some r
| WEXITED _ | WSIGNALED _ | WSTOPPED _ -> print_endline "process failure"; None
with Unix.Unix_error _ | Sys_error _ | End_of_file -> print_endline "process exception"; None

let tty_out = Unix.isatty Unix.stdout

Expand Down Expand Up @@ -998,7 +999,6 @@ module OpamSys = struct
let memo_command =
let memo = Hashtbl.create 7 in
fun cmd arg ->
print_endline ("'"^cmd^"' '"^arg^"'");
try Hashtbl.find memo (cmd, arg) with Not_found ->
let r =
match process_in cmd [arg] with
Expand Down

0 comments on commit 17a0b40

Please sign in to comment.