From: Jacob Bachmeyer Date: Fri, 18 Nov 2022 03:58:17 +0000 (-0600) Subject: Merge execute_commands into top-level X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=da68da5ebaab39d28422c3305f38c3420bbceae3;p=gatekeeper.git Merge execute_commands into top-level --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 3660c00..6c13798 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2611,40 +2611,6 @@ sub execute_rmsymlink { "removed symlink $step->[1] in ".File::Spec::Unix->catdir(@$directory); } -=item execute_commands ( $oplist ) - -Execute the commands in OPLIST. - -=cut - -sub execute_commands { - my $oplist = shift; - - our $Scratch_dir; our $Public_dir; - - abort "invalid internal operation list" - unless $oplist->[0][0] eq 'header'; - my $header = $oplist->[0][1]; - my @directory = File::Spec::Unix->splitdir($header->{directory}); - - foreach my $step (@{$oplist}[1..$#$oplist]) { # skip the header - if ($step->[0] eq 'install') { - install_files($header, $step); - } elsif ($step->[0] eq 'symlink') { - execute_symlink(\@directory, $step); - } elsif ($step->[0] eq 'rmsymlink') { - execute_rmsymlink(\@directory, $step); - } elsif ($step->[0] eq 'archive') { - # We now also allow archiving entire directories - archive_filepair(\@directory, $step->[1]); - } elsif (IN_TEST_MODE && $step->[0] eq 'no-op') { - # do nothing - } else { - abort "unknown internal operation: $step->[0]"; - } - } -} - =back @@ -2831,8 +2797,25 @@ foreach my $packet (@packets) { # each list element is an array reference if find_directive_elements($directive, 'filename'); $Phase = 'EX'; - # do the work - execute_commands($oplist); + + my @directory = File::Spec::Unix->splitdir($op_header->{directory}); + + foreach my $step (@{$oplist}[1..$#$oplist]) { # skip the header + if ($step->[0] eq 'install') { + install_files($op_header, $step); + } elsif ($step->[0] eq 'symlink') { + execute_symlink(\@directory, $step); + } elsif ($step->[0] eq 'rmsymlink') { + execute_rmsymlink(\@directory, $step); + } elsif ($step->[0] eq 'archive') { + # We now also allow archiving entire directories + archive_filepair(\@directory, $step->[1]); + } elsif (IN_TEST_MODE && $step->[0] eq 'no-op') { + # do nothing + } else { + abort "unknown internal operation: $step->[0]"; + } + } $complete = 1; };