Tidy conditional near summary report
authorJacob Bachmeyer <jcb@gnu.org>
Fri, 4 Aug 2023 22:27:37 +0000 (17:27 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Fri, 4 Aug 2023 22:27:37 +0000 (17:27 -0500)
(Aggregates in Perl, treated as Boolean values, are false if empty.)

gatekeeper.pl

index 43f81cd2dc23e7b2e07d801d063bce765fcbc75b..417ec9dfb4c4a0a96e79713975622ec6f255424d 100755 (executable)
@@ -3520,14 +3520,14 @@ foreach my $packet (@packets) {
   }
 }
 
-if ((scalar @packets) == 0) {
-  ftp_syslog info => "No files found for processing.";
-} else {
+if (@packets) {
   ftp_syslog info => "Processing complete: "
             .(scalar @packets)." uploads processed.";
   system FTPINDEX_TOOL, CONF_DIR_FTPRoot, CONF_DIR_Staging
     unless IN_TEST_MODE;
   ftp_syslog info => "Updated ftpindex";
+} else {
+  ftp_syslog info => "No files found for processing.";
 }
 
 # Clean up the inbox directory and the scratch directory by removing