Author: Ralf Treinen <treinen@debian.org>
Description: add option -o to buildcheck (redirects output)
Debian-bug: 757643
Upstream-commit: 72dcb2efa9c8e9a5f127afd9b27fdbca4ce03a76

Index: dose3/doc/manpages/buildcheck.pod
===================================================================
--- dose3.orig/doc/manpages/buildcheck.pod	2014-09-14 20:46:15.813165184 +0200
+++ dose3/doc/manpages/buildcheck.pod	2014-09-14 20:46:15.813165184 +0200
@@ -96,6 +96,10 @@
 
 Display this list of options. 
 
+=item B<-o> I<file>
+
+Send output to I<file>.
+
 =back
 =cut
 
Index: dose3/applications/deb-buildcheck.ml
===================================================================
--- dose3.orig/applications/deb-buildcheck.ml	2014-09-14 20:46:00.000000000 +0200
+++ dose3/applications/deb-buildcheck.ml	2014-09-14 20:47:36.185164790 +0200
@@ -64,8 +64,13 @@
   Boilerplate.enable_timers (OptParse.Opt.get Options.timers) ["Solver"];
   Util.Debug.disable "Depsolver_int";
   Boilerplate.all_quiet (OptParse.Opt.get Options.quiet);
-
-  let fmt = Format.std_formatter in
+  let fmt =
+    if OptParse.Opt.is_set Options.outfile then
+      let oc = open_out (OptParse.Opt.get Options.outfile) in
+      Format.formatter_of_out_channel oc
+    else
+      Format.std_formatter
+  in
   if OptParse.Opt.is_set Options.deb_native_arch then
     Format.fprintf fmt "native-architecture: %s@." (OptParse.Opt.get Options.deb_native_arch)
   else
