From a18ac23599612f0c7491b6e4c541cc1a017dea66 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Tue, 18 Oct 2022 21:50:12 -0500 Subject: [PATCH] Use operation list header instead of %info hash in read_directive_file --- gatekeeper.pl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 5ee31bb..f95372c 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1490,7 +1490,8 @@ sub read_directive_file { push(@{$info{email}},$1) if ($tmp_retval =~ /Good signature from .*?<(.*?)>/); - my @ops = interpret_directive($directive, $directive_file_contents); + my $ops = interpret_directive($directive, $directive_file_contents); + my $op_header = $ops->[0][1]; if (exists($info{"replace"}) && ($info{"version"} eq '1.1')) { fatal("invalid directive 'replace', not supported prior to version 1.2", @@ -1500,14 +1501,14 @@ sub read_directive_file { # Phone home. E-mail the contents of the directive file to the maintainer, # for debugging purposes. After this point, we don't need to pass the # $directive_file_contents to any subsequent fatal calls. - if (defined $info{'package'}) { - debug($directive_file_contents, $info{'package'}) if DEBUG; + if (defined $op_header->{package}) { + debug($directive_file_contents, $op_header->{package}) if DEBUG; } else { debug($directive_file_contents, '') if DEBUG; } # They have to specify a directory directive. - if (!$info{"directory"}) { + 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. @@ -1554,11 +1555,11 @@ sub read_directive_file { } # Configuration must exist for the package - -d $package_config_base . '/' . $info{"package"} - or fatal("no configuration directory for package $info{package}",0); + -d $package_config_base . '/' . $op_header->{package} + or fatal("no configuration directory for package $op_header->{package}",0); # Check that we have a keyring for this package: - my @keyrings = keyring_file ($info{package},$info{directory}); + my @keyrings = keyring_file ($op_header->{package},$op_header->{directory}); fatal("no keyring for package $info{package}",0) if ($#keyrings < 0); if ($filename_required) { @@ -1587,7 +1588,7 @@ sub read_directive_file { # They have to specify a version fatal("no version directive specified in $directive_file",1) - if ! $info{"version"}; + unless defined $op_header->{version}; my $retval = verify_keyring($directive_file,$directive_file_contents, @keyrings); -- 2.25.1