Rename 'target_filename' accessor to 'upload_filename'
authorJacob Bachmeyer <jcb@gnu.org>
Fri, 30 Jun 2023 03:28:59 +0000 (22:28 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Fri, 30 Jun 2023 03:28:59 +0000 (22:28 -0500)
This reflects the actual meaning of its return value, although the two
are currently synonymous.  Future plans may enable renaming a file pair
during its installation.  The current plans for autosigning support will
always rename autosign digest files during installation.

gatekeeper.pl

index 4ce9b3eff9276b4d1bae2782e5020619c591f1c2..de79f139bea042d6df8639ba9ab8f1c8bb3da92f 100755 (executable)
@@ -1634,8 +1634,6 @@ sub read_directive_from_string {
 
   sub target_package;
   sub target_directory;
-  sub target_filename;
-  sub target_filepair;  # always FILE, FILE.sig, in that order
 
   sub auth_keyrings;
 
@@ -1675,7 +1673,6 @@ sub read_directive_from_string {
 
   sub allow_overwrite  { (shift)->{oplist}->[0][1]->{options}{replace} }
   sub target_directory { (shift)->{oplist}->[0][1]->{directory} }
-  sub target_filename  { (shift)->{oplist}->[0][1]->{filename}  }
   sub target_package   { (shift)->{oplist}->[0][1]->{package}   }
 
   sub auth_keyrings {
@@ -1725,8 +1722,10 @@ sub read_directive_from_string {
 
   sub has_uploaded_file { return 1 }
 
+  sub upload_filename  { (shift)->{oplist}->[0][1]->{filename}  }
+
   sub target_filepair {
-    my $filename = (shift)->target_filename;
+    my $filename = (shift)->upload_filename;
     return $filename, $filename.'.sig';
   }
 
@@ -1745,7 +1744,7 @@ sub read_directive_from_string {
 
     throw signature_error => sig_info => $fsig_info,
       summary =>
-       'gpg verify of upload file ('.$self->target_filename.') failed'
+       'gpg verify of upload file ('.$self->upload_filename.') failed'
          if $fsig_info->{exitcode} != 0 || defined $fsig_info->{TILT};
     throw signature_error => sig_info => $fsig_info,
       summary => "gpg verification problem: could not extract timestamp"
@@ -3262,7 +3261,7 @@ foreach my $packet (@packets) {   # each list element is an array reference
 
     # If the upload carries a file, check it for known Automake CVE issues.
     check_automake_vulnerabilities
-      (File::Spec->catfile(CONF_DIR_Scratch, $packet->target_filename))
+      (File::Spec->catfile(CONF_DIR_Scratch, $packet->upload_filename))
        if $packet->has_uploaded_file;
 
     # If the upload installs a file, check if the final file exists; if so,
@@ -3296,13 +3295,13 @@ foreach my $packet (@packets) { # each list element is an array reference
       # Do we need a subdirectory on CONF_DIR_Staging as well?  Can't quite
       # picture when we'd have a collision, so skip that for now.
       move_filepair
-       (CONF_DIR_Scratch, $packet->target_filename, CONF_DIR_Staging);
+       (CONF_DIR_Scratch, $packet->upload_filename, CONF_DIR_Staging);
     }
 
     foreach my $step (@{$oplist}[1..$#$oplist]) { # skip the header
       if ($step->[0] eq 'install') {
        execute_install($packet->target_directory, $step,
-                       $packet->target_filename);
+                       $packet->upload_filename);
       } elsif ($step->[0] eq 'symlink') {
        execute_symlink($packet->target_directory, $step);
       } elsif ($step->[0] eq 'rmsymlink') {