Import version as of 2007-08-02 for upload-ftp-v1.1.pl
authorunknown <sysadmin@gnu.org>
Thu, 2 Aug 2007 22:16:25 +0000 (17:16 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Wed, 29 Jul 2020 03:06:53 +0000 (22:06 -0500)
upload-ftp-v1.1.pl

index 98810cf84dff3029cfdd1efba05082cc2506fb8e..42fd2fc65c77b9eb2c78a65f8113260b5fa9e810 100755 (executable)
@@ -461,7 +461,7 @@ sub email_addresses {
        my @ret;
 
        open (EMAIL_FILE, "<", "$package_config_base/$package_name/email")
-               || &fatal("open $package_name email config failed: $!",0);
+               || &fatal("unable to find configuration for package $package_name, probably caused by a missing/erroneous 'directory' line in your directive file",1);
 
        while (<EMAIL_FILE>) {
                chomp;
@@ -498,6 +498,21 @@ sub read_directive_file {
   # That'll take manual intervention (i.e., email to maintainers@gnu.org).
   open (DIRECTIVE_FILE, "<", $directive_file) 
   || ftp_die("FATAL: open($directive_file) failed: $!");
+
+       # If we don't know whose project this file belongs to, because the
+       # 'directory:' line is messed up or not there, we'd still like to let the
+       # uploader know something went wrong.  So let's see if we can match the
+       # directive file signature against one of our public keyrings.
+       my @tmp_keyrings;
+       open(TMP,"/usr/bin/find $package_config_base -name pubring.gpg|");
+       while(<TMP>) {
+               chomp();
+               push(@tmp_keyrings,$_);
+       }
+       close(TMP);
+
+       my $tmp_retval = &verify_keyring($directive_file,@tmp_keyrings);
+       push(@{$info{email}},$1) if ($tmp_retval =~ /Good signature from .*?<(.*?)>/);
   
   my $signed = 0;
   # If there is a command in the directive that doesn't require an actual file to work
@@ -605,29 +620,12 @@ sub read_directive_file {
 
   # They have to specify a directory directive.
   if (!$info{"directory"}) {
-               # Now, this is tricky. We don't know whose project this file belongs to,
-               # because the 'directory:' line is messed up or not there. Ideally we'd
-               # like to let the uploader know that something went wrong though.  So let's
-               # see if we can match the signature against one of our public keyrings.
-               my @keyrings;
-               open(TMP,"/usr/bin/find $package_config_base -name pubring.gpg|");
-               while(<TMP>) {
-                       chomp();
-                       push(@keyrings,$_);
-               }
-               close(TMP);
-
-               my $retval = &verify_keyring($directive_file,@keyrings);
-               push(@{$info{email}},$1) if ($retval =~ /Good signature from .*?<(.*?)>/);
-
-               # Now send the warning to the upload-ftp script maintainer, and the person
-               # who signed the file, if we know who it is.
+               # Send the warning to the upload-ftp script maintainer, and the person who
+               # signed the file, if we were able to extract that from the signature on
+               # the directive file.
                &fatal("no directory directive specified in $directive_file",1);
-
        }
 
-
-
   # There are a few possibilities regarding the 'filename' directive
   # 1. It exists in the directive file - there is no problem
   # 2. It doesn't exist in the directive file