diff options
author | unknown <joerg@mysql.com> | 2005-03-07 16:23:55 +0100 |
---|---|---|
committer | unknown <joerg@mysql.com> | 2005-03-07 16:23:55 +0100 |
commit | bda53f8c1e3b340333585b6898b2092a8d569aea (patch) | |
tree | a96235a521f2e2adfb1b79d3ad2ef62d7f955789 /Build-tools/Do-compile | |
parent | 32773212f543a9f28c2b0b2354476078fa46cd14 (diff) | |
download | mariadb-git-bda53f8c1e3b340333585b6898b2092a8d569aea.tar.gz |
Avoid empty build (failure) mails on Solaris (backport from 4.1).
Build-tools/Do-compile:
Backport of a change Lenz did in 4.1 (without it, Solaris sends empty mails):
Improved the abort subroutine to not rely on an external "tail" command (the
default /usr/bin/tail on Solaris does not understand the "-n" notation).
Get rid of a "useless use of cat" case in the process.
Diffstat (limited to 'Build-tools/Do-compile')
-rwxr-xr-x | Build-tools/Do-compile | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 1f83a9a37e1..5756d06a116 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -617,16 +617,20 @@ sub abort if ($opt_user) { - $mail_header_file="$opt_tmp/do-command.$$"; - open(TMP,">$mail_header_file"); + # Take the last 40 lines of the build log + open(LOG, "$log") or die $!; + my @log= <LOG>; + close LOG; + splice @log => 0, -40; + my $mail_file="$opt_tmp/do-command.$$"; + open(TMP,">$mail_file") or die $!; print TMP "From: mysqldev\@$full_host_name\n"; print TMP "To: $email\n"; print TMP "Subject: $host($uname): $ver$opt_version_suffix compilation failed\n\n"; + print TMP @log; close TMP; - system("tail -n 40 $log > $log.mail"); - system("cat $mail_header_file $log.mail | $sendmail -t -f $email"); - unlink($mail_header_file); - unlink("$log.mail"); + system("$sendmail -t -f $email < $mail_file"); + unlink($mail_file); } exit 1; } |