# - 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.
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';