Fix creation of localenv in all goals.
[goaljobs-goals.git] / libguestfs_upstream.ml
index 8272fff..6180989 100644 (file)
@@ -17,6 +17,12 @@ let () =
   Unix.putenv "LIBGUESTFS_DEBUG" "1";
   Unix.putenv "LIBGUESTFS_TRACE" "1"
 
+(* Log program output. *)
+let from = "rjones@redhat.com"
+let to_ = "rjones@redhat.com"
+let logfile = log_program_output ()
+let () = eprintf "logging to %s\n%!" logfile
+
 let package = "libguestfs"
 
 (* Helper object which stores everything about a version. *)
@@ -102,9 +108,11 @@ and website_built version =
   sh "
     tar zxf %s/tarballs/%s
     cd %s
+
     echo %s > localconfigure
     chmod +x localconfigure
-    echo %s > localenv .
+    echo %s > localenv
+
     ./localconfigure
     make
     make website
@@ -125,9 +133,11 @@ and tarball_tested version =
   sh "
     tar zxf %s/tarballs/%s
     cd %s
+
     echo %s > localconfigure
     chmod +x localconfigure
-    echo %s > localenv .
+    echo %s > localenv
+
     ./localconfigure
     make
     make check-release
@@ -151,7 +161,7 @@ and tarball_created version =
 
     echo %s > localconfigure
     chmod +x localconfigure
-    echo %s > localenv .
+    echo %s > localenv
 
     ./localconfigure
     make
@@ -165,6 +175,12 @@ and tarball_created version =
 
 (* Goal: test a commit. *)
 and commit_tested branch commit =
+  onfail (
+    fun _ ->
+      let subject = sprintf "goal: %s: FAILED" goalname in
+      mailto ~from ~subject ~attach:[logfile] to_
+  );
+
   let key = sprintf "libguestfs_commit_tested_%s" commit in
   target (memory_exists key);