From: Jacob Bachmeyer Date: Thu, 3 Nov 2022 02:55:21 +0000 (-0500) Subject: Move check for missing "directory" element to interpret_directive X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=589b9640aef53d4e3a30245e8ccdc8a4306aa260;p=gatekeeper.git Move check for missing "directory" element to interpret_directive This is now considered a directive syntax error and detected earlier; the testsuite is adjusted accordingly. --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 0064a2c..b280f0f 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -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); diff --git a/testsuite/gatekeeper.all/01_loose.exp b/testsuite/gatekeeper.all/01_loose.exp index 43d04d5..00206f1 100644 --- a/testsuite/gatekeeper.all/01_loose.exp +++ b/testsuite/gatekeeper.all/01_loose.exp @@ -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 } diff --git a/testsuite/gatekeeper.all/03_triplet.exp b/testsuite/gatekeeper.all/03_triplet.exp index 9af852f..d31bcf4 100644 --- a/testsuite/gatekeeper.all/03_triplet.exp +++ b/testsuite/gatekeeper.all/03_triplet.exp @@ -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 } } diff --git a/testsuite/lib/gatekeeper.exp b/testsuite/lib/gatekeeper.exp index 52a7b26..c5e521c 100644 --- a/testsuite/lib/gatekeeper.exp +++ b/testsuite/lib/gatekeeper.exp @@ -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