From a2c3e3e6cc743b523c4806722c632556d87dda2a Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 1 Apr 2023 13:16:15 -0500 Subject: [PATCH] Use FTP index builder in gatekeeper source tree --- gatekeeper.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index e8b2713..04f82c5 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -278,7 +278,11 @@ BEGIN { if ($TestingMode) { # We trust our test environment, but taint mode forces this issue. $FindBin::Bin =~ m[^(/[[:graph:] ]+)$] - or die "strange base path for test environment"; + or die "strange base path for test environment: $FindBin::Bin"; + + # not actually used in test mode, but defined anyway + constant->import(FTPINDEX_TOOL => + File::Spec->catfile($1, 'make-ftpindex.sh')); my $gpgv_mock = File::Spec->catfile($1, qw(testsuite lib exec mockgpgv)); constant->import(GPGV_BIN => $gpgv_mock); @@ -286,6 +290,12 @@ BEGIN { my $sys_mock = File::Spec->catfile($1, qw(testsuite lib exec mocktool)); constant->import(LSOF_BIN => $sys_mock, 'lsof'); } else { + $FindBin::Bin =~ m[^/([[:graph:] ]+)$] + or die "strange base path for production environment: $FindBin::Bin"; + + constant->import(FTPINDEX_TOOL => + File::Spec->catfile($1, 'make-ftpindex.sh')); + constant->import(GPGV_BIN => $GPGV_Bin); constant->import(LSOF_BIN => $LSOF_Bin); } @@ -3242,7 +3252,7 @@ if ((scalar @packets) == 0) { } else { ftp_syslog info => "Processing complete: " .(scalar @packets)." uploads processed."; - system("/usr/local/bin/generate-ftpindex") + system FTPINDEX_TOOL, CONF_DIR_Public, CONF_DIR_Staging unless IN_TEST_MODE; ftp_syslog info => "Updated ftpindex"; } -- 2.25.1