From 013bc439ba19f4aa51f417d315086cb9832f0f01 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Wed, 16 Nov 2022 20:52:11 -0600 Subject: [PATCH] Revise reporting of replaced files --- gatekeeper.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 4c2ab37..9f804e9 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2474,24 +2474,20 @@ sub install_files { 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. # @@ -2777,7 +2773,11 @@ foreach my $packet (@packets) { # each list element is an array reference 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 -- 2.25.1