From b908194457a7e6f09b90a30f79078e58c6af9326 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 29 Oct 2022 23:44:48 -0500 Subject: [PATCH] Move test for missing version to interpret_directive This changes the handling for this type of invalid directive. These are no longer sent to the ftp-upload-report address, but instead go only to the ftp-upload-script box. The testsuite is adjusted accordingly. --- gatekeeper.pl | 6 +----- testsuite/gatekeeper.all/03_triplet.exp | 3 +-- testsuite/lib/gatekeeper.exp | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 4590c3c..3ca143a 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1668,7 +1668,7 @@ sub interpret_directive { } elsif (scalar @versions > 1) { push @errors, "invalid multiple version elements"; } else { # no version at all; no longer allowed - # This will be caught later, when the operation list is validated. + push @errors, "no version specified in directive"; } } @@ -1901,10 +1901,6 @@ sub validate_commands { my $stem = substr $packet->[0],0,-(length '.directive.asc'); my $op_header = $ops->[0][1]; - # They have to specify a version - fatal("no version directive specified in $stem.directive.asc",1) - unless defined $op_header->{version}; - # They have to specify a directory directive. unless ($op_header->{directory}) { # Send the warning to the upload-ftp script maintainer, and the person who diff --git a/testsuite/gatekeeper.all/03_triplet.exp b/testsuite/gatekeeper.all/03_triplet.exp index 5f40654..7d32e79 100644 --- a/testsuite/gatekeeper.all/03_triplet.exp +++ b/testsuite/gatekeeper.all/03_triplet.exp @@ -259,7 +259,6 @@ check_triplet "bogus: empty directive" setup { "found triplet" } email-to { ftp-upload-script@gnu.org foo@example.gnu.org - ftp-upload-report@gnu.org } } @@ -692,7 +691,7 @@ check_triplet "obsolete: v1.0 format directive" setup { validate,no-version "directive file lacking version rejected" } email-to { ftp-upload-script@gnu.org foo@example.gnu.org - ftp-upload-report@gnu.org foo@example.org foo@example.net + foo@example.org foo@example.net } } diff --git a/testsuite/lib/gatekeeper.exp b/testsuite/lib/gatekeeper.exp index 817c861..224ab76 100644 --- a/testsuite/lib/gatekeeper.exp +++ b/testsuite/lib/gatekeeper.exp @@ -685,11 +685,10 @@ proc analyze_log { base_dir name assess } { exp_continue } -re {^gatekeeper\[[0-9]+\]: \(Test\)\ - no version directive specified in ([^\r\n]+)} { + no version specified in directive} { # from read_directive_file, if no version given # This was valid in v1 but v1 is now obsolete. set A(validate,no-version) 1 - set A(validate,no-version,$expect_out(1,string)) 1 exp_continue } -re {^gatekeeper\[[0-9]+\]: \(Test\)\ -- 2.25.1