From: Jacob Bachmeyer Date: Wed, 16 Nov 2022 00:26:42 +0000 (-0600) Subject: Merge success_upload and success_directive into top-level X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fca92711d4d05985d579c873976f3ecb318fbd42;p=gatekeeper.git Merge success_upload and success_directive into top-level --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 1aedbe3..1f848a3 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2572,32 +2572,6 @@ sub execute_commands { # - Clean up # -# Report success and unlink the directive file. -# -sub success_upload { - my $sig_file = shift; - my $upload_file = shift; - my $directive_file = shift; - - our $Scratch_dir; - - mail ("upload of $upload_file and $sig_file complete",1); - - unlink File::Spec->catfile($Scratch_dir, $directive_file) - or warn "unlink($directive_file) failed: $!"; -} - -sub success_directive { - my $directive_file = shift; - - our $Scratch_dir; - - mail ("processing of $directive_file complete",1); - - unlink File::Spec->catfile($Scratch_dir, $directive_file) - or warn "unlink($directive_file) failed: $!"; -} - =item cleanup_dir ( $directory ) Remove all files older than one day from DIRECTORY. @@ -2791,13 +2765,18 @@ foreach my $packet (@packets) { # each list element is an array reference if ($complete) { local $Phase = 'RP'; + our $Scratch_dir; # report success - if (!$directive_only) { - success_upload($sig_file, $upload_file, $directive_file); + if ($directive_only) { + mail("processing of $directive_file complete",1); } else { - success_directive($directive_file); + mail("upload of $upload_file and $sig_file complete",1); } + + # unlink the directive file + unlink File::Spec->catfile($Scratch_dir, $directive_file) + or warn "unlink($directive_file) failed: $!"; } else { local $Phase = 'RP';