Permalink
Browse files

Add some way to activate --debug via an env variable

  • Loading branch information...
1 parent 5f21e90 commit 5f94ccfb5ec75b6234b81400de2202e0158defd0 @samoht samoht committed Mar 29, 2012
Showing with 6 additions and 2 deletions.
  1. BIN boot/ocp-get.boot
  2. +4 −1 src/globals.ml
  3. +2 −1 src/run.ml
View
Binary file not shown.
View
@@ -13,7 +13,10 @@
(* *)
(***********************************************************************)
-let debug = ref false
+let debug = ref (
+ try let (_:string) = Sys.getenv "OCPGETDEBUG" in true
+ with _ -> false
+)
let version = "0.1+dev"
View
@@ -191,9 +191,10 @@ let sys_command_with_bin bin fmt =
path := new_path;
done;
log "cwd=%s path=%s %s" (Unix.getcwd ()) !path cmd;
- let (o,_,e as chans) = Unix.open_process_full cmd env in
+ let (o,i,e as chans) = Unix.open_process_full cmd env in
let s_of_l = String.concat "\n" in
(* we MUST read the input_channels otherwise [close_process] will fail *)
+ flush i;
let out = read_lines o in
let err = read_lines e in
let msg () = Globals.msg "out: %s\nerr: %s\n" (s_of_l out) (s_of_l err) in

0 comments on commit 5f94ccf

Please sign in to comment.