X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwAltId.pm;h=b90819a2d8a10bf3360facd5f341e65f698914cd;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=630ed6861cfc8d6ff21a167dfbd9a14ea95bca5b;hpb=2fc67a18b7ccd75ea6eb945f18203cbf4bcf228f;p=public-inbox.git diff --git a/lib/PublicInbox/WwwAltId.pm b/lib/PublicInbox/WwwAltId.pm index 630ed686..b90819a2 100644 --- a/lib/PublicInbox/WwwAltId.pm +++ b/lib/PublicInbox/WwwAltId.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2020 all contributors +# Copyright (C) 2020-2021 all contributors # License: AGPL-3.0+ # dumps using the ".dump" command of sqlite3(1) @@ -8,18 +8,9 @@ use PublicInbox::Qspawn; use PublicInbox::WwwStream qw(html_oneshot); use PublicInbox::AltId; use PublicInbox::Spawn qw(which); +use PublicInbox::GzipFilter; our $sqlite3 = $ENV{SQLITE3}; -sub sqlite3_missing ($) { - html_oneshot($_[0], 501, \<sqlite3 not available - -The administrator needs to install the sqlite3(1) binary -to support gzipped sqlite3 dumps. - -EOF -} - sub check_output { my ($r, $bref, $ctx) = @_; return html_oneshot($ctx, 500) if !defined($r); @@ -39,7 +30,7 @@ sub check_output { sub sqldump ($$) { my ($ctx, $altid_pfx) = @_; my $env = $ctx->{env}; - my $ibx = $ctx->{-inbox}; + my $ibx = $ctx->{ibx}; my $altid_map = $ibx->altid_map; my $fn = $altid_map->{$altid_pfx}; unless (defined $fn) { @@ -64,23 +55,12 @@ or EOF } - eval { require PublicInbox::GzipFilter } or - return html_oneshot($ctx, 501, \<gzip output not available - -The administrator needs to install the Compress::Raw::Zlib Perl module -to support gzipped sqlite3 dumps. -EOF - $sqlite3 //= which('sqlite3'); - if (!defined($sqlite3)) { - return html_oneshot($ctx, 501, \<sqlite3 not available The administrator needs to install the sqlite3(1) binary to support gzipped sqlite3 dumps. - EOF - } # setup stdin, POSIX requires writes <= 512 bytes to succeed so # we can close the pipe right away.