From 3f283398d7325a18f3fe8517bef4a875983bb9d6 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Fri, 28 Oct 2022 20:52:52 -0500 Subject: [PATCH] Remove old model in interpret_directive This removes most of the keys stored in the quasi-global %info hash, but the current package and collection of email addresses remain to resolve. --- gatekeeper.pl | 9 --------- 1 file changed, 9 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index acfd832..4cd4638 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1649,7 +1649,6 @@ sub interpret_directive { # The 'install' op carries the name of the file to install, while the # 'filename' element binds the directive signature to its intended # upload. These are assumed to be the same in protocol 1.2 and earlier. - my $cnt = 0; # TODO: remove this { # Extract version first, since directive elements may be in any order. my @versions = grep $_->[0] eq 'version', @$directive; @@ -1664,7 +1663,6 @@ sub interpret_directive { if (($val ne '1.1') and ($val ne '1.2')); $header{version} = $val; # TODO: parse? - $info{"version"} = $val; #ok. } elsif (scalar @versions > 1) { push @errors, "invalid multiple version elements"; } else { # no version at all; no longer allowed @@ -1702,7 +1700,6 @@ sub interpret_directive { $header{directory} = $val; # ok. $header{package} = $dirs[0]; # top-level name, no subdir - $info{directory} = $header{directory}; $info{package} = $header{package}; } elsif ($tainted_cmd eq 'filename') { # We use the same filename restrictions as scan_incoming @@ -1721,7 +1718,6 @@ sub interpret_directive { } $header{filename} = $val; - $info{"filename"} = {"value" => $val, "order" => $cnt++}; # ok. } elsif ($tainted_cmd eq 'version') { # already handled above } elsif ($tainted_cmd eq 'symlink') { @@ -1732,14 +1728,12 @@ sub interpret_directive { } # $1 -- link target $2 -- link name push @ops, [symlink => $1, $2]; - $info{"symlink-$1"} = {"link" => $2, "order" => $cnt++}; #ok. } elsif ($tainted_cmd eq 'rmsymlink') { unless ($tainted_val =~ /^($RE_filename_relative)$/) { push @errors, "invalid parameters for rmsymlink command: $tainted_val"; next; } push @ops, [rmsymlink => $1]; - $info{"rmsymlink-$1"} = {"order" => $cnt++}; #ok. } elsif ($tainted_cmd eq 'archive') { unless ($tainted_val =~ /^($RE_filename_relative)$/) { push @errors, @@ -1747,7 +1741,6 @@ sub interpret_directive { next; } push @ops, [archive => $1]; - $info{"archive-$1"} = {"order" => $cnt++}; #ok. } elsif ($tainted_cmd eq 'replace') { # This command is only supported from v1.2 unless ($tainted_val =~ /^(true|false)$/) { @@ -1763,13 +1756,11 @@ sub interpret_directive { } $options{replace} = ($1 eq 'true'); - $info{"replace"} = $1; #ok. } elsif ($tainted_cmd eq 'comment') { # Comments are ok, we ignore them } elsif (IN_TEST_MODE && $tainted_cmd eq 'no-op') { # The testsuite uses a no-op command to validate directive processing. push @ops, ['no-op']; - $info{'no-op'} = {order => $cnt++}; } else { push @errors, "Invalid directive line:\n\n $tainted_cmd $tainted_val"; } -- 2.25.1