push @errors, "no directory element specified in directive";
}
- # Set email addresses
- if (defined $header{directory}) {
- my @a = directory_email_addresses($header{directory});
- foreach my $address (@a) {
- # Do not include duplicates
- push (@{$info{email}}, $address)
- unless (grep($_ eq $address,@{$info{email}}) > 0);
- }
- }
-
if (@errors) {
throw directive_syntax =>
trace => \@trace, summary => $errors[0], directory => $header{directory};
sub guess_email_address_from_signature {
my $directive_file_contents = shift;
+ my @addresses;
+
# If we don't know whose project this file belongs to, because the
# 'directory:' line is messed up or not there, we'd still like to let the
# uploader know something went wrong. So let's see if we can match the
unless ($tmp_result->{exitcode} != 0 || defined $tmp_result->{TILT}) {
if (($tmp_result->{raw_log} =~ /Good signature from .*?<(.*?)>/))
- { push(@{$info{email}},$1) }
+ { push @addresses, $1 }
}
}
+
+ return @addresses;
}
=item validate_directive ( $packet, $oplist )
$directive = read_directive_from_string($directive_text);
- # this function just updates $info{email}
- guess_email_address_from_signature($directive_text);
+ push @email_addresses,
+ guess_email_address_from_signature($directive_text);
$oplist = interpret_directive($directive);
$op_header = $oplist->[0][1];
+ push @email_addresses,
+ directory_email_addresses($op_header->{directory});
+
# Phone home. E-mail the contents of the directive file to the maintainer,
# for debugging purposes.
if (defined $op_header->{package}) {
$complete = 1;
};
+ @{$info{email}} = @email_addresses;
+
if ($complete) {
local $Phase = 'RP';
if (ref $E) {
# Processing explicitly threw an exception
if ($E->type_p('directive_syntax')) {
+ # If a directive_syntax exception is thrown, we may not have the
+ # email addresses corresponding to the target directory in the list
+ # and may not even have a target directory.
+ push @email_addresses, directory_email_addresses($E->directory)
+ if $E->directory;
+ @{$info{email}} = @email_addresses;
mail(join("\n",$E->summary,'',$E->trace_msg),1);
} elsif ($E->type_p('package_configuration')) {
mail($E->summary,0);