about summary refs log tree commit diff
path: root/lib/jitterbug
diff options
context:
space:
mode:
authorJonathan "Duke" Leto <jonathan@leto.net>2011-01-11 10:47:35 -0800
committerJonathan "Duke" Leto <jonathan@leto.net>2011-01-11 15:03:20 -0500
commit0f24016d696f5a7fbac7de7e7712c8e26278bc8f (patch)
tree729a8147c3d6e1544be3361ba584b27dfec62ecc /lib/jitterbug
parentAdd the ability to CC an email when builds fail (diff)
downloadjitterbug-0f24016d696f5a7fbac7de7e7712c8e26278bc8f.tar.gz
Attempt to fix the mangled build failure email bug
Diffstat (limited to 'lib/jitterbug')
-rw-r--r--lib/jitterbug/Builder.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm
index 0d24620..58da724 100644
--- a/lib/jitterbug/Builder.pm
+++ b/lib/jitterbug/Builder.pm
@@ -136,15 +136,15 @@ sub run_task {
         if ( !$result || ($result && $result !~ /PASS/ )) {
             # mail author of the commit
             $result = "FAIL";
-            my $message  = $desc->{'message'};
-            my $commiter = $desc->{'author'}{'email'};
-            my $output   = "Build failed";
-            my $sha      = $desc->{'id'};
-            my $on_failure =
-                $conf->{'jitterbug'}{'build_process'}{'on_failure'};
-            my $on_failure_email =
-                $conf->{'jitterbug'}{'build_process'}{'on_failure_email'};
-            my $failure_cmd = "$on_failure $commiter $message $output $sha $on_failure_email";
+            my $message          = $desc->{'message'};
+            my $commiter         = $desc->{'author'}{'email'};
+            my $output           = "Build failed";
+            my $sha              = $desc->{'id'};
+            my $on_failure       = $conf->{'jitterbug'}{'build_process'}{'on_failure'};
+            my $on_failure_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_email'};
+
+            $message  =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g;
+            my $failure_cmd = qq{$on_failure '$commiter' '$message' '$output' $sha $on_failure_email};
             debug("Running failure command: $failure_cmd");
             `$failure_cmd`;
         }