Add options for specifying gpgv and lsof tools
authorJacob Bachmeyer <jcb@gnu.org>
Wed, 22 Mar 2023 03:05:15 +0000 (22:05 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Wed, 22 Mar 2023 03:05:15 +0000 (22:05 -0500)
This aligns the gatekeeper with the keymaster and permits the external
tools to be placed in a nonstandard location if desired.

gatekeeper.pl

index 73b8a5a7b509f1e6196856b2b2c3b9fdeb742d94..62a78a8b023786198cbb15733e1d15eb96b94e5e 100755 (executable)
@@ -70,6 +70,16 @@ Used for system distributions hosted or mirrored on ftp.gnu.org.
 
 =back
 
+=item B<--with-gpgv>
+
+Specify alternate location for GPG signature verfication tool.  Default is
+C</usr/bin/gpgv>.
+
+=item B<--with-lsof>
+
+Specify alternate location for lsof(8) open file checking tool.  Default is
+C</usr/bin/lsof>.
+
 =back
 
 There are also intentionally undocumented options, which can be found in
@@ -233,6 +243,9 @@ BEGIN {
   my $want_help = '';
   my $want_version = '';
 
+  my $GPGV_Bin = '/usr/bin/gpgv';
+  my $LSOF_Bin = '/usr/bin/lsof';
+
   # Set this to 1 or higher to get debug output in the log file.
   my $DEBUG = 1;
 
@@ -247,6 +260,8 @@ BEGIN {
   GetOptions('help' => \$want_help,
             'version' => \$want_version,
             'zone|z|s=s' => \$ZONE,
+            'with-gpgv=s' => \$GPGV_Bin,
+            'with-lsof=s' => \$LSOF_Bin,
             'tstampcheck=i' => \$TSTAMPCHECK,
             'nomail=i' => \$NOMAIL,
             'debug|d=i' => \$DEBUG,
@@ -274,8 +289,8 @@ BEGIN {
     my $sys_mock = File::Spec->catfile($1, qw(testsuite lib exec mocktool));
     constant->import(LSOF_BIN => $sys_mock, 'lsof');
   } else {
-    constant->import(GPGV_BIN => '/usr/bin/gpgv');
-    constant->import(LSOF_BIN => '/usr/bin/lsof');
+    constant->import(GPGV_BIN => $GPGV_Bin);
+    constant->import(LSOF_BIN => $LSOF_Bin);
   }
 }