mkdir_p $Public_dir, @directory;
- my $notification_str = '';
-
# We now allow overwriting of files - without warning!!
if (-e $final_signature || -e $final_upload) {
if ($header->{options}{replace}) {
archive_filepair([File::Spec::Unix->splitdir($header->{directory})],
$upload_file);
ftp_syslog('info', "overwriting $pubfinal with uploaded version");
- $notification_str .=
- "Archived and overwrote $pubfinal with uploaded version\n";
+ push @{$header->{notices}},
+ "Archived and overwrote $pubfinal with uploaded version";
} else {
throw processing_error => command => $step,
summary => $pubfinal." exists and 'replace' was not selected";
}
}
- mail ($notification_str) if ($notification_str ne '');
-
# Do we need a subdirectory on $Stage_dir as well? Can't quite picture
# when we'd have a collision, so skip that for now.
#
if ($directive_only) {
mail("processing of $directive_file complete",1);
} else {
- mail("upload of $upload_file and $sig_file complete",1);
+ my @messages = ("upload of $upload_file and $sig_file complete");
+ unshift @messages, @{$op_header->{notices}}, '' if $op_header->{notices};
+ # The "notices" key in the oplist header is a kludge, but seems to be
+ # the best immediate step to only send mail during the report phase.
+ mail(join("\n", @messages),1);
}
# unlink the directive file