From a4fdfcba0a5b7bf9ad0bfe27fbeb04bdf592099e Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Thu, 20 Oct 2022 22:51:25 -0500 Subject: [PATCH] Add operation list to execute_commands call This also adds a simple consistency check in execute_commands. --- gatekeeper.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index ab9a30a..b4dbcf5 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1924,6 +1924,7 @@ sub install_files { # they were specified in, thanks to the 'order' value in the %info # hash sub execute_commands { + my $oplist = shift; my $files = shift; my %info = @_; @@ -1938,6 +1939,10 @@ sub execute_commands { delete($info{version}); delete($info{'replace'}); + ftp_abort("invalid internal operation list") + unless $oplist->[0][0] eq 'header'; + my $header = $oplist->[0][1]; + my $destdir = "$destfinal/$originfo{directory}"; foreach my $key (sort { $info{$a}{order} <=> $info{$b}{order} } keys %info) { if ($key eq 'filename') { @@ -2083,7 +2088,8 @@ foreach my $packet (@packets) { # each list element is an array reference if ($oplist) { # do the work - execute_commands({directive => $directive_file, upload => $upload_file, + execute_commands($oplist, + {directive => $directive_file, upload => $upload_file, sig => $sig_file, directive_only => $directive_only}, %info); -- 2.25.1