Remove post-build error emailing.

kdesrc-build has supported emailing error messages for some time, at the
conclusion of the build process. There is no easier way to "modularize"
this code than to elide it completely, and given that no one seemed to
use it in the brief poll I conducted, I've removed it.
wilder
Michael Pyne 15 years ago
parent b7984c6f78
commit e7e89304e9
  1. 17
      doc/index.docbook
  2. 83
      kdesrc-build

@ -1545,13 +1545,8 @@ compiling, you would add "do-not-compile juk kscd" to your kdemultimedia setting
<entry>email-address</entry>
<entry>Cannot be overridden</entry>
<entry>
<para>Set this option to the e-mail address &kdesrc-build; should send from
should it ever need to send e-mail. You do not need to worry about this if you
do not use any feature which send e-mail. (They are all disabled by default).
<para>This option was removed in kdesrc-build 2.0.
</para>
<para>Currently only <link linkend="conf-email-on-compile-error">email-on-compile-error</link>
needs this option.</para>
</entry>
</row>
@ -1559,15 +1554,7 @@ needs this option.</para>
<entry>email-on-compile-error</entry>
<entry>Cannot be overridden</entry>
<entry>
<para>You can set this option to the email address to send a report to when a
module fails to build. &kdesrc-build; will wait until all the modules are done
and collate all of the results in the report. The report is only sent if a
module fails to build.
</para>
<para>Please see the <link linkend="conf-email-address">email-address</link>
option to set the address &kdesrc-build; should send from, since the default
is usually not what you want.
<para>This option was removed in kdesrc-build 2.0.
</para>
</entry>
</row>

@ -94,8 +94,6 @@ our %package_opts = (
"dest-dir" => '${MODULE}', # single quotes used on purpose!
"disable-agent-check" => 0, # If true we don't check on ssh-agent
"do-not-compile" => "",
"email-address" => "",
"email-on-compile-error" => "",
"git-repository-base" => {}, # Base path template for use multiple times.
"use-modules" => "",
"install-after-build" => 1, # Default to true
@ -7129,86 +7127,6 @@ sub whats_the_module_error
return $output;
}
# Subroutine to get the e-mail address to send e-mail from.
# It is pulled from the global email-address option by default.
# The first parameter is a default e-mail address to use (may be left off, in
# which case this function will create a default of its own if necessary.)
sub get_email_address
{
my $email = get_option('global', 'email-address');
my $default = shift;
# Use user's value if set.
return $email if $email;
# Let's use the provided default if set.
return $default if $default;
# Let's make a default of our own. It's likely to suck, so oh well.
my $username = getpwuid($>);
my $hostname = hostname; # From Sys::Hostname
debug "User has no email address, using $username\@$hostname";
return "$username\@$hostname";
}
# Subroutine to look through the various failed lists, and send an email to the
# given email address with a description of the failures. If the user has
# selected no email address the subroutine does nothing.
sub email_error_report
{
my $email_addy = get_option('global', 'email-on-compile-error');
my $from_addy = get_email_address($email_addy);
return unless $email_addy;
# Initial e-mail header.
my $email_body = <<EOF;
The following errors were detected in the kdesrc-build run just completed.
EOF
# Loop through modules trying to find out what caused the errors.
my $had_error = 0;
for my $type (@fail_display_order)
{
for my $module (@{$fail_lists{$type}})
{
$email_body .= "$module failed to $type:\n";
$email_body .= "-------------------------------\n\n";
$email_body .= whats_the_module_error($module);
$email_body .= "-------------------------------\n\n";
$had_error = 1;
}
}
return unless $had_error;
# Detect Mail::Mailer.
my $mailer;
eval {
require Mail::Mailer;
$mailer = new Mail::Mailer;
} or do {
error " y[*] Can't open y[b[Mail::Mailer] module, so e-mailing is disabled.";
debug "Error was $@";
return;
};
# Sendeth the email.
$mailer->open({
'From' => $from_addy,
'To' => $email_addy,
'Subject' => 'KDE build compile error',
});
print $mailer $email_body;
$mailer->close;
}
# Exits out of kdesrc-build, executing the user's preferred shell instead. The
# difference is that the environment variables should be as set in kdesrc-build
# instead of as read from .bashrc and friends.
@ -7700,7 +7618,6 @@ eval
cleanup_log_directory() if get_option('global', 'purge-old-logs');
output_failed_module_lists($ctx);
email_error_report();
$time = localtime;
my $color = '';

Loading…
Cancel
Save