diff --git a/config.ml b/config.ml index 9690f5b41d6b182122039ca29449dd36bb46e651..56a8b532c8430f6d2552c316f8c288555a53c845 100644 --- a/config.ml +++ b/config.ml @@ -28,7 +28,7 @@ let exe_path_of_solver solver = let module S = (val solver: Solver.S) in (* We want the complete path of [exe] in $PATH: we use `command -v [exe]' and retrieve the result, if any. *) - let tmp = Filename.temp_file "caisar" "command" in + let tmp = Filename.temp_file S.name "command" in let _retcode = Sys.command (Filename.quote_command @@ -41,7 +41,7 @@ let exe_path_of_solver solver = with End_of_file -> false, S.exe_name in Stdlib.close_in in_channel; - Utils.remove_on_app_mode tmp; + Utils.remove_on_normal_mode tmp; if found then Ok exe else begin @@ -144,7 +144,7 @@ let detect_default_solvers () = provided path via env variable, by executing `solver --version' command. *) let module S = (val solver: Solver.S) in - let tmp = Filename.temp_file "caisar" "detect" in + let tmp = Filename.temp_file S.name "detect" in let cmd = Filename.quote_command ~stdout:tmp ~stderr:tmp @@ -173,7 +173,7 @@ let detect_default_solvers () = None end else begin - Utils.remove_on_app_mode tmp; + Utils.remove_on_normal_mode tmp; (* If available, we save a [config] for solver. *) let version = version_of_solver solver cmd_output in let config = { name = S.name; exe; version; } in diff --git a/engine.ml b/engine.ml index a599d648be301a916630952931fc0eb1494eafb2..bb66dc3044165b33d08876e5ad1f30ad7fe4d3e0 100644 --- a/engine.ml +++ b/engine.ml @@ -33,7 +33,7 @@ let check_availability solver config = Logs.debug (fun m -> m "Checking actual availability of `%s'." S.name); try (* Execute command `solver --version' to check actual availability. *) - let tmp = Filename.temp_file "caisar" "avail" in + let tmp = Filename.temp_file S.name "avail" in let cmd = Filename.quote_command ~stdout:tmp ~stderr:tmp @@ -47,7 +47,7 @@ let check_availability solver config = Stdlib.close_in in_channel; if retcode = 0 then begin - Utils.remove_on_app_mode tmp; + Utils.remove_on_normal_mode tmp; Ok () end else @@ -213,9 +213,9 @@ let exec_tasks ~raw_options solver config model tasks_htbl = m "See error messages in `%s' for more information." log) else begin - Utils.remove_on_app_mode log; - Utils.remove_on_app_mode prop; - Utils.remove_on_app_mode output; + Utils.remove_on_normal_mode log; + Utils.remove_on_normal_mode prop; + Utils.remove_on_normal_mode output; end; Ok result end diff --git a/utils.ml b/utils.ml index b3de56d18afdb6ea7f99ee582db3f53d45c84db1..d39033e56097899be709dea791c9c89ca0728b4c 100644 --- a/utils.ml +++ b/utils.ml @@ -4,11 +4,11 @@ (* *) (**************************************************************************) -let remove_on_app_mode filename = - let is_app = +let remove_on_normal_mode filename = + let verbose = match Logs.level () with - | Some App -> true + | Some Info | Some Debug -> true | _ -> false in - if is_app + if not verbose then Sys.remove filename diff --git a/utils.mli b/utils.mli index be657a8c58139d7982b6153fa285ae7ede89441c..c2851d9d585fc8034e501d93bed1bf93756500b4 100644 --- a/utils.mli +++ b/utils.mli @@ -4,6 +4,6 @@ (* *) (**************************************************************************) -(** [remove_on_app_mode filename] removes the given file from the file system - when caisar is run in application mode only. *) -val remove_on_app_mode: string -> unit +(** [remove_on_normal_mode filename] removes the given file from the file system + when caisar is run without any active verbosity. *) +val remove_on_normal_mode: string -> unit