From: unknown Date: Wed, 19 Dec 2007 16:42:35 +0000 (-0600) Subject: Import version as of 2007-12-19 for upload-ftp-v1.1.pl X-Git-Tag: 20200730__import~45 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a95cd8541ca50f398747c23cdf545b4df8c4feae;p=gatekeeper.git Import version as of 2007-12-19 for upload-ftp-v1.1.pl --- diff --git a/upload-ftp-v1.1.pl b/upload-ftp-v1.1.pl index 42fd2fc..de9cbd4 100755 --- a/upload-ftp-v1.1.pl +++ b/upload-ftp-v1.1.pl @@ -95,9 +95,9 @@ my $V1_COMPAT_ALLOWED = 1; my $NAME = 'upload-ftp-v1.1.pl'; my $VERSION = '1.1'; # This is the protocol version -my $DATE = '2007/04/06 15:56:44'; +my $DATE = '2007/11/13 14:25:44'; my $AUTHOR = "the Free Software Foundation "; -my $COPYRIGHT = "2003-2006"; +my $COPYRIGHT = "2003-2007"; my $LICENSE = "GPL - http://www.fsf.org/licenses/gpl.txt"; my $URL = "http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html"; @@ -177,6 +177,7 @@ sub main # have any directory. chdir ($incoming_dir) || ftp_die("FATAL: chdir($incoming_dir) failed: $!"); my @incoming = &scan_incoming (); + # we've moved the files to work on to a new directory. chdir ($incoming_tmp) || ftp_die("FATAL: chdir($incoming_tmp) failed: $!"); @@ -303,8 +304,9 @@ sub execute_commands { unlink("$destdir/$1") || &fatal("removal of symlink $1 failed: $!",1); ftp_syslog('info', "($log_style) removed symlink $destdir/$1"); } elsif ($key =~ /^archive-(.*)/) { + # We now also allow archiving entire directories + archive($destdir, $originfo{directory}, "$1.sig") if (! -d "$destdir/$1"); archive($destdir, $originfo{directory}, $1); - archive($destdir, $originfo{directory}, "$1.sig") } } @@ -989,22 +991,26 @@ sub fatal { sub mail { my ($msg) = shift; my ($send_to_user) = shift; - my ($subject) = shift; - $subject ||= ''; + my ($subject) = shift; + $subject ||= ''; my @email_list = ($email_always); - # Some messages should be sent to the user, some should not + # Some messages should be sent to the user, some should not push (@email_list, @{$info{email}}) if (defined $info{email} && $send_to_user); # print STDERR "final emails: @email_list\n"; # return @_; - + my $smtp = Net::SMTP->new ("127.0.0.1"); ftp_die("FATAL: SMTP connection failed") unless $smtp; $smtp->mail ("ftp-upload-script\@gnu.org"); $smtp->recipient (@email_list, { SkipBad => 1}); + ftp_syslog('warning', "Sending email to @email_list"); + ftp_syslog('warning', "Subject is $subject"); + ftp_syslog('warning', "message: $msg"); + $smtp->data (); $smtp->datasend ("To: " . join (", ", @email_list) . "\n"); $smtp->datasend ("From: ftp-upload-script\@gnu.org\n");