Convert "filename_required" flag in read_directive_file to scaffolding
authorJacob Bachmeyer <jcb@gnu.org>
Thu, 20 Oct 2022 04:32:00 +0000 (23:32 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Thu, 20 Oct 2022 04:32:00 +0000 (23:32 -0500)
Further refactoring will eventually remove it entirely.

gatekeeper.pl

index d1969c9fcb63648fca85642054b413336a9b3d48..ed622558f4c5b836b9cc02616bc944cc50f15eee 100755 (executable)
@@ -1604,22 +1604,10 @@ sub read_directive_file {
     }
   }
 
-  # If there is a command in the directive that doesn't require an actual
-  # file to work on, we won't require the filename line in the directive
-  # file. This will allow people to upload a directive file only to
-  # archive/create symlinks/remove symlinks
-  my $filename_required = 1;
-
-  # There are a few possibilities regarding the 'filename' directive
-  # 1. It exists in the directive file - there is no problem
-  # 2. It doesn't exist in the directive file
-  #      In that case, we need to double check a few things.
-  #      This is permitted if the directive file contains commands that
-  #      don't require a filename - currently symlink, rmsymlink, and
-  #      archive - and only the directive file was uploaded
-  if (!exists($info{filename})) {
-    $filename_required = 0;
-  }
+  # The above check that the directive contains at least one command
+  # ensures that we either have a filename or do not need one before we
+  # reach this point.  This is temporarily kept as scaffolding.
+  my $filename_required = exists($info{filename});
 
   if ($filename_required) {
     # Ben Pfaff <blp@cs.stanford.edu> wrote: