Skip to content

Commit

Permalink
opam: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Sep 25, 2012
1 parent 8ac9c59 commit e431a3d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
6 changes: 3 additions & 3 deletions opam.ocp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
ocamlc = [ "ocp-ocamlc.opt" ] ocamlc = [ "ocp-ocamlc.opt" ]
ocamlopt = [ "ocp-ocamlopt.opt" ] ocamlopt = [ "ocp-ocamlopt.opt" ]
*) *)

begin begin
comp += [ "-g" "-annot" "-warn-error" "A" ] comp += [ "-g" "-annot" "-warn-error" "A" ]
link += [ "-g" ] link += [ "-g" ]


begin library "opam-lib" begin library "opam-lib"
dirname = [ "src" ] subdir = [ "src" ]
files = [ files = [
"globals.ml" "globals.ml"
"utils.ml" "utils.ml"
Expand All @@ -36,7 +36,7 @@ begin library "opam-lib"
end end


begin program "opam" begin program "opam"
dirname = [ "src" ] subdir = [ "src" ]
files = [ files = [
"repo/curl.ml" "repo/curl.ml"
"repo/rsync.ml" "repo/rsync.ml"
Expand Down
6 changes: 5 additions & 1 deletion src/opam.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -472,4 +472,8 @@ let () =
Globals.error "%s" s; Globals.error "%s" s;
exit 2 exit 2
| Globals.Exit i -> exit i | Globals.Exit i -> exit i
| e -> raise e | e ->
let bt = Printexc.get_backtrace () in
Printf.fprintf stderr "Fatal error: exception %s\n\tat\n %s\n%!"
(Printexc.to_string e) bt;
exit 2
19 changes: 19 additions & 0 deletions src/run.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
exception Process_error of Process.result exception Process_error of Process.result
exception Internal_error of string exception Internal_error of string


let _ =
Printexc.register_printer (fun exn ->
let open Process in
match exn with
Process_error r ->
let b = Buffer.create 1000 in
Printf.bprintf b "Exception Run.Process_error {\n";
Printf.bprintf b "\tr_code = %d\n" r.r_code;
Printf.bprintf b "\tr_duration = %.2f\n" r.r_duration;
Printf.bprintf b "\tr_info = [ %s\t]\n"
(String.concat "\n\t\t" r.r_info);
Printf.bprintf b "\tr_stdout = [ %s\t]\n"
(String.concat "\n\t\t" r.r_stdout);
Printf.bprintf b "\tr_stderr = [ %s\t]\n"
(String.concat "\n\t\t" r.r_stderr);
Printf.bprintf b "\t\t}\n";
Some (Buffer.contents b)
| _ -> None)

let internal_error fmt = let internal_error fmt =
Printf.ksprintf (fun str -> raise (Internal_error str)) fmt Printf.ksprintf (fun str -> raise (Internal_error str)) fmt


Expand Down
2 changes: 2 additions & 0 deletions src_ext/Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ocaml-re.1.1.tar.gz:


extlib.stamp: extlib-1.5.3.tar.gz extlib.stamp: extlib-1.5.3.tar.gz
tar xfz extlib-1.5.3.tar.gz tar xfz extlib-1.5.3.tar.gz
rm -rf extlib
mv extlib-1.5.3 extlib mv extlib-1.5.3 extlib
@touch $@ @touch $@


Expand All @@ -45,6 +46,7 @@ ocaml-arg.stamp: ocaml-arg.0.3.tar.gz


ocamlgraph.stamp: ocamlgraph-1.8.1.tar.gz ocamlgraph.stamp: ocamlgraph-1.8.1.tar.gz
tar xfz ocamlgraph-1.8.1.tar.gz tar xfz ocamlgraph-1.8.1.tar.gz
rm -rf ocamlgraph
mv ocamlgraph-1.8.1 ocamlgraph mv ocamlgraph-1.8.1 ocamlgraph
@touch $@ @touch $@


Expand Down
6 changes: 3 additions & 3 deletions src_ext/depends.ocp.boot
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ begin library "arg"
"ocaml-arg/src/formatExt.ml" "ocaml-arg/src/formatExt.ml"
"ocaml-arg/src/argExt.ml" "ocaml-arg/src/argExt.ml"
] ]

end end


begin library "cudf" begin library "cudf"
Expand Down Expand Up @@ -133,7 +133,7 @@ end


begin library "dose" begin library "dose"
sort = true sort = true
pp = "camlp4o Camlp4MacroParser.cmo" pp = [ "camlp4o"; "Camlp4MacroParser.cmo" ]
files = [ files = [
pack Common [ pack Common [
"dose/common/util.ml" "dose/common/util.ml"
Expand Down Expand Up @@ -192,7 +192,7 @@ end
(* (*


begin program "cnftocudf" begin program "cnftocudf"
pp = "camlp4o Camlp4MacroParser.cmo" pp = ["camlp4o" ; "Camlp4MacroParser.cmo" ]
files = [ files = [
pack Eclipse [ pack Eclipse [
"dose/eclipse/version.ml" "dose/eclipse/version.ml"
Expand Down

0 comments on commit e431a3d

Please sign in to comment.