Skip to content
Browse files

opam: small fixes

  • Loading branch information...
1 parent 8ac9c59 commit e431a3db1a8915128d4fa81e535d88b80afaab06 @lefessan lefessan committed
Showing with 32 additions and 7 deletions.
  1. +3 −3 opam.ocp
  2. +5 −1 src/opam.ml
  3. +19 −0 src/run.ml
  4. +2 −0 src_ext/Makefile
  5. +3 −3 src_ext/depends.ocp.boot
View
6 opam.ocp
@@ -3,13 +3,13 @@
ocamlc = [ "ocp-ocamlc.opt" ]
ocamlopt = [ "ocp-ocamlopt.opt" ]
*)
-
+
begin
comp += [ "-g" "-annot" "-warn-error" "A" ]
link += [ "-g" ]
begin library "opam-lib"
- dirname = [ "src" ]
+ subdir = [ "src" ]
files = [
"globals.ml"
"utils.ml"
@@ -36,7 +36,7 @@ begin library "opam-lib"
end
begin program "opam"
- dirname = [ "src" ]
+ subdir = [ "src" ]
files = [
"repo/curl.ml"
"repo/rsync.ml"
View
6 src/opam.ml
@@ -472,4 +472,8 @@ let () =
Globals.error "%s" s;
exit 2
| 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
View
19 src/run.ml
@@ -16,6 +16,25 @@
exception Process_error of Process.result
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 =
Printf.ksprintf (fun str -> raise (Internal_error str)) fmt
View
2 src_ext/Makefile
@@ -32,6 +32,7 @@ ocaml-re.1.1.tar.gz:
extlib.stamp: extlib-1.5.3.tar.gz
tar xfz extlib-1.5.3.tar.gz
+ rm -rf extlib
mv extlib-1.5.3 extlib
@touch $@
@@ -45,6 +46,7 @@ ocaml-arg.stamp: ocaml-arg.0.3.tar.gz
ocamlgraph.stamp: ocamlgraph-1.8.1.tar.gz
tar xfz ocamlgraph-1.8.1.tar.gz
+ rm -rf ocamlgraph
mv ocamlgraph-1.8.1 ocamlgraph
@touch $@
View
6 src_ext/depends.ocp.boot
@@ -62,7 +62,7 @@ begin library "arg"
"ocaml-arg/src/formatExt.ml"
"ocaml-arg/src/argExt.ml"
]
-
+
end
begin library "cudf"
@@ -133,7 +133,7 @@ end
begin library "dose"
sort = true
- pp = "camlp4o Camlp4MacroParser.cmo"
+ pp = [ "camlp4o"; "Camlp4MacroParser.cmo" ]
files = [
pack Common [
"dose/common/util.ml"
@@ -192,7 +192,7 @@ end
(*
begin program "cnftocudf"
- pp = "camlp4o Camlp4MacroParser.cmo"
+ pp = ["camlp4o" ; "Camlp4MacroParser.cmo" ]
files = [
pack Eclipse [
"dose/eclipse/version.ml"

0 comments on commit e431a3d

Please sign in to comment.
Something went wrong with that request. Please try again.