Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed display of the error report #1224

Merged
merged 1 commit into from
Mar 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/client/opamSolution.ml
Original file line number Diff line number Diff line change
Expand Up @@ -485,26 +485,26 @@ let parallel_apply t action solution =
OpamGlobals.msg "\n";
finalize ();
OpamGlobals.header_msg "Error report";
let print_actions oc actions =
let pr a = Printf.fprintf oc " - %s\n" (PackageAction.to_string a) in
List.iter pr actions in
if successful <> [] then (
OpamGlobals.msg
"These actions have been completed %s\n%s\n"
"These actions have been completed %s\n%a"
(OpamGlobals.colorise `bold "successfully")
(String.concat "\n"
(List.map PackageAction.to_string successful))
print_actions successful
);
if failed <> [] then (
OpamGlobals.msg
"The following %s\n%s\n"
"The following %s\n%a"
(OpamGlobals.colorise `bold "failed")
(String.concat "\n"
(List.map PackageAction.to_string failed))
print_actions failed
);
if remaining <> [] then (
OpamGlobals.msg
"Due to the errors, the following have been %s\n%s\n"
"Due to the errors, the following have been %s\n%a"
(OpamGlobals.colorise `bold "cancelled")
(String.concat "\n"
(List.map PackageAction.to_string remaining))
print_actions remaining
);
err
| _ -> assert false
Expand Down
17 changes: 9 additions & 8 deletions src/core/opamGlobals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ let error_and_exit fmt =

let display_messages = ref true

let msg fmt =
Printf.ksprintf (fun str ->
flush stderr;
if !display_messages then (
print_string str;
flush stdout;
)
) fmt
let msg =
if !display_messages then (
fun fmt ->
flush stderr;
Printf.kfprintf flush stdout fmt
) else (
fun fmt ->
Printf.ifprintf stdout fmt
)

let header_msg fmt =
let markl, markr = match !utf8_msgs with
Expand Down