Move check for missing "directory" element to interpret_directive
authorJacob Bachmeyer <jcb@gnu.org>
Thu, 3 Nov 2022 02:55:21 +0000 (21:55 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Thu, 3 Nov 2022 02:55:21 +0000 (21:55 -0500)
This is now considered a directive syntax error and detected earlier;
the testsuite is adjusted accordingly.

gatekeeper.pl
testsuite/gatekeeper.all/01_loose.exp
testsuite/gatekeeper.all/03_triplet.exp
testsuite/lib/gatekeeper.exp

index 0064a2cbe4827a476ed10521ad4641d4948275ba..b280f0f47104ac3cac97014d909654e9c7d859ce 100755 (executable)
@@ -1848,6 +1848,14 @@ sub interpret_directive {
       { push @ops, ($install = [install => $header{filename}]) }
   }
 
+  # They have to specify a directory directive.
+  unless ($header{directory}) {
+    # 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.
+    push @errors, "no directory element specified in directive";
+  }
+
   # Set email addresses
   if (defined $header{directory}) {
     my @a = directory_email_addresses($header{directory});
@@ -1976,14 +1984,6 @@ sub validate_commands {
   my $stem = substr $packet->[0],0,-(length '.directive.asc');
   my $op_header = $ops->[0][1];
 
-  # They have to specify a directory directive.
-  unless ($op_header->{directory}) {
-    # 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 $stem.directive.asc",1);
-  }
-
   # Configuration must exist for the package
   -d File::Spec->catdir($package_config_base, $op_header->{package})
     or fatal("no configuration directory for package $op_header->{package}",0);
index 43d04d594316d38661c611b3cee50c09f36399f2..00206f13f450410533fed981f515d0869e68f04a 100644 (file)
@@ -170,7 +170,7 @@ check_loose_directive "bogus: signed with no directory specified" {
 } log {
     validate,no-directory-given "directive rejected: no directory specified"
 } email-to {
-    ftp-upload-script@gnu.org ftp-upload-report@gnu.org
+    ftp-upload-script@gnu.org
     foo@example.gnu.org
 }
 
index 9af852f33b8c8bc8b00e3de3609d27c06f38d66b..d31bcf4a2e0eb9c55ceaed12bc8d87085906bd5a 100644 (file)
@@ -974,7 +974,6 @@ foreach FVER $DIRECTIVE_FORMAT_VERSIONS {
                "directive file with no directory key rejected"
        } email-to {
            ftp-upload-script@gnu.org foo@example.gnu.org
-           ftp-upload-report@gnu.org
        }
     }
 
index 52a7b2623400484312d4ad508bb9083b50532513..c5e521ce10b9dc7605579e78e07f00a323bf3782 100644 (file)
@@ -655,7 +655,7 @@ proc analyze_log { base_dir name assess } {
                     exp_continue
                 }
        -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\
-                no directory directive specified in [^\r\n]+} {
+                no directory element specified in [^\r\n]+} {
                     # from read_directive_file, if no directory key found
                     set A(validate,no-directory-given) 1
                     exp_continue