]> Sergey Matveev's repositories - public-inbox.git/commitdiff
wwwaltid: drop unused sqlite3_missing function
authorEric Wong <e@80x24.org>
Wed, 2 Sep 2020 11:04:19 +0000 (11:04 +0000)
committerEric Wong <e@80x24.org>
Thu, 3 Sep 2020 20:11:03 +0000 (20:11 +0000)
It's inlined into the main function, which we'll shorten
slightly with the defined-or (`//') operator.  Also noticed
and fixed a mismatched HTML tag.

lib/PublicInbox/WwwAltId.pm

index e5476d1f50aeedf467feac6c0af56e57ce4baba7..2818400eabd17359446d3b72936a245b4f498bcb 100644 (file)
@@ -11,16 +11,6 @@ use PublicInbox::Spawn qw(which);
 use PublicInbox::GzipFilter;
 our $sqlite3 = $ENV{SQLITE3};
 
-sub sqlite3_missing ($) {
-       html_oneshot($_[0], 501, \<<EOF);
-<pre>sqlite3 not available
-
-The administrator needs to install the sqlite3(1) binary
-to support gzipped sqlite3 dumps.</pre>
-</pre>
-EOF
-}
-
 sub check_output {
        my ($r, $bref, $ctx) = @_;
        return html_oneshot($ctx, 500) if !defined($r);
@@ -65,16 +55,12 @@ or
 EOF
        }
 
-       $sqlite3 //= which('sqlite3');
-       if (!defined($sqlite3)) {
-               return html_oneshot($ctx, 501, \<<EOF);
+       $sqlite3 //= which('sqlite3') // return html_oneshot($ctx, 501, \<<EOF);
 <pre>sqlite3 not available
 
 The administrator needs to install the sqlite3(1) binary
 to support gzipped sqlite3 dumps.</pre>
-</pre>
 EOF
-       }
 
        # setup stdin, POSIX requires writes <= 512 bytes to succeed so
        # we can close the pipe right away.